]> granicus.if.org Git - handbrake/commitdiff
WinGui:
authorsr55 <sr55.hb@outlook.com>
Wed, 27 Apr 2011 19:40:41 +0000 (19:40 +0000)
committersr55 <sr55.hb@outlook.com>
Wed, 27 Apr 2011 19:40:41 +0000 (19:40 +0000)
- 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

win/CS/HandBrake.ApplicationServices/Services/Encode.cs
win/CS/frmMain.cs
win/CS/frmOptions.Designer.cs
win/CS/frmOptions.resx

index 0208eaf9826c8ec858ce359424a7c795b34c66ee..9232ea95e4d26033238458db7bbc49d78cae912a 100644 (file)
@@ -169,6 +169,14 @@ namespace HandBrake.ApplicationServices.Services
                     Win32.PreventSleep();\r
                 }\r
 \r
+                // Make sure the path exists, attempt to create it if it doesn't\r
+                string path = Directory.GetParent(queueTask.Destination).ToString();\r
+                if (!Directory.Exists(path))\r
+                {\r
+                    // TODO - Better handle a directoryNotFound exception.\r
+                    Directory.CreateDirectory(path);\r
+                }\r
+\r
                 string handbrakeCLIPath = Path.Combine(Application.StartupPath, "HandBrakeCLI.exe");\r
                 ProcessStartInfo cliStart = new ProcessStartInfo(handbrakeCLIPath, queueTask.Query)\r
                 {\r
index 51678516bee0ac53b3650bc179fa24c00335c5a3..5c82fd2c90599216b224eeeb24c6a7a474bfa330 100644 (file)
@@ -1113,9 +1113,32 @@ namespace Handbrake
             if (!Directory.Exists(Path.GetDirectoryName(jobDestination)))\r
             {\r
                 if (showError)\r
-                    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);\r
+                {\r
+                    DialogResult result =\r
+                        MessageBox.Show(\r
+                            string.Format("Destination Path does not exist.\nPath: {0}\n\n Would you like to create it now?", Path.GetDirectoryName(jobDestination)),\r
+                            "Warning",\r
+                            MessageBoxButtons.YesNo,\r
+                            MessageBoxIcon.Question);\r
+\r
+                    if (result == DialogResult.Yes)\r
+                    {\r
+                        // Make sure the path exists, attempt to create it if it doesn't\r
+                        string path = Directory.GetParent(jobDestination).ToString();\r
+                        if (!Directory.Exists(path))\r
+                        {\r
+                            Directory.CreateDirectory(path);\r
+                        }\r
+                    } \r
+                    else\r
+                    {\r
+                        return false;\r
+                    }\r
+                }\r
+\r
                 return false;\r
             }\r
+        \r
 \r
             // Make sure we don't have a duplciate on the queue.\r
             if (this.queueProcessor.QueueManager.CheckForDestinationPathDuplicates(jobDestination))\r
index 3a559386426428396dc01bbbf52db412825df0d2..1047f3a568938846b39eb49e5445b54935468723 100644 (file)
@@ -424,7 +424,7 @@ namespace Handbrake
             this.check_autoNaming.AutoSize = true;\r
             this.check_autoNaming.Location = new System.Drawing.Point(111, 13);\r
             this.check_autoNaming.Name = "check_autoNaming";\r
-            this.check_autoNaming.Size = new System.Drawing.Size(171, 17);\r
+            this.check_autoNaming.Size = new System.Drawing.Size(176, 17);\r
             this.check_autoNaming.TabIndex = 72;\r
             this.check_autoNaming.Text = "Automatically name output files";\r
             this.ToolTip.SetToolTip(this.check_autoNaming, "Automatically name output files");\r
@@ -624,7 +624,7 @@ namespace Handbrake
             this.radio_preferredAudioAndSubs.AutoSize = true;\r
             this.radio_preferredAudioAndSubs.Location = new System.Drawing.Point(200, 99);\r
             this.radio_preferredAudioAndSubs.Name = "radio_preferredAudioAndSubs";\r
-            this.radio_preferredAudioAndSubs.Size = new System.Drawing.Size(250, 17);\r
+            this.radio_preferredAudioAndSubs.Size = new System.Drawing.Size(254, 17);\r
             this.radio_preferredAudioAndSubs.TabIndex = 93;\r
             this.radio_preferredAudioAndSubs.TabStop = true;\r
             this.radio_preferredAudioAndSubs.Text = "Use Preferred Language for Audio and Subtitles";\r
@@ -637,7 +637,7 @@ namespace Handbrake
             this.check_AddCCTracks.AutoSize = true;\r
             this.check_AddCCTracks.Location = new System.Drawing.Point(200, 131);\r
             this.check_AddCCTracks.Name = "check_AddCCTracks";\r
-            this.check_AddCCTracks.Size = new System.Drawing.Size(198, 17);\r
+            this.check_AddCCTracks.Size = new System.Drawing.Size(199, 17);\r
             this.check_AddCCTracks.TabIndex = 92;\r
             this.check_AddCCTracks.Text = "Add Closed Captions when available";\r
             this.ToolTip.SetToolTip(this.check_AddCCTracks, "Add any CC tracks if they exist");\r
@@ -670,7 +670,7 @@ namespace Handbrake
             this.radio_foreignAndSubs.AutoSize = true;\r
             this.radio_foreignAndSubs.Location = new System.Drawing.Point(200, 76);\r
             this.radio_foreignAndSubs.Name = "radio_foreignAndSubs";\r
-            this.radio_foreignAndSubs.Size = new System.Drawing.Size(347, 17);\r
+            this.radio_foreignAndSubs.Size = new System.Drawing.Size(358, 17);\r
             this.radio_foreignAndSubs.TabIndex = 90;\r
             this.radio_foreignAndSubs.TabStop = true;\r
             this.radio_foreignAndSubs.Text = "Use foreign language audio and add first preferred language subtitle.";\r
@@ -695,7 +695,7 @@ namespace Handbrake
             this.radio_dub.AutoSize = true;\r
             this.radio_dub.Location = new System.Drawing.Point(200, 53);\r
             this.radio_dub.Name = "radio_dub";\r
-            this.radio_dub.Size = new System.Drawing.Size(167, 17);\r
+            this.radio_dub.Size = new System.Drawing.Size(164, 17);\r
             this.radio_dub.TabIndex = 89;\r
             this.radio_dub.TabStop = true;\r
             this.radio_dub.Text = "DUB Foreign Language Audio";\r
@@ -748,7 +748,7 @@ namespace Handbrake
             this.check_preventSleep.AutoSize = true;\r
             this.check_preventSleep.Location = new System.Drawing.Point(73, 45);\r
             this.check_preventSleep.Name = "check_preventSleep";\r
-            this.check_preventSleep.Size = new System.Drawing.Size(260, 17);\r
+            this.check_preventSleep.Size = new System.Drawing.Size(266, 17);\r
             this.check_preventSleep.TabIndex = 91;\r
             this.check_preventSleep.Text = "Prevent the system from sleeping when encoding.";\r
             this.ToolTip.SetToolTip(this.check_preventSleep, "Prevent system from sleeping during encoding.");\r
@@ -761,7 +761,7 @@ namespace Handbrake
             this.check_clearOldLogs.AutoSize = true;\r
             this.check_clearOldLogs.Location = new System.Drawing.Point(73, 234);\r
             this.check_clearOldLogs.Name = "check_clearOldLogs";\r
-            this.check_clearOldLogs.Size = new System.Drawing.Size(162, 17);\r
+            this.check_clearOldLogs.Size = new System.Drawing.Size(166, 17);\r
             this.check_clearOldLogs.TabIndex = 90;\r
             this.check_clearOldLogs.Text = "Clear logs older than 30 days";\r
             this.ToolTip.SetToolTip(this.check_clearOldLogs, "Clear logs which are older than 30 days.\r\nThis only applies to HandBrakes Applica" +\r
@@ -856,7 +856,7 @@ namespace Handbrake
             this.check_logsInSpecifiedLocation.AutoSize = true;\r
             this.check_logsInSpecifiedLocation.Location = new System.Drawing.Point(73, 139);\r
             this.check_logsInSpecifiedLocation.Name = "check_logsInSpecifiedLocation";\r
-            this.check_logsInSpecifiedLocation.Size = new System.Drawing.Size(305, 17);\r
+            this.check_logsInSpecifiedLocation.Size = new System.Drawing.Size(306, 17);\r
             this.check_logsInSpecifiedLocation.TabIndex = 87;\r
             this.check_logsInSpecifiedLocation.Text = "Put a copy of individual encode logs in a specified location:";\r
             this.ToolTip.SetToolTip(this.check_logsInSpecifiedLocation, "Place a copy of the encode log in the same folder as the encoded movie.");\r
index 6cfdf4403e51d69d14353c1f33829a6bdd320638..98e4d33cc1fa8de37ad9bc6586302d26165274d6 100644 (file)
   <metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
     <value>132, 18</value>\r
   </metadata>\r
+  <metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
+    <value>132, 18</value>\r
+  </metadata>\r
   <data name="cb_mp4FileMode.ToolTip" xml:space="preserve">\r
     <value>The default file extension for MP4 Files.\r
 Automatic   - This will use M4v when AC3 Audio, SRT Subtitles or Chapters are present, otherwise MP4.\r
@@ -130,7 +133,8 @@ Note, the file itself is identical. This simply changes the default extension fo
   </data>\r
   <data name="text_an_path.ToolTip" xml:space="preserve">\r
     <value>This is the default location where your encoded files will be stored if "Automatically name output files" is enabled.\r
-You can enter {source_path} instead of a path to use the same path as the source file.</value>\r
+\r
+Hover over the "Available Options" text below for a more detailed description of the available advanced options.</value>\r
   </data>\r
   <data name="label34.ToolTip" xml:space="preserve">\r
     <value>{source_path} = Use the same directory as the source is in.\r