From 42d3b4ab3f9e1efe98ad96eafcb8b39a75732924 Mon Sep 17 00:00:00 2001 From: sr55 Date: Thu, 24 Mar 2011 21:40:17 +0000 Subject: WinGui: Fix for "{source_path}" option. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3877 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/Functions/Main.cs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'win') diff --git a/win/CS/Functions/Main.cs b/win/CS/Functions/Main.cs index ae53efe90..33491ed96 100644 --- a/win/CS/Functions/Main.cs +++ b/win/CS/Functions/Main.cs @@ -244,20 +244,20 @@ namespace Handbrake.Functions destinationFilename += ".mkv"; // Now work out the path where the file will be stored. - // First case: If the destination box doesn't already contain a path, make one. - if (!mainWindow.text_destination.Text.Contains(Path.DirectorySeparatorChar.ToString())) + // If there is an auto name path, use it... + if (Properties.Settings.Default.autoNamePath.Trim() == "{source_path}" && !string.IsNullOrEmpty(mainWindow.sourcePath)) { - // If there is an auto name path, use it... - if (Properties.Settings.Default.autoNamePath.Trim() == "{source_path}" && !string.IsNullOrEmpty(mainWindow.sourcePath)) + autoNamePath = Path.Combine(Path.GetDirectoryName(mainWindow.sourcePath), destinationFilename); + if (autoNamePath == mainWindow.sourcePath) { - autoNamePath = Path.Combine(Path.GetDirectoryName(mainWindow.sourcePath), destinationFilename); - if (autoNamePath == mainWindow.sourcePath) - { - // Append out_ to files that already exist or is the source file - autoNamePath = Path.Combine(Path.GetDirectoryName(mainWindow.sourcePath), "output_" + destinationFilename); - } + // Append out_ to files that already exist or is the source file + autoNamePath = Path.Combine(Path.GetDirectoryName(mainWindow.sourcePath), "output_" + destinationFilename); } - else if (Properties.Settings.Default.autoNamePath.Trim() != string.Empty && Properties.Settings.Default.autoNamePath.Trim() != "Click 'Browse' to set the default location") + } + // Second case: If the destination box doesn't already contain a path, make one. + else if (!mainWindow.text_destination.Text.Contains(Path.DirectorySeparatorChar.ToString())) + { + if (Properties.Settings.Default.autoNamePath.Trim() != string.Empty && Properties.Settings.Default.autoNamePath.Trim() != "Click 'Browse' to set the default location") { autoNamePath = Path.Combine(Properties.Settings.Default.autoNamePath, destinationFilename); } -- cgit v1.2.3