diff options
-rw-r--r-- | win/CS/HandBrakeWPF/Properties/Resources.Designer.cs | 9 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Properties/Resources.resx | 3 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 12 |
3 files changed, 24 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs index 3cc320e5e..7f787b97f 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs @@ -428,6 +428,15 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
+ /// Looks up a localized string similar to You cannot encode to a file with the same path and name as the source file. Please update the destination filename so that it does not match the source file..
+ /// </summary>
+ public static string Main_MatchingFileOverwriteWarning {
+ get {
+ return ResourceManager.GetString("Main_MatchingFileOverwriteWarning", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to New Default Preset Set: {0}.
/// </summary>
public static string Main_NewDefaultPreset {
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx index ae889dd63..9a406c92c 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.resx +++ b/win/CS/HandBrakeWPF/Properties/Resources.resx @@ -527,4 +527,7 @@ Non-Live Options: {date} {time} {quality} {bitrate} (These only change if you s Not both at the same time!</value>
</data>
+ <data name="Main_MatchingFileOverwriteWarning" xml:space="preserve">
+ <value>You cannot encode to a file with the same path and name as the source file. Please update the destination filename so that it does not match the source 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 2bd91de96..81558c78d 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -1212,6 +1212,12 @@ namespace HandBrakeWPF.ViewModels return false;
}
+ if (this.scannedSource != null && !string.IsNullOrEmpty(this.scannedSource.ScanPath) && this.Destination.ToLower() == this.scannedSource.ScanPath.ToLower())
+ {
+ this.errorService.ShowMessageBox(Resources.Main_MatchingFileOverwriteWarning, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);
+ return false;
+ }
+
QueueTask task = new QueueTask(new EncodeTask(this.CurrentTask), HBConfigurationFactory.Create());
if (!this.queueProcessor.CheckForDestinationPathDuplicates(task.Task.Destination))
@@ -1370,6 +1376,12 @@ namespace HandBrakeWPF.ViewModels return;
}
+ if (this.scannedSource != null && !string.IsNullOrEmpty(this.scannedSource.ScanPath) && this.Destination.ToLower() == this.scannedSource.ScanPath.ToLower())
+ {
+ this.errorService.ShowMessageBox(Resources.Main_MatchingFileOverwriteWarning, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);
+ return;
+ }
+
if (File.Exists(this.Destination))
{
MessageBoxResult result = this.errorService.ShowMessageBox(Resources.Main_DestinationOverwrite, Resources.Question, MessageBoxButton.YesNo, MessageBoxImage.Question);
|