diff options
author | sr55 <[email protected]> | 2014-10-25 17:12:03 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2014-10-25 17:12:03 +0000 |
commit | 172c9f50a07de174b39c6df0a62f90231b797113 (patch) | |
tree | 889728c232a0980e60daf8407ec05b0ce60443e5 /win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | |
parent | e9bfb09167b3ecfcf8c1bbb652a4d3da54d45243 (diff) |
WinGui: Block users from attempting to overwrite their input file.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6465 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 12 |
1 files changed, 12 insertions, 0 deletions
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);
|