diff options
author | sr55 <[email protected]> | 2011-06-02 19:03:17 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2011-06-02 19:03:17 +0000 |
commit | d567b769982ef6228b5ab6af4a6c41b07dc7ee97 (patch) | |
tree | a590a3c3f0509a6860387f7016fbc96a35cd0b29 /win/CS/Functions/Main.cs | |
parent | 2367252e6137aa96fd8d2eb1ec85d909a77ab697 (diff) |
WinGui: Improvements to the AutoName functionality.
- Added more flexibility to the "{source_path}" option so that it can now be used with additional folders listed after it. e.g. "{source_path}\encoded". It is no longer limited to just that folder.
- Added an option to put todays date in the output filename "{date}"
- Some tweaks to the way warnings are displayed when using these features to make them a bit less annoying.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4017 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/Functions/Main.cs')
-rw-r--r-- | win/CS/Functions/Main.cs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/win/CS/Functions/Main.cs b/win/CS/Functions/Main.cs index 41d004007..2775b8064 100644 --- a/win/CS/Functions/Main.cs +++ b/win/CS/Functions/Main.cs @@ -205,7 +205,8 @@ namespace Handbrake.Functions destinationFilename = Properties.Settings.Default.autoNameFormat;
destinationFilename = destinationFilename.Replace("{source}", sourceName)
.Replace("{title}", dvdTitle)
- .Replace("{chapters}", combinedChapterTag);
+ .Replace("{chapters}", combinedChapterTag)
+ .Replace("{date}", DateTime.Now.Date.ToShortDateString().Replace('/', '-'));
}
else
destinationFilename = sourceName + "_T" + dvdTitle + "_C" + combinedChapterTag;
@@ -239,9 +240,12 @@ namespace Handbrake.Functions */
// If there is an auto name path, use it...
- if (Properties.Settings.Default.autoNamePath.Trim() == "{source_path}" && !string.IsNullOrEmpty(mainWindow.sourcePath))
+ if (Properties.Settings.Default.autoNamePath.Trim().StartsWith("{source_path}") && !string.IsNullOrEmpty(mainWindow.sourcePath))
{
- autoNamePath = Path.Combine(Path.GetDirectoryName(mainWindow.sourcePath), destinationFilename);
+ string savedPath = Properties.Settings.Default.autoNamePath.Trim().Replace("{source_path}\\", string.Empty).Replace("{source_path}", string.Empty);
+ string requestedPath = Path.Combine(Path.GetDirectoryName(mainWindow.sourcePath), savedPath);
+
+ autoNamePath = Path.Combine(requestedPath, destinationFilename);
if (autoNamePath == mainWindow.sourcePath)
{
// Append out_ to files that already exist or is the source file
|