OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 17 Jul 2007 20:32:06 +0000 (20:32 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 17 Jul 2007 20:32:06 +0000 (20:32 +0000)
- Fixed resolution calculation bug. Mod16 res calculation now works.

- Fixed hbproc issue when clicking encode video.

git-svn-id: svn://localhost/HandBrake/trunk@707 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/C#/frmMain.cs

index 428b1b0..7f6ece4 100644 (file)
@@ -14,7 +14,7 @@ namespace Handbrake
 {\r
     public partial class frmMain : Form\r
     {\r
-        private System.Diagnostics.Process hbProc;\r
+        private Process hbProc;\r
         private Parsing.DVD thisDVD;\r
 \r
         // --------------------------------------------------------------\r
@@ -604,14 +604,13 @@ namespace Handbrake
             }\r
 \r
             Functions.CLI process = new Functions.CLI();\r
-            Process hbProc = process.runCli(this, query, false, false, false, false);\r
-\r
+            hbProc = process.runCli(this, query, false, false, false, false);\r
+          \r
             ThreadPool.QueueUserWorkItem(procMonitor);\r
         }\r
 \r
         private void procMonitor(object state)\r
         {\r
-            //******* BUG HERE, hbProc is not getting passed in here.\r
             MessageBox.Show("The encode process has now started.", "Status", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);\r
             hbProc.WaitForExit();\r
             hbProc.Close();\r
@@ -706,31 +705,48 @@ namespace Handbrake
 \r
         private void text_width_TextChanged(object sender, EventArgs e)\r
         {\r
+\r
             try\r
             {\r
-                if (CheckPixelRatio.Checked) {\r
+                if (CheckPixelRatio.Checked)\r
+                {\r
                     text_width.Text = "";\r
-                } else {\r
-                    if ((int.Parse(text_width.Text) % 16) != 0){\r
+                }\r
+                else\r
+                {\r
+                    if ((int.Parse(text_width.Text) % 16) != 0)\r
+                    {\r
                         text_width.BackColor = Color.LightCoral;\r
-                    }else {\r
+                    }\r
+                    else\r
+                    {\r
                         text_width.BackColor = Color.LightGreen;\r
                     }\r
                 }\r
\r
-                // There is a bug here *******************************************************************\r
+\r
                 if (lbl_Aspect.Text != "Select a Title")\r
                 {\r
-                    int height = int.Parse(text_width.Text) / int.Parse(lbl_Aspect.Text);\r
-                    MessageBox.Show("test");\r
-                    int mod16 = height % 16;\r
+                    double height = int.Parse(text_width.Text) / double.Parse(lbl_Aspect.Text);\r
+                    double mod16 = height % 16;\r
                     height = height - mod16;\r
-                    text_height.Text = height.ToString();\r
+\r
+                    if (text_width.Text == "")\r
+                    {\r
+                        text_height.Text = "";\r
+                        text_width.BackColor = Color.White;\r
+                    }\r
+                    else\r
+                    {\r
+                        text_height.Text = height.ToString();\r
+                    }\r
                 }\r
-               \r
-            } catch(Exception){\r
-                // No need to alert the user if there is a problem here.\r
             }\r
+            catch (Exception)\r
+            {\r
+                // No need to throw an error here.\r
+            }\r
+               \r
+          \r
         }\r
 \r
         private void text_height_TextChanged(object sender, EventArgs e)\r