/// </param>\r
public ScanCompletedEventArgs(bool cancelled, Exception exception, string errorInformation, Source scannedSource)\r
{\r
- this.Successful = !cancelled && exception == null && string.IsNullOrEmpty(errorInformation);\r
+ this.Successful = !cancelled && exception == null && string.IsNullOrEmpty(errorInformation) && scannedSource != null && scannedSource.Titles != null && scannedSource.Titles.Count > 0;\r
this.Cancelled = cancelled;\r
this.Exception = exception;\r
this.ErrorInformation = errorInformation;\r
--- /dev/null
+<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"\r
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"\r
+ x:Class="HandBrakeWPF.Controls.AlertPanel"\r
+ >\r
+\r
+ <UserControl.Resources>\r
+ <BooleanToVisibilityConverter x:Key="boolTovisibility" />\r
+ </UserControl.Resources>\r
+ \r
+ <Grid>\r
+ <Grid.RowDefinitions>\r
+ <RowDefinition Height="*" />\r
+ <RowDefinition Height="Auto" />\r
+ <RowDefinition Height="*" />\r
+ </Grid.RowDefinitions>\r
+\r
+ <StackPanel Grid.Row="0" Background="Black" Opacity="0.45" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>\r
+\r
+ <Grid VerticalAlignment="Center" Grid.Row="1" HorizontalAlignment="Stretch"\r
+ Background="{Binding Background, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}">\r
+ \r
+ <Grid.RowDefinitions>\r
+ <RowDefinition Height="Auto" />\r
+ <RowDefinition Height="Auto" />\r
+ </Grid.RowDefinitions>\r
+\r
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Row="0" MaxHeight="220" MinHeight="220">\r
+ <Image Source="../Views/Images/information64.png" VerticalAlignment="Center" Height="64" Margin="18,10" />\r
+\r
+\r
+ <StackPanel VerticalAlignment="Center" Orientation="Vertical" >\r
+ <StackPanel VerticalAlignment="Center" MinWidth="300">\r
+ <TextBlock SnapsToDevicePixels="True" VerticalAlignment="Top" FontSize="26" FontFamily="Segoe UI Light" Margin="0,11,0,0" HorizontalAlignment="Left"\r
+ FontWeight="Bold" TextWrapping="WrapWithOverflow"\r
+ Text="{Binding Message, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"\r
+ />\r
+\r
+ <TextBlock SnapsToDevicePixels="True" VerticalAlignment="Top" FontSize="12" FontFamily="Segoe UI Light" Margin="0,5" HorizontalAlignment="Left"\r
+ Text="{Binding SubMessage, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" \r
+ TextWrapping="WrapWithOverflow"\r
+ />\r
+ </StackPanel>\r
+ \r
+ <Button Content="{Binding ActionText, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" Margin="0,10,0,0"\r
+ x:Name="StatusActionButton" Click="StatusActionButton_OnClick" Padding="8,2" HorizontalAlignment="Right"\r
+ Visibility="{Binding IsActionButtonVisible, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Converter={StaticResource boolTovisibility}}" />\r
+\r
+ </StackPanel>\r
+ </StackPanel>\r
+\r
+ \r
+ </Grid>\r
+\r
+ <StackPanel Grid.Row="2" Background="Black" Opacity="0.45" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>\r
+\r
+ </Grid>\r
+\r
+\r
+</UserControl>\r
<Compile Include="Commands\AdvancedEncoderOptionsCommand.cs" />\r
<Compile Include="Constants.cs" />\r
<Compile Include="Controls\SplitButton\SplitMenuButton.cs" />\r
+ <Compile Include="Controls\AlertPanel.xaml.cs">\r
+ <DependentUpon>AlertPanel.xaml</DependentUpon>\r
+ </Compile>\r
<Compile Include="Converters\Audio\AudioBehaviourConverter.cs" />\r
<Compile Include="Converters\Filters\DenoisePresetConverter.cs" />\r
<Compile Include="Converters\Subtitles\SubtitleBurnInBehaviourConverter.cs" />\r
<AppDesigner Include="Properties\" />\r
</ItemGroup>\r
<ItemGroup>\r
+ <Page Include="Controls\AlertPanel.xaml">\r
+ <Generator>MSBuild:Compile</Generator>\r
+ <SubType>Designer</SubType>\r
+ </Page>\r
<Page Include="Themes\Generic.xaml">\r
<SubType>Designer</SubType>\r
<Generator>MSBuild:Compile</Generator>\r
<ItemGroup>\r
<Resource Include="Views\Images\File32.png" />\r
</ItemGroup>\r
+ <ItemGroup>\r
+ <Resource Include="Views\Images\information64.png" />\r
+ </ItemGroup>\r
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
<Import Project="$(ProgramFiles)\MSBuild\StyleCop\v4.*\StyleCop.targets" />\r
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
}\r
\r
/// <summary>\r
- /// Looks up a localized string similar to Scan Failed... See Activity Log for details..\r
+ /// Looks up a localized string similar to Scan Failed... Please See Activity Log for details..\r
/// </summary>\r
public static string Main_ScanFailled_CheckLog {\r
get {\r
}\r
}\r
\r
+ /// <summary>\r
+ /// Looks up a localized string similar to No valid source or titles found..\r
+ /// </summary>\r
+ public static string Main_ScanNoTitlesFound {\r
+ get {\r
+ return ResourceManager.GetString("Main_ScanNoTitlesFound", resourceCulture);\r
+ }\r
+ }\r
+ \r
+ /// <summary>\r
+ /// Looks up a localized string similar to HandBrake will not be able to encode the seleteced source as it did not find a valid source with titles to encode. \r
+ ///This could be due to one of the following reasons:\r
+ ///- The source file is not a valid video file or is in a format that HandBrake does not support.\r
+ ///- The source may be copy protected or include DRM. Please note that HandBrake is not a ripper.\r
+ ///\r
+ ///The Activity log may have further information..\r
+ /// </summary>\r
+ public static string Main_ScanNoTitlesFoundMessage {\r
+ get {\r
+ return ResourceManager.GetString("Main_ScanNoTitlesFoundMessage", resourceCulture);\r
+ }\r
+ }\r
+ \r
/// <summary>\r
/// Looks up a localized string similar to You must first scan a source and setup your job before starting an encode..\r
/// </summary>\r
<value>Scan failed: </value>\r
</data>\r
<data name="Main_ScanFailled_CheckLog" xml:space="preserve">\r
- <value>Scan Failed... See Activity Log for details.</value>\r
+ <value>Scan Failed... Please See Activity Log for details.</value>\r
</data>\r
<data name="Main_ScanningPleaseWait" xml:space="preserve">\r
<value>Scanning source, please wait...</value>\r
First Track - The first track will be burned in.\r
Foreign Audio Preferred, else First - If the foreign audio track exists, it will be burned in, otherwise the first track will be chosen.</value>\r
</data>\r
+ <data name="Main_ScanNoTitlesFound" xml:space="preserve">\r
+ <value>No valid source or titles found.</value>\r
+ </data>\r
+ <data name="Main_ScanNoTitlesFoundMessage" xml:space="preserve">\r
+ <value>HandBrake will not be able to encode the seleteced source as it did not find a valid source with titles to encode. \r
+This could be due to one of the following reasons:\r
+- The source file is not a valid video file or is in a format that HandBrake does not support.\r
+- The source may be copy protected or include DRM. Please note that HandBrake is not a ripper.\r
+\r
+The Activity log may have further information.</value>\r
+ </data>\r
</root>
\ No newline at end of file
/// </summary>\r
private bool canPause;\r
\r
+ private bool showAlertWindow;\r
+\r
+ private string alertWindowHeader;\r
+\r
+ private string alertWindowText;\r
+\r
#endregion\r
\r
/// <summary>\r
}\r
}\r
\r
+ /// <summary>\r
+ /// Gets or sets a value indicating whether show alert window.\r
+ /// </summary>\r
+ public bool ShowAlertWindow\r
+ {\r
+ get\r
+ {\r
+ return this.showAlertWindow;\r
+ }\r
+ set\r
+ {\r
+ if (value.Equals(this.showAlertWindow))\r
+ {\r
+ return;\r
+ }\r
+ this.showAlertWindow = value;\r
+ this.NotifyOfPropertyChange(() => this.ShowAlertWindow);\r
+ }\r
+ }\r
+\r
+ /// <summary>\r
+ /// Gets or sets a value indicating whether alert window header.\r
+ /// </summary>\r
+ public string AlertWindowHeader\r
+ {\r
+ get\r
+ {\r
+ return this.alertWindowHeader;\r
+ }\r
+ set\r
+ {\r
+ if (value == this.alertWindowHeader)\r
+ {\r
+ return;\r
+ }\r
+ this.alertWindowHeader = value;\r
+ this.NotifyOfPropertyChange(() => this.AlertWindowHeader);\r
+ }\r
+ }\r
+\r
+ /// <summary>\r
+ /// Gets or sets a value indicating whether alert window text.\r
+ /// </summary>\r
+ public string AlertWindowText\r
+ {\r
+ get\r
+ {\r
+ return this.alertWindowText;\r
+ }\r
+ set\r
+ {\r
+ if (value == this.alertWindowText)\r
+ {\r
+ return;\r
+ }\r
+ this.alertWindowText = value;\r
+ this.NotifyOfPropertyChange(() => this.AlertWindowText);\r
+ }\r
+ }\r
+\r
+ /// <summary>\r
+ /// Gets the alert window close.\r
+ /// </summary>\r
+ public Action AlertWindowClose\r
+ {\r
+ get\r
+ {\r
+ return this.CloseAlertWindow;\r
+ }\r
+ }\r
+\r
#endregion\r
\r
#region Load and Shutdown Handling\r
this.ShowSourceSelection = false;\r
}\r
\r
+ /// <summary>\r
+ /// The close alert window.\r
+ /// </summary>\r
+ public void CloseAlertWindow()\r
+ {\r
+ this.ShowAlertWindow = false;\r
+ this.AlertWindowText = string.Empty;\r
+ this.AlertWindowHeader = string.Empty;\r
+ }\r
+\r
#endregion\r
\r
#region Main Window Public Methods\r
}\r
}\r
\r
+ /// <summary>\r
+ /// The open alert window.\r
+ /// </summary>\r
+ /// <param name="header">\r
+ /// The header.\r
+ /// </param>\r
+ /// <param name="message">\r
+ /// The message.\r
+ /// </param>\r
+ private void OpenAlertWindow(string header, string message)\r
+ {\r
+ this.ShowAlertWindow = true;\r
+ this.AlertWindowHeader = header;\r
+ this.AlertWindowText = message;\r
+ }\r
+\r
#endregion\r
\r
#region Event Handlers\r
{\r
this.NotifyOfPropertyChange(() => this.ScannedSource);\r
this.NotifyOfPropertyChange(() => this.ScannedSource.Titles);\r
- this.SelectedTitle = this.ScannedSource.Titles.FirstOrDefault(t => t.MainTitle)\r
- ?? this.ScannedSource.Titles.FirstOrDefault();\r
+ this.SelectedTitle = this.ScannedSource.Titles.FirstOrDefault(t => t.MainTitle) ?? this.ScannedSource.Titles.FirstOrDefault();\r
+ }\r
+ else\r
+ {\r
+ this.OpenAlertWindow(Resources.Main_ScanNoTitlesFound, Resources.Main_ScanNoTitlesFoundMessage);\r
}\r
\r
this.ShowStatusWindow = false;\r
this.SourceLabel = Resources.Main_ScanCancelled;\r
this.StatusLabel = Resources.Main_ScanCancelled;\r
}\r
- else if (e.Exception == null && e.ErrorInformation != null)\r
- {\r
- this.SourceLabel = Resources.Main_ScanFailed_NoReason + e.ErrorInformation;\r
- this.StatusLabel = Resources.Main_ScanFailed_NoReason + e.ErrorInformation;\r
- }\r
else\r
{\r
this.SourceLabel = Resources.Main_ScanFailled_CheckLog;\r
CancelAction="{Binding CancelAction}"\r
/>\r
\r
+ <Controls:AlertPanel x:Name="alertPanel"\r
+ Grid.Row="0"\r
+ Grid.RowSpan="3"\r
+ Visibility="{Binding ShowAlertWindow, Converter={StaticResource boolToVisConverter}, ConverterParameter=false, TargetNullValue=Collapsed, FallbackValue=Collapsed}"\r
+ VerticalAlignment="Stretch" HorizontalAlignment="Stretch"\r
+ Panel.ZIndex="10"\r
+ Message="{Binding AlertWindowHeader}"\r
+ SubMessage="{Binding AlertWindowText}"\r
+ ActionText="OK"\r
+ DefaultAction="{Binding AlertWindowClose}">\r
+ \r
+ </Controls:AlertPanel>\r
+\r
<!-- Status Bar -->\r
<StatusBar Grid.Row="2" Grid.ColumnSpan="2" MinHeight="32" >\r
\r
\r
<!-- Selection -->\r
<ListBox Grid.Row="2"\r
- MinHeight="250"\r
+ MinHeight="240"\r
MaxHeight="500"\r
Margin="10,10,10,10"\r
VerticalAlignment="Stretch"\r