OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 18 Jul 2007 19:50:00 +0000 (19:50 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 18 Jul 2007 19:50:00 +0000 (19:50 +0000)
- Changed the progress bar on frmReadDVD to a text value. Progress bar wasn't really needed here.
- Few design tweaks to the frmReadDVD window.

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

win/C#/frmMain.cs
win/C#/frmOptions.cs
win/C#/frmReadDVD.Designer.cs
win/C#/frmReadDVD.cs

index 7f6ece4..90062b1 100644 (file)
@@ -22,7 +22,12 @@ namespace Handbrake
         // --------------------------------------------------------------\r
         private frmDvdInfo dvdInfoWindow = new frmDvdInfo();\r
         private frmQueue queueWindow = new frmQueue();\r
-\r
+        \r
+        // -------------------------------------------------------------- \r
+        // Stuff that needs doing on startup.\r
+        // - Load users default settings. (if required)\r
+        // - Do an update check (if required)\r
+        // --------------------------------------------------------------\r
         public frmMain()\r
         {\r
             InitializeComponent();\r
@@ -119,7 +124,6 @@ namespace Handbrake
         {\r
             if (Properties.Settings.Default.updateStatus == "Checked")\r
             {\r
-\r
                 try\r
                 {\r
                     String updateFile = Properties.Settings.Default.updateFile;\r
@@ -132,7 +136,6 @@ namespace Handbrake
                         lbl_update.Visible = true;\r
                     }\r
                 }\r
-                // else fail displaying an error message.\r
                 catch (Exception)\r
                 {\r
                     // Silently ignore the error\r
@@ -140,7 +143,10 @@ namespace Handbrake
             }\r
         }\r
 \r
-        #region The Menu Bar\r
+        // -------------------------------------------------------------- \r
+        // The main Menu bar.\r
+        // -------------------------------------------------------------- \r
+\r
         #region File Menu\r
 \r
         private void mnu_open_Click(object sender, EventArgs e)\r
@@ -498,7 +504,6 @@ namespace Handbrake
         }\r
 \r
         #endregion\r
-        #endregion\r
 \r
         // -------------------------------------------------------------- \r
         // Buttons on the main Window\r
@@ -617,8 +622,7 @@ namespace Handbrake
             hbProc.Dispose();\r
             MessageBox.Show("The encode process has now ended.", "Status", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);\r
         }\r
-\r
-\r
+        \r
         //---------------------------------------------------\r
         //  Items that require actions on frmMain\r
         //---------------------------------------------------\r
@@ -1016,9 +1020,11 @@ namespace Handbrake
                     drp_subtitle.Text = drp_subtitle.Items[0].ToString();\r
                 }\r
             }\r
-        } \r
+        }\r
 \r
-        // The Query Generation Function\r
+        //---------------------------------------------------\r
+        //  The query Generation function.\r
+        //---------------------------------------------------\r
         public string GenerateTheQuery()\r
         {\r
             string source = text_source.Text;\r
@@ -1317,8 +1323,6 @@ namespace Handbrake
             return querySource+ queryDestination+ queryPictureSettings+ queryVideoSettings+ h264Settings+ queryAudioSettings+ queryAdvancedSettings+ verbose;\r
         }\r
 \r
-\r
-\r
         // This is the END of the road ------------------------------------------------------------------------------\r
     }\r
 }
\ No newline at end of file
index fc3d55a..66ae0a5 100644 (file)
@@ -74,8 +74,6 @@ namespace Handbrake
         {\r
             Properties.Settings.Default.Save(); // Small hack for Vista. Seems to work fine on XP without this\r
             this.Close();\r
-        }\r
-\r
-      \r
+        }     \r
     }\r
 }
\ No newline at end of file
index 40ab0fc..0e361a2 100644 (file)
@@ -33,14 +33,15 @@ namespace Handbrake
             this.btn_ok = new System.Windows.Forms.Button();\r
             this.Label3 = new System.Windows.Forms.Label();\r
             this.Label2 = new System.Windows.Forms.Label();\r
-            this.scanProgress = new System.Windows.Forms.ProgressBar();\r
+            this.lbl_status = new System.Windows.Forms.Label();\r
+            this.lbl_progress = new System.Windows.Forms.Label();\r
             this.SuspendLayout();\r
             // \r
             // lbl_pressOk\r
             // \r
             this.lbl_pressOk.AutoSize = true;\r
             this.lbl_pressOk.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.lbl_pressOk.Location = new System.Drawing.Point(216, 56);\r
+            this.lbl_pressOk.Location = new System.Drawing.Point(66, 61);\r
             this.lbl_pressOk.Name = "lbl_pressOk";\r
             this.lbl_pressOk.Size = new System.Drawing.Size(178, 13);\r
             this.lbl_pressOk.TabIndex = 29;\r
@@ -53,7 +54,7 @@ namespace Handbrake
             this.btn_ok.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
             this.btn_ok.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.btn_ok.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
-            this.btn_ok.Location = new System.Drawing.Point(400, 52);\r
+            this.btn_ok.Location = new System.Drawing.Point(400, 56);\r
             this.btn_ok.Name = "btn_ok";\r
             this.btn_ok.Size = new System.Drawing.Size(61, 22);\r
             this.btn_ok.TabIndex = 28;\r
@@ -82,27 +83,45 @@ namespace Handbrake
             this.Label2.TabIndex = 26;\r
             this.Label2.Text = "Status:";\r
             // \r
-            // scanProgress\r
+            // lbl_status\r
             // \r
-            this.scanProgress.Location = new System.Drawing.Point(22, 51);\r
-            this.scanProgress.Name = "scanProgress";\r
-            this.scanProgress.Size = new System.Drawing.Size(361, 23);\r
-            this.scanProgress.TabIndex = 30;\r
-            this.scanProgress.Visible = false;\r
+            this.lbl_status.AutoSize = true;\r
+            this.lbl_status.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.lbl_status.Location = new System.Drawing.Point(66, 41);\r
+            this.lbl_status.Name = "lbl_status";\r
+            this.lbl_status.Size = new System.Drawing.Size(178, 13);\r
+            this.lbl_status.TabIndex = 31;\r
+            this.lbl_status.Text = "Processing.... Please Wait!";\r
+            this.lbl_status.Visible = false;\r
+            // \r
+            // lbl_progress\r
+            // \r
+            this.lbl_progress.AutoSize = true;\r
+            this.lbl_progress.Location = new System.Drawing.Point(365, 61);\r
+            this.lbl_progress.Name = "lbl_progress";\r
+            this.lbl_progress.Size = new System.Drawing.Size(29, 13);\r
+            this.lbl_progress.TabIndex = 32;\r
+            this.lbl_progress.Text = "{ % }";\r
+            this.lbl_progress.Visible = false;\r
             // \r
             // frmReadDVD\r
             // \r
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
             this.ClientSize = new System.Drawing.Size(473, 86);\r
-            this.Controls.Add(this.scanProgress);\r
+            this.Controls.Add(this.lbl_progress);\r
+            this.Controls.Add(this.lbl_status);\r
             this.Controls.Add(this.lbl_pressOk);\r
             this.Controls.Add(this.btn_ok);\r
             this.Controls.Add(this.Label3);\r
             this.Controls.Add(this.Label2);\r
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;\r
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));\r
+            this.MaximizeBox = false;\r
+            this.MaximumSize = new System.Drawing.Size(479, 111);\r
+            this.MinimumSize = new System.Drawing.Size(479, 111);\r
             this.Name = "frmReadDVD";\r
+            this.ShowInTaskbar = false;\r
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;\r
             this.Text = "Reading DVD...";\r
             this.ResumeLayout(false);\r
@@ -116,6 +135,7 @@ namespace Handbrake
         internal System.Windows.Forms.Button btn_ok;\r
         internal System.Windows.Forms.Label Label3;\r
         internal System.Windows.Forms.Label Label2;\r
-        private System.Windows.Forms.ProgressBar scanProgress;\r
+        internal System.Windows.Forms.Label lbl_status;\r
+        private System.Windows.Forms.Label lbl_progress;\r
     }\r
 }
\ No newline at end of file
index c8103c3..f288201 100644 (file)
@@ -34,8 +34,9 @@ namespace Handbrake
         {\r
             btn_ok.Enabled = false;\r
             lbl_pressOk.Visible = false;\r
-            scanProgress.Value = 0;\r
-            scanProgress.Visible = true;\r
+            lbl_progress.Text = "0%";\r
+            lbl_progress.Visible = true;\r
+            lbl_status.Visible = true;\r
             // throw cli call and parsing on it's own thread\r
             ThreadPool.QueueUserWorkItem(startProc);\r
         }\r
@@ -64,7 +65,7 @@ namespace Handbrake
             hbProc = process.runCli(this, query, true, true, false, true);\r
 \r
             Parsing.Parser readData = new Parsing.Parser(hbProc.StandardError.BaseStream);\r
-            //hbProc.WaitForExit();\r
+            hbProc.WaitForExit();\r
             hbProc.Close();\r
 \r
             // Setup the parser\r
@@ -85,7 +86,7 @@ namespace Handbrake
             {\r
                 progress = 100;\r
             }\r
-            this.scanProgress.Value = progress;\r
+            this.lbl_progress.Text = progress.ToString() + "%";\r
         }\r
 \r
     }\r