]> granicus.if.org Git - handbrake/commitdiff
WinGui:
authorsr55 <sr55.hb@outlook.com>
Fri, 6 Mar 2009 14:27:44 +0000 (14:27 +0000)
committersr55 <sr55.hb@outlook.com>
Fri, 6 Mar 2009 14:27:44 +0000 (14:27 +0000)
- Add an override for the queue show method. Saves calling setQueue() before Show().
- Fix a couple of message boxes appearing behind windows.
Thanks go to: ExDeus

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2230 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/C#/frmMain.cs
win/C#/frmPreview.cs
win/C#/frmQueue.cs

index b0e61fd2722e4ba5fbe28feb180616ad6f8421de..07828e81af3296f82464a530ca345c3edcc570e5 100644 (file)
@@ -615,7 +615,7 @@ namespace Handbrake
                     }\r
                     queueWindow.setQueue();\r
                     if (encodeQueue.count() > 1)\r
-                        queueWindow.Show();\r
+                        queueWindow.Show(false);\r
 \r
                     setEncodeStarted(); // Encode is running, so setup the GUI appropriately\r
                     encodeQueue.startEncode(); // Start The Queue Encoding Process\r
@@ -639,13 +639,11 @@ namespace Handbrake
                 encodeQueue.add(query, text_source.Text, text_destination.Text);\r
                 encodeQueue.write2disk("hb_queue_recovery.xml"); // Writes the queue to the recovery file, just incase the GUI crashes.\r
 \r
-                queueWindow.setQueue();\r
                 queueWindow.Show();\r
             }\r
         }\r
         private void btn_showQueue_Click(object sender, EventArgs e)\r
         {\r
-            queueWindow.setQueue();\r
             queueWindow.Show();\r
             queueWindow.Activate();\r
         }\r
@@ -666,7 +664,7 @@ namespace Handbrake
                     qtpreview.Show();\r
                 }\r
                 else\r
-                    MessageBox.Show("The preview window is already open!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
+                    MessageBox.Show(qtpreview, "The preview window is already open!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
             }\r
         }\r
         private void btn_ActivityWindow_Click(object sender, EventArgs e)\r
@@ -1740,11 +1738,11 @@ namespace Handbrake
                         if (curDrive.IsReady)\r
                         {\r
                             if (File.Exists(curDrive.RootDirectory + "VIDEO_TS\\VIDEO_TS.IFO"))\r
+                            {\r
                                 mnu_dvd_drive.Text = curDrive.RootDirectory + "VIDEO_TS (" + curDrive.VolumeLabel + ")";\r
-                            else\r
-                                mnu_dvd_drive.Text = "[No DVD Drive Ready]";\r
-\r
-                            foundDrive = true;\r
+                                foundDrive = true;\r
+                                break;\r
+                            }\r
 \r
                         }\r
                     }\r
@@ -2109,4 +2107,4 @@ namespace Handbrake
 \r
         // This is the END of the road ------------------------------------------------------------------------------\r
     }\r
-}
\ No newline at end of file
+}\r
index 52aabe6f6e396c90d033431fb818f57094f46210..e2022ca2b4e7f7bb2eac675a41f71256997a5d63 100644 (file)
@@ -28,7 +28,7 @@ namespace Handbrake
             }\r
             catch (Exception exc)\r
             {\r
-                MessageBox.Show("It would appear QuickTime 7 is not installed. QuickTime preview functionality will be disabled! \n\n Debug Info:\n" + exc, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
+                MessageBox.Show(mw, "It would appear QuickTime 7 is not installed. QuickTime preview functionality will be disabled! \n\n Debug Info:\n" + exc, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
                 btn_playQT.Enabled = false;\r
                 noQT = true;\r
             }\r
@@ -58,7 +58,7 @@ namespace Handbrake
         {\r
             // Make sure we are not already encoding and if we are then display an error.\r
             if (hbProc != null)\r
-                MessageBox.Show("Handbrake is already encoding a video!", "Status", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
+                MessageBox.Show(this, "Handbrake is already encoding a video!", "Status", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
             else\r
             {\r
                 hbProc = process.runCli(this, (string)state);\r
@@ -99,7 +99,7 @@ namespace Handbrake
             }\r
             catch (Exception exc)\r
             {\r
-                MessageBox.Show("frmPreview.cs encodeCompleted " + exc, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
+                MessageBox.Show(this, "frmPreview.cs encodeCompleted " + exc, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
             }\r
         }\r
         #endregion\r
@@ -133,10 +133,10 @@ namespace Handbrake
                         lbl_status.Text = "VLC will now launch.";\r
                     }\r
                     else\r
-                        MessageBox.Show("Unable to detect VLC Player. \nPlease make sure VLC is installed and the directory specified in the program options is correct.", "VLC", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
+                        MessageBox.Show(this, "Unable to detect VLC Player. \nPlease make sure VLC is installed and the directory specified in the program options is correct.", "VLC", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
                 }\r
                 else\r
-                    MessageBox.Show("Unable to find the preview file. Either the file was deleted or the encode failed. Check the activity log for details.", "VLC", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
+                    MessageBox.Show(this, "Unable to find the preview file. Either the file was deleted or the encode failed. Check the activity log for details.", "VLC", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
             }\r
         }\r
 \r
@@ -169,13 +169,13 @@ namespace Handbrake
             catch (COMException ex)\r
             {\r
                 QTUtils qtu = new QTUtils();\r
-                MessageBox.Show("Unable to open movie:\n\nError Code: " + ex.ErrorCode.ToString("X") + "\nQT Error code : " + qtu.QTErrorFromErrorCode(ex.ErrorCode));\r
+                MessageBox.Show(this, "Unable to open movie:\n\nError Code: " + ex.ErrorCode.ToString("X") + "\nQT Error code : " + qtu.QTErrorFromErrorCode(ex.ErrorCode), "QT", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
             }\r
             catch (Exception ex)\r
             {\r
-                MessageBox.Show("Unable to open movie:\n\n" + ex);\r
+                MessageBox.Show(this, "Unable to open movie:\n\n" + ex, "QT", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
             }\r
         }\r
         #endregion\r
     }\r
-}
\ No newline at end of file
+}\r
index 36e8b067ed36e22447c0462254d1d51c272359e6..86549a20fb2e62b249423f476f094127a05d20d8 100644 (file)
@@ -50,6 +50,25 @@ namespace Handbrake
             updateUIElements();\r
         }\r
 \r
+        /// <summary>\r
+        /// Initializes the Queue list, then shows and activates the window\r
+        /// </summary>\r
+        public new void Show()\r
+        {\r
+            Show(true);\r
+        }\r
+\r
+        /// <summary>\r
+        /// Initializes the Queue list only if doSetQueue is true, then shows and activates the window\r
+        /// </summary>\r
+        /// <param name="doSetQueue">Indicates whether to call setQueue() before showing the window</param>\r
+        public void Show(bool doSetQueue)\r
+        {\r
+            if (doSetQueue) setQueue();\r
+            base.Show();\r
+            Activate();\r
+        }\r
+\r
         // Start and Stop Controls\r
         private void btn_encode_Click(object sender, EventArgs e)\r
         {\r
@@ -287,4 +306,4 @@ namespace Handbrake
             base.OnClosing(e);\r
         }\r
     }\r
-}
\ No newline at end of file
+}\r