summaryrefslogtreecommitdiffstats
path: root/win/CS
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS')
-rw-r--r--win/CS/HandBrakeWPF/Properties/Resources.Designer.cs10
-rw-r--r--win/CS/HandBrakeWPF/Properties/Resources.resx4
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs14
3 files changed, 28 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
index 5770105f6..230a8d42c 100644
--- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
+++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
@@ -694,6 +694,16 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to You cannot overwrite the source file you want to convert.
+ ///Please choose a different filename..
+ /// </summary>
+ public static string Main_SourceDestinationMatchError {
+ get {
+ return ResourceManager.GetString("Main_SourceDestinationMatchError", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to You must turn on automatic file naming AND set a default path in preferences before you can add to the queue..
/// </summary>
public static string Main_TurnOnAutoFileNaming {
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx
index b21a76e81..a5e9e3878 100644
--- a/win/CS/HandBrakeWPF/Properties/Resources.resx
+++ b/win/CS/HandBrakeWPF/Properties/Resources.resx
@@ -552,4 +552,8 @@ Please use the 'Extra Options' box on the 'Video' tab to input any additional en
<data name="Video_EncoderExtraArgsTooltip" xml:space="preserve">
<value>Additional advanced arguments that can be passed to the video encoder.</value>
</data>
+ <data name="Main_SourceDestinationMatchError" xml:space="preserve">
+ <value>You cannot overwrite the source file you want to convert.
+Please choose a different filename.</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 18f994026..0048fe9d6 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -1220,6 +1220,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);
@@ -1524,6 +1531,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.