summaryrefslogtreecommitdiffstats
path: root/win/CS
diff options
context:
space:
mode:
authorsr55 <[email protected]>2018-05-24 21:07:20 +0100
committersr55 <[email protected]>2018-05-24 21:07:20 +0100
commit1b4d3a46f3643b73997973dca05f8558c0acafce (patch)
tree583ce267659a57091dd218faf7cf5fabc20db485 /win/CS
parentf6e6fc6c47298a0dd17dad6a6c387c18fe13c6b8 (diff)
WinGui: Don't allow subtitle import before a source has been scanned.
Diffstat (limited to 'win/CS')
-rw-r--r--win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs9
-rw-r--r--win/CS/HandBrakeWPF/Properties/ResourcesUI.resx3
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs9
-rw-r--r--win/CS/HandBrakeWPF/Views/MainView.xaml2
4 files changed, 22 insertions, 1 deletions
diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs
index 05cce7649..cc359053b 100644
--- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs
+++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs
@@ -1069,6 +1069,15 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to Please choose a source to encode before trying to import a subtitle file..
+ /// </summary>
+ public static string MainView_SubtitleBeforeScanError {
+ get {
+ return ResourceManager.GetString("MainView_SubtitleBeforeScanError", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Subtitles.
/// </summary>
public static string MainView_SubtitlesTab {
diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx
index cd19adc04..4e188b0ce 100644
--- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx
+++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx
@@ -1025,4 +1025,7 @@ This will not affect your current settings in the Subtitle tab.</value>
<data name="OptionsView_ShowPreviewOnSummaryTab" xml:space="preserve">
<value>Show previews on summary tab.</value>
</data>
+ <data name="MainView_SubtitleBeforeScanError" xml:space="preserve">
+ <value>Please choose a source to encode before trying to import a subtitle file.</value>
+ </data>
</root> \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index 3d19a81f5..a081d28d5 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -1839,6 +1839,15 @@ namespace HandBrakeWPF.ViewModels
return;
}
+ if (this.SelectedTitle == null)
+ {
+ MessageBox.Show(
+ ResourcesUI.MainView_SubtitleBeforeScanError,
+ Resources.Error,
+ MessageBoxButton.OK,
+ MessageBoxImage.Error);
+ }
+
// StartScan is not synchronous, so for now we don't support adding both srt and video file at the same time.
string[] subtitleFiles = fileNames.Where(f => Path.GetExtension(f)?.ToLower() == ".srt").ToArray();
if (this.SelectedTab != 5 && subtitleFiles.Any())
diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml
index 049e31a28..f3bf10401 100644
--- a/win/CS/HandBrakeWPF/Views/MainView.xaml
+++ b/win/CS/HandBrakeWPF/Views/MainView.xaml
@@ -120,7 +120,7 @@
</MenuItem>
<MenuItem Header="_Help">
- <MenuItem Header="_HandBrake Documentation (HTTP)" cal:Message.Attach="[Event Click] = [Action LaunchHelp]" InputGestureText="F1">
+ <MenuItem Header="_HandBrake Documentation (HTTPS)" cal:Message.Attach="[Event Click] = [Action LaunchHelp]" InputGestureText="F1">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="Images/information.png" />
</MenuItem.Icon>