diff options
author | sr55 <[email protected]> | 2011-04-27 19:40:41 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2011-04-27 19:40:41 +0000 |
commit | f3d48d42f46644795c5a35bf117edaeefe496ca3 (patch) | |
tree | c9a7056d0b48c13f20aa7bf687da3441c3177042 | |
parent | 2d81a5ec8e0851b306b82eea9fead769ff6517b3 (diff) |
WinGui:
- Automatically attempt to create destination path if it does not exist when starting an encode.
- When adding to queue, it'll optionally ask.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3962 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Services/Encode.cs | 8 | ||||
-rw-r--r-- | win/CS/frmMain.cs | 25 | ||||
-rw-r--r-- | win/CS/frmOptions.Designer.cs | 16 | ||||
-rw-r--r-- | win/CS/frmOptions.resx | 6 |
4 files changed, 45 insertions, 10 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode.cs index 0208eaf98..9232ea95e 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Encode.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Encode.cs @@ -169,6 +169,14 @@ namespace HandBrake.ApplicationServices.Services Win32.PreventSleep();
}
+ // Make sure the path exists, attempt to create it if it doesn't
+ string path = Directory.GetParent(queueTask.Destination).ToString();
+ if (!Directory.Exists(path))
+ {
+ // TODO - Better handle a directoryNotFound exception.
+ Directory.CreateDirectory(path);
+ }
+
string handbrakeCLIPath = Path.Combine(Application.StartupPath, "HandBrakeCLI.exe");
ProcessStartInfo cliStart = new ProcessStartInfo(handbrakeCLIPath, queueTask.Query)
{
diff --git a/win/CS/frmMain.cs b/win/CS/frmMain.cs index 51678516b..5c82fd2c9 100644 --- a/win/CS/frmMain.cs +++ b/win/CS/frmMain.cs @@ -1113,9 +1113,32 @@ namespace Handbrake if (!Directory.Exists(Path.GetDirectoryName(jobDestination)))
{
if (showError)
- MessageBox.Show(string.Format("Destination Path does not exist.\nPath: {0}\n\nThis item was not added to the Queue.", Path.GetDirectoryName(jobDestination)), "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ {
+ DialogResult result =
+ MessageBox.Show(
+ string.Format("Destination Path does not exist.\nPath: {0}\n\n Would you like to create it now?", Path.GetDirectoryName(jobDestination)),
+ "Warning",
+ MessageBoxButtons.YesNo,
+ MessageBoxIcon.Question);
+
+ if (result == DialogResult.Yes)
+ {
+ // Make sure the path exists, attempt to create it if it doesn't
+ string path = Directory.GetParent(jobDestination).ToString();
+ if (!Directory.Exists(path))
+ {
+ Directory.CreateDirectory(path);
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
+
return false;
}
+
// Make sure we don't have a duplciate on the queue.
if (this.queueProcessor.QueueManager.CheckForDestinationPathDuplicates(jobDestination))
diff --git a/win/CS/frmOptions.Designer.cs b/win/CS/frmOptions.Designer.cs index 3a5593864..1047f3a56 100644 --- a/win/CS/frmOptions.Designer.cs +++ b/win/CS/frmOptions.Designer.cs @@ -424,7 +424,7 @@ namespace Handbrake this.check_autoNaming.AutoSize = true;
this.check_autoNaming.Location = new System.Drawing.Point(111, 13);
this.check_autoNaming.Name = "check_autoNaming";
- this.check_autoNaming.Size = new System.Drawing.Size(171, 17);
+ this.check_autoNaming.Size = new System.Drawing.Size(176, 17);
this.check_autoNaming.TabIndex = 72;
this.check_autoNaming.Text = "Automatically name output files";
this.ToolTip.SetToolTip(this.check_autoNaming, "Automatically name output files");
@@ -624,7 +624,7 @@ namespace Handbrake this.radio_preferredAudioAndSubs.AutoSize = true;
this.radio_preferredAudioAndSubs.Location = new System.Drawing.Point(200, 99);
this.radio_preferredAudioAndSubs.Name = "radio_preferredAudioAndSubs";
- this.radio_preferredAudioAndSubs.Size = new System.Drawing.Size(250, 17);
+ this.radio_preferredAudioAndSubs.Size = new System.Drawing.Size(254, 17);
this.radio_preferredAudioAndSubs.TabIndex = 93;
this.radio_preferredAudioAndSubs.TabStop = true;
this.radio_preferredAudioAndSubs.Text = "Use Preferred Language for Audio and Subtitles";
@@ -637,7 +637,7 @@ namespace Handbrake this.check_AddCCTracks.AutoSize = true;
this.check_AddCCTracks.Location = new System.Drawing.Point(200, 131);
this.check_AddCCTracks.Name = "check_AddCCTracks";
- this.check_AddCCTracks.Size = new System.Drawing.Size(198, 17);
+ this.check_AddCCTracks.Size = new System.Drawing.Size(199, 17);
this.check_AddCCTracks.TabIndex = 92;
this.check_AddCCTracks.Text = "Add Closed Captions when available";
this.ToolTip.SetToolTip(this.check_AddCCTracks, "Add any CC tracks if they exist");
@@ -670,7 +670,7 @@ namespace Handbrake this.radio_foreignAndSubs.AutoSize = true;
this.radio_foreignAndSubs.Location = new System.Drawing.Point(200, 76);
this.radio_foreignAndSubs.Name = "radio_foreignAndSubs";
- this.radio_foreignAndSubs.Size = new System.Drawing.Size(347, 17);
+ this.radio_foreignAndSubs.Size = new System.Drawing.Size(358, 17);
this.radio_foreignAndSubs.TabIndex = 90;
this.radio_foreignAndSubs.TabStop = true;
this.radio_foreignAndSubs.Text = "Use foreign language audio and add first preferred language subtitle.";
@@ -695,7 +695,7 @@ namespace Handbrake this.radio_dub.AutoSize = true;
this.radio_dub.Location = new System.Drawing.Point(200, 53);
this.radio_dub.Name = "radio_dub";
- this.radio_dub.Size = new System.Drawing.Size(167, 17);
+ this.radio_dub.Size = new System.Drawing.Size(164, 17);
this.radio_dub.TabIndex = 89;
this.radio_dub.TabStop = true;
this.radio_dub.Text = "DUB Foreign Language Audio";
@@ -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(260, 17);
+ this.check_preventSleep.Size = new System.Drawing.Size(266, 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(162, 17);
+ this.check_clearOldLogs.Size = new System.Drawing.Size(166, 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(305, 17);
+ this.check_logsInSpecifiedLocation.Size = new System.Drawing.Size(306, 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.resx b/win/CS/frmOptions.resx index 6cfdf4403..98e4d33cc 100644 --- a/win/CS/frmOptions.resx +++ b/win/CS/frmOptions.resx @@ -120,6 +120,9 @@ <metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>132, 18</value>
</metadata>
+ <metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>132, 18</value>
+ </metadata>
<data name="cb_mp4FileMode.ToolTip" xml:space="preserve">
<value>The default file extension for MP4 Files.
Automatic - This will use M4v when AC3 Audio, SRT Subtitles or Chapters are present, otherwise MP4.
@@ -130,7 +133,8 @@ Note, the file itself is identical. This simply changes the default extension fo </data>
<data name="text_an_path.ToolTip" xml:space="preserve">
<value>This is the default location where your encoded files will be stored if "Automatically name output files" is enabled.
-You can enter {source_path} instead of a path to use the same path as the source file.</value>
+
+Hover over the "Available Options" text below for a more detailed description of the available advanced options.</value>
</data>
<data name="label34.ToolTip" xml:space="preserve">
<value>{source_path} = Use the same directory as the source is in.
|