summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels
diff options
context:
space:
mode:
authorsr55 <[email protected]>2015-02-09 20:50:34 +0000
committersr55 <[email protected]>2015-02-09 20:50:34 +0000
commit8c4f35e7a067f5b50cfbf0c3263a76da0c356e5c (patch)
tree15662c3c9141559b03c1e41852eb8776954278f1 /win/CS/HandBrakeWPF/ViewModels
parent3f47a700e7af5a34e49150e3cff3ddeb3276ad02 (diff)
[Merge] WinGui: More aggressive check that the user is not trying to overwrite the source file.
git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/0.10.x@6890 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs14
1 files changed, 14 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index 3665c7acf..ce9f9a04b 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -1219,6 +1219,13 @@ namespace HandBrakeWPF.ViewModels
return false;
}
+ if (this.Destination == this.ScannedSource.ScanPath)
+ {
+ this.errorService.ShowMessageBox(Resources.Main_SourceDestinationMatchError, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);
+ this.Destination = null;
+ 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);
@@ -1535,6 +1542,13 @@ namespace HandBrakeWPF.ViewModels
bool? result = saveFileDialog.ShowDialog();
if (result.HasValue && result.Value)
{
+ if (saveFileDialog.FileName == this.ScannedSource.ScanPath)
+ {
+ this.errorService.ShowMessageBox(Resources.Main_SourceDestinationMatchError, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);
+ this.Destination = null;
+ return;
+ }
+
this.Destination = saveFileDialog.FileName;
// Set the Extension Dropdown. This will also set Mp4/m4v correctly.