summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorsr55 <[email protected]>2011-06-02 19:03:17 +0000
committersr55 <[email protected]>2011-06-02 19:03:17 +0000
commitd567b769982ef6228b5ab6af4a6c41b07dc7ee97 (patch)
treea590a3c3f0509a6860387f7016fbc96a35cd0b29 /win
parent2367252e6137aa96fd8d2eb1ec85d909a77ab697 (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')
-rw-r--r--win/CS/Functions/Main.cs10
-rw-r--r--win/CS/frmOptions.Designer.cs14
-rw-r--r--win/CS/frmOptions.cs2
-rw-r--r--win/CS/frmOptions.resx3
4 files changed, 17 insertions, 12 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
diff --git a/win/CS/frmOptions.Designer.cs b/win/CS/frmOptions.Designer.cs
index 1047f3a56..2d91fcf3f 100644
--- a/win/CS/frmOptions.Designer.cs
+++ b/win/CS/frmOptions.Designer.cs
@@ -415,9 +415,9 @@ namespace Handbrake
this.label7.Location = new System.Drawing.Point(182, 126);
this.label7.Margin = new System.Windows.Forms.Padding(3);
this.label7.Name = "label7";
- this.label7.Size = new System.Drawing.Size(225, 13);
+ this.label7.Size = new System.Drawing.Size(260, 13);
this.label7.TabIndex = 81;
- this.label7.Text = "Available Options: {source} {title} {chapters}";
+ this.label7.Text = "Available Options: {source} {title} {chapters} {date}";
//
// check_autoNaming
//
@@ -513,9 +513,9 @@ namespace Handbrake
this.label34.Location = new System.Drawing.Point(182, 72);
this.label34.Margin = new System.Windows.Forms.Padding(3);
this.label34.Name = "label34";
- this.label34.Size = new System.Drawing.Size(278, 13);
+ this.label34.Size = new System.Drawing.Size(344, 13);
this.label34.TabIndex = 102;
- this.label34.Text = "Available Options: {source_path} {source_folder_name}";
+ this.label34.Text = "Available Options: {source_path} or {source_folder_name} (Not Both)";
this.ToolTip.SetToolTip(this.label34, resources.GetString("label34.ToolTip"));
//
// check_TitleCase
@@ -748,7 +748,7 @@ namespace Handbrake
this.check_preventSleep.AutoSize = true;
this.check_preventSleep.Location = new System.Drawing.Point(73, 45);
this.check_preventSleep.Name = "check_preventSleep";
- this.check_preventSleep.Size = new System.Drawing.Size(266, 17);
+ this.check_preventSleep.Size = new System.Drawing.Size(260, 17);
this.check_preventSleep.TabIndex = 91;
this.check_preventSleep.Text = "Prevent the system from sleeping when encoding.";
this.ToolTip.SetToolTip(this.check_preventSleep, "Prevent system from sleeping during encoding.");
@@ -761,7 +761,7 @@ namespace Handbrake
this.check_clearOldLogs.AutoSize = true;
this.check_clearOldLogs.Location = new System.Drawing.Point(73, 234);
this.check_clearOldLogs.Name = "check_clearOldLogs";
- this.check_clearOldLogs.Size = new System.Drawing.Size(166, 17);
+ this.check_clearOldLogs.Size = new System.Drawing.Size(162, 17);
this.check_clearOldLogs.TabIndex = 90;
this.check_clearOldLogs.Text = "Clear logs older than 30 days";
this.ToolTip.SetToolTip(this.check_clearOldLogs, "Clear logs which are older than 30 days.\r\nThis only applies to HandBrakes Applica" +
@@ -856,7 +856,7 @@ namespace Handbrake
this.check_logsInSpecifiedLocation.AutoSize = true;
this.check_logsInSpecifiedLocation.Location = new System.Drawing.Point(73, 139);
this.check_logsInSpecifiedLocation.Name = "check_logsInSpecifiedLocation";
- this.check_logsInSpecifiedLocation.Size = new System.Drawing.Size(306, 17);
+ this.check_logsInSpecifiedLocation.Size = new System.Drawing.Size(305, 17);
this.check_logsInSpecifiedLocation.TabIndex = 87;
this.check_logsInSpecifiedLocation.Text = "Put a copy of individual encode logs in a specified location:";
this.ToolTip.SetToolTip(this.check_logsInSpecifiedLocation, "Place a copy of the encode log in the same folder as the encoded movie.");
diff --git a/win/CS/frmOptions.cs b/win/CS/frmOptions.cs
index 1bdb894b3..a0753cfcc 100644
--- a/win/CS/frmOptions.cs
+++ b/win/CS/frmOptions.cs
@@ -313,7 +313,7 @@ namespace Handbrake
"Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
- if (text_an_path.Text.ToLower().Contains("{source_path}") && text_an_path.Text.ToLower() != "{source_path}")
+ if (text_an_path.Text.ToLower().Contains("{source_path}") && !text_an_path.Text.StartsWith("{source_path}"))
{
MessageBox.Show("Note you can not use the {source_path} within a path. {source_path} is the full source file path.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
diff --git a/win/CS/frmOptions.resx b/win/CS/frmOptions.resx
index 98e4d33cc..110371424 100644
--- a/win/CS/frmOptions.resx
+++ b/win/CS/frmOptions.resx
@@ -142,7 +142,8 @@ This option has to be used on it's own and can not be used as part of a path.
{source_folder_name} = Uses the folder name where the source is stored.
You can insert this anywhere in your path. e.g. c:\movies\{source_folder_name}
-It will substitute the name of the folder where the source is located.</value>
+It will substitute the name of the folder where the source is located.
+Note, this can't be used with the {source_path} option!</value>
</data>
<data name="check_showCliForInGUIEncode.ToolTip" xml:space="preserve">
<value>Shows the CLI window when encoding.