diff options
author | sr55 <[email protected]> | 2018-05-09 18:02:58 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2018-05-09 18:02:58 +0100 |
commit | c98aff0338b9b4b2742057154e93de3cac31372d (patch) | |
tree | 37ae6ad3833cf68615ec354deb72160c677b29c7 /win | |
parent | a6f3cd670f492a3474bf4695f1a8a6302fc3ed56 (diff) |
WinGui: Make the error checking more aggressive when adding to queue. Add support for bailing out if batch adding and errors occur.
Diffstat (limited to 'win')
-rw-r--r-- | win/CS/HandBrakeWPF/Properties/Resources.Designer.cs | 21 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Properties/Resources.resx | 9 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 25 |
3 files changed, 50 insertions, 5 deletions
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs index adc43621c..a22cf482b 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs @@ -669,7 +669,7 @@ namespace HandBrakeWPF.Properties { /// <summary>
/// Looks up a localized string similar to Warning: If you wish to have subtitles added to each item you are about to queue, please verify that you have the subtitle defaults setup correctly on the subtitles tab.
///
- /// Do you wish to continue?.
+ ///Do you wish to continue?.
/// </summary>
public static string Main_AutoAdd_AudioAndSubWarning {
get {
@@ -687,6 +687,15 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
+ /// Looks up a localized string similar to Unable to add the last job to the queue. Do you wish to proceed trying to add the rest?.
+ /// </summary>
+ public static string Main_ContinueAddingToQueue {
+ get {
+ return ResourceManager.GetString("Main_ContinueAddingToQueue", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to The current file already exists, do you wish to overwrite it?.
/// </summary>
public static string Main_DestinationOverwrite {
@@ -906,6 +915,16 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
+ /// Looks up a localized string similar to The file '{0}' already exists!
+ ///Would you like to overwrite it?.
+ /// </summary>
+ public static string Main_QueueOverwritePrompt {
+ get {
+ return ResourceManager.GetString("Main_QueueOverwritePrompt", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Queue Paused.
/// </summary>
public static string Main_QueuePaused {
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx index 830154c53..84d46f2b9 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.resx +++ b/win/CS/HandBrakeWPF/Properties/Resources.resx @@ -327,7 +327,7 @@ In order to use the QuickSync encoder, you must: <data name="Main_AutoAdd_AudioAndSubWarning" xml:space="preserve">
<value>Warning: If you wish to have subtitles added to each item you are about to queue, please verify that you have the subtitle defaults setup correctly on the subtitles tab.
- Do you wish to continue?</value>
+Do you wish to continue?</value>
</data>
<data name="Main_TurnOnAutoFileNaming" xml:space="preserve">
<value>You must turn on automatic file naming AND set a default path in preferences before you can add to the queue.</value>
@@ -878,4 +878,11 @@ Time Remaining: {5}, Elapsed: {6:d\:hh\:mm\:ss}</value> <data name="OsVersionWarning" xml:space="preserve">
<value>HandBrake requires Windows 7 or later to run. Version 0.9.9 (XP) and 0.10.5 (Vista) was the last version to support these versions.</value>
</data>
+ <data name="Main_ContinueAddingToQueue" xml:space="preserve">
+ <value>Unable to add the last job to the queue. Do you wish to proceed trying to add the rest?</value>
+ </data>
+ <data name="Main_QueueOverwritePrompt" xml:space="preserve">
+ <value>The file '{0}' already exists!
+Would you like to overwrite it?</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 8b1eb22e6..082e662fc 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -791,6 +791,7 @@ namespace HandBrakeWPF.ViewModels this.Destination = AutoNameHelper.AutoName(this.CurrentTask, this.SourceName, this.selectedPreset);
}
}
+
this.NotifyOfPropertyChange(() => this.CurrentTask);
this.Duration = this.DurationCalculation();
@@ -1490,6 +1491,15 @@ namespace HandBrakeWPF.ViewModels return false;
}
+ if (File.Exists(this.CurrentTask.Destination))
+ {
+ MessageBoxResult result = this.errorService.ShowMessageBox(string.Format(Resources.Main_QueueOverwritePrompt, Path.GetFileName(this.CurrentTask.Destination)), Resources.Question, MessageBoxButton.YesNo, MessageBoxImage.Question);
+ if (result == MessageBoxResult.No)
+ {
+ return false;
+ }
+ }
+
if (!DirectoryUtilities.IsWritable(Path.GetDirectoryName(this.CurrentTask.Destination), true, this.errorService))
{
this.errorService.ShowMessageBox(Resources.Main_NoPermissionsOrMissingDirectory, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);
@@ -1556,9 +1566,10 @@ namespace HandBrakeWPF.ViewModels if (this.CurrentTask != null && this.CurrentTask.SubtitleTracks != null && this.CurrentTask.SubtitleTracks.Count > 0)
{
- if (this.SubtitleViewModel.SubtitleBehaviours == null || this.SubtitleViewModel.SubtitleBehaviours.SelectedBehaviour == SubtitleBehaviourModes.None)
+ if ((this.SubtitleViewModel.SubtitleBehaviours == null || this.SubtitleViewModel.SubtitleBehaviours.SelectedBehaviour == SubtitleBehaviourModes.None)
+ && !(this.CurrentTask.SubtitleTracks.Count == 1 && this.CurrentTask.SubtitleTracks.First().SubtitleType == SubtitleType.ForeignAudioSearch))
{
- System.Windows.MessageBoxResult result = this.errorService.ShowMessageBox(
+ MessageBoxResult result = this.errorService.ShowMessageBox(
Resources.Main_AutoAdd_AudioAndSubWarning,
Resources.Warning,
MessageBoxButton.YesNo,
@@ -1574,7 +1585,15 @@ namespace HandBrakeWPF.ViewModels foreach (Title title in this.ScannedSource.Titles)
{
this.SelectedTitle = title;
- this.AddToQueue();
+ if (!this.AddToQueue())
+ {
+ MessageBoxResult result = this.errorService.ShowMessageBox(Resources.Main_ContinueAddingToQueue, Resources.Question, MessageBoxButton.YesNo, MessageBoxImage.Question);
+
+ if (result == MessageBoxResult.No)
+ {
+ break;
+ }
+ }
}
}
|