]> granicus.if.org Git - handbrake/commitdiff
WinGui:
authorsr55 <sr55.hb@outlook.com>
Tue, 25 Sep 2007 18:17:23 +0000 (18:17 +0000)
committersr55 <sr55.hb@outlook.com>
Tue, 25 Sep 2007 18:17:23 +0000 (18:17 +0000)
- Improvements made to the Update Checker.
- Added Copy to Clipboard button on the Generate Query Tab.
- Moved Update checker to About Menu
( Credit goes to Alistair for this)

- Disabled a few items in the presets menu which are not required for this release.

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

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

index e90ae998525e5a2fe3b6a9fae00e6ca91654b382..3e9fc7b17aec7412a461cd38d5249ec27f59c21d 100644 (file)
@@ -59,6 +59,7 @@ namespace Handbrake
             this.text_bitrate = new System.Windows.Forms.TextBox();\r
             this.drp_subtitle = new System.Windows.Forms.ComboBox();\r
             this.btn_presets = new System.Windows.Forms.Button();\r
+            this.btn_setDefault = new System.Windows.Forms.Button();\r
             this.DVD_Open = new System.Windows.Forms.FolderBrowserDialog();\r
             this.File_Open = new System.Windows.Forms.OpenFileDialog();\r
             this.ISO_Open = new System.Windows.Forms.OpenFileDialog();\r
@@ -66,8 +67,6 @@ namespace Handbrake
             this.mnu_open = new System.Windows.Forms.ToolStripMenuItem();\r
             this.mnu_save = new System.Windows.Forms.ToolStripMenuItem();\r
             this.ToolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();\r
-            this.mnu_update = new System.Windows.Forms.ToolStripMenuItem();\r
-            this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();\r
             this.mnu_exit = new System.Windows.Forms.ToolStripMenuItem();\r
             this.mnu_open3 = new System.Windows.Forms.ToolStripMenuItem();\r
             this.ToolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
@@ -88,6 +87,8 @@ namespace Handbrake
             this.mnu_homepage = new System.Windows.Forms.ToolStripMenuItem();\r
             this.mnu_forum = new System.Windows.Forms.ToolStripMenuItem();\r
             this.ToolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();\r
+            this.mnu_UpdateCheck = new System.Windows.Forms.ToolStripMenuItem();\r
+            this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();\r
             this.mnu_about = new System.Windows.Forms.ToolStripMenuItem();\r
             this.frmMainMenu = new System.Windows.Forms.MenuStrip();\r
             this.GroupBox1 = new System.Windows.Forms.GroupBox();\r
@@ -111,7 +112,7 @@ namespace Handbrake
             this.lbl_encode = new System.Windows.Forms.Label();\r
             this.btn_eCancel = new System.Windows.Forms.Button();\r
             this.TabPage6 = new System.Windows.Forms.TabPage();\r
-            this.button1 = new System.Windows.Forms.Button();\r
+            this.btn_copy = new System.Windows.Forms.Button();\r
             this.label23 = new System.Windows.Forms.Label();\r
             this.Label7 = new System.Windows.Forms.Label();\r
             this.Label39 = new System.Windows.Forms.Label();\r
@@ -174,10 +175,9 @@ namespace Handbrake
             this.advancedOptions = new System.Windows.Forms.TabControl();\r
             this.groupBox_dest = new System.Windows.Forms.GroupBox();\r
             this.groupBox2 = new System.Windows.Forms.GroupBox();\r
-            this.btn_setDefault = new System.Windows.Forms.Button();\r
             this.btn_removePreset = new System.Windows.Forms.Button();\r
-            this.btn_addPreset = new System.Windows.Forms.Button();\r
             this.ListBox_Presets = new System.Windows.Forms.ListBox();\r
+            this.btn_addPreset = new System.Windows.Forms.Button();\r
             Label38 = new System.Windows.Forms.Label();\r
             ((System.ComponentModel.ISupportInitialize)(this.slider_videoQuality)).BeginInit();\r
             this.frmMainMenu.SuspendLayout();\r
@@ -565,6 +565,24 @@ namespace Handbrake
             this.btn_presets.UseVisualStyleBackColor = true;\r
             this.btn_presets.Click += new System.EventHandler(this.btn_presets_Click);\r
             // \r
+            // btn_setDefault\r
+            // \r
+            this.btn_setDefault.BackColor = System.Drawing.SystemColors.ControlLight;\r
+            this.btn_setDefault.FlatAppearance.BorderColor = System.Drawing.Color.Black;\r
+            this.btn_setDefault.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
+            this.btn_setDefault.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.btn_setDefault.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
+            this.btn_setDefault.Location = new System.Drawing.Point(113, 445);\r
+            this.btn_setDefault.Name = "btn_setDefault";\r
+            this.btn_setDefault.Size = new System.Drawing.Size(72, 22);\r
+            this.btn_setDefault.TabIndex = 107;\r
+            this.btn_setDefault.TabStop = false;\r
+            this.btn_setDefault.Text = "Set Default";\r
+            this.ToolTip.SetToolTip(this.btn_setDefault, "Set current settings as program defaults.\r\nRequires option to be enabled in Tools" +\r
+                    " > Options");\r
+            this.btn_setDefault.UseVisualStyleBackColor = false;\r
+            this.btn_setDefault.Click += new System.EventHandler(this.btn_setDefault_Click);\r
+            // \r
             // DVD_Open\r
             // \r
             this.DVD_Open.Description = "Select the \"VIDEO_TS\" folder from your DVD Drvie.";\r
@@ -587,8 +605,6 @@ namespace Handbrake
             this.mnu_open,\r
             this.mnu_save,\r
             this.ToolStripSeparator1,\r
-            this.mnu_update,\r
-            this.toolStripSeparator2,\r
             this.mnu_exit});\r
             this.FileToolStripMenuItem.Name = "FileToolStripMenuItem";\r
             this.FileToolStripMenuItem.Size = new System.Drawing.Size(35, 20);\r
@@ -618,18 +634,6 @@ namespace Handbrake
             this.ToolStripSeparator1.Name = "ToolStripSeparator1";\r
             this.ToolStripSeparator1.Size = new System.Drawing.Size(177, 6);\r
             // \r
-            // mnu_update\r
-            // \r
-            this.mnu_update.Name = "mnu_update";\r
-            this.mnu_update.Size = new System.Drawing.Size(180, 22);\r
-            this.mnu_update.Text = "Check for Updates";\r
-            this.mnu_update.Click += new System.EventHandler(this.mnu_update_Click);\r
-            // \r
-            // toolStripSeparator2\r
-            // \r
-            this.toolStripSeparator2.Name = "toolStripSeparator2";\r
-            this.toolStripSeparator2.Size = new System.Drawing.Size(177, 6);\r
-            // \r
             // mnu_exit\r
             // \r
             this.mnu_exit.Name = "mnu_exit";\r
@@ -699,12 +703,14 @@ namespace Handbrake
             this.mnu_presetReset.Size = new System.Drawing.Size(194, 22);\r
             this.mnu_presetReset.Text = "Update Built-in Presets";\r
             this.mnu_presetReset.ToolTipText = "Resets all presets.";\r
+            this.mnu_presetReset.Visible = false;\r
             this.mnu_presetReset.Click += new System.EventHandler(this.mnu_presetReset_Click);\r
             // \r
             // toolStripSeparator4\r
             // \r
             this.toolStripSeparator4.Name = "toolStripSeparator4";\r
             this.toolStripSeparator4.Size = new System.Drawing.Size(191, 6);\r
+            this.toolStripSeparator4.Visible = false;\r
             // \r
             // mnu_SelectDefault\r
             // \r
@@ -720,6 +726,8 @@ namespace Handbrake
             this.OnlineDocumentationToolStripMenuItem,\r
             this.WebsiteToolStripMenuItem,\r
             this.ToolStripSeparator3,\r
+            this.mnu_UpdateCheck,\r
+            this.toolStripSeparator6,\r
             this.mnu_about});\r
             this.HelpToolStripMenuItem.Name = "HelpToolStripMenuItem";\r
             this.HelpToolStripMenuItem.Size = new System.Drawing.Size(40, 20);\r
@@ -784,6 +792,18 @@ namespace Handbrake
             this.ToolStripSeparator3.Name = "ToolStripSeparator3";\r
             this.ToolStripSeparator3.Size = new System.Drawing.Size(187, 6);\r
             // \r
+            // mnu_UpdateCheck\r
+            // \r
+            this.mnu_UpdateCheck.Name = "mnu_UpdateCheck";\r
+            this.mnu_UpdateCheck.Size = new System.Drawing.Size(190, 22);\r
+            this.mnu_UpdateCheck.Text = "Check for Updates";\r
+            this.mnu_UpdateCheck.Click += new System.EventHandler(this.mnu_UpdateCheck_Click);\r
+            // \r
+            // toolStripSeparator6\r
+            // \r
+            this.toolStripSeparator6.Name = "toolStripSeparator6";\r
+            this.toolStripSeparator6.Size = new System.Drawing.Size(187, 6);\r
+            // \r
             // mnu_about\r
             // \r
             this.mnu_about.Name = "mnu_about";\r
@@ -1067,7 +1087,7 @@ namespace Handbrake
             // TabPage6\r
             // \r
             this.TabPage6.BackColor = System.Drawing.SystemColors.ControlLight;\r
-            this.TabPage6.Controls.Add(this.button1);\r
+            this.TabPage6.Controls.Add(this.btn_copy);\r
             this.TabPage6.Controls.Add(this.label23);\r
             this.TabPage6.Controls.Add(this.Label7);\r
             this.TabPage6.Controls.Add(this.Label39);\r
@@ -1081,18 +1101,19 @@ namespace Handbrake
             this.TabPage6.TabIndex = 6;\r
             this.TabPage6.Text = "Query Editor";\r
             // \r
-            // button1\r
+            // btn_copy\r
             // \r
-            this.button1.FlatAppearance.BorderColor = System.Drawing.Color.Black;\r
-            this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
-            this.button1.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.button1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
-            this.button1.Location = new System.Drawing.Point(176, 59);\r
-            this.button1.Name = "button1";\r
-            this.button1.Size = new System.Drawing.Size(134, 23);\r
-            this.button1.TabIndex = 92;\r
-            this.button1.Text = "Copy to Clipboard";\r
-            this.button1.UseVisualStyleBackColor = true;\r
+            this.btn_copy.FlatAppearance.BorderColor = System.Drawing.Color.Black;\r
+            this.btn_copy.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
+            this.btn_copy.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.btn_copy.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
+            this.btn_copy.Location = new System.Drawing.Point(176, 59);\r
+            this.btn_copy.Name = "btn_copy";\r
+            this.btn_copy.Size = new System.Drawing.Size(134, 23);\r
+            this.btn_copy.TabIndex = 92;\r
+            this.btn_copy.Text = "Copy to Clipboard";\r
+            this.btn_copy.UseVisualStyleBackColor = true;\r
+            this.btn_copy.Click += new System.EventHandler(this.btn_copy_Click);\r
             // \r
             // label23\r
             // \r
@@ -1831,24 +1852,6 @@ namespace Handbrake
             this.groupBox2.TabStop = false;\r
             this.groupBox2.Text = "Presets";\r
             // \r
-            // btn_setDefault\r
-            // \r
-            this.btn_setDefault.BackColor = System.Drawing.SystemColors.ControlLight;\r
-            this.btn_setDefault.FlatAppearance.BorderColor = System.Drawing.Color.Black;\r
-            this.btn_setDefault.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
-            this.btn_setDefault.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.btn_setDefault.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
-            this.btn_setDefault.Location = new System.Drawing.Point(113, 445);\r
-            this.btn_setDefault.Name = "btn_setDefault";\r
-            this.btn_setDefault.Size = new System.Drawing.Size(72, 22);\r
-            this.btn_setDefault.TabIndex = 107;\r
-            this.btn_setDefault.TabStop = false;\r
-            this.btn_setDefault.Text = "Set Default";\r
-            this.ToolTip.SetToolTip(this.btn_setDefault, "Set current settings as program defaults.\r\nRequires option to be enabled in Tools" +\r
-                    " > Options");\r
-            this.btn_setDefault.UseVisualStyleBackColor = false;\r
-            this.btn_setDefault.Click += new System.EventHandler(this.btn_setDefault_Click);\r
-            // \r
             // btn_removePreset\r
             // \r
             this.btn_removePreset.BackColor = System.Drawing.SystemColors.ControlLight;\r
@@ -1866,23 +1869,6 @@ namespace Handbrake
             this.btn_removePreset.Visible = false;\r
             this.btn_removePreset.Click += new System.EventHandler(this.btn_removePreset_Click);\r
             // \r
-            // btn_addPreset\r
-            // \r
-            this.btn_addPreset.BackColor = System.Drawing.SystemColors.ControlLight;\r
-            this.btn_addPreset.FlatAppearance.BorderColor = System.Drawing.Color.Black;\r
-            this.btn_addPreset.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
-            this.btn_addPreset.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.btn_addPreset.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
-            this.btn_addPreset.Location = new System.Drawing.Point(11, 445);\r
-            this.btn_addPreset.Name = "btn_addPreset";\r
-            this.btn_addPreset.Size = new System.Drawing.Size(35, 22);\r
-            this.btn_addPreset.TabIndex = 105;\r
-            this.btn_addPreset.TabStop = false;\r
-            this.btn_addPreset.Text = "Add";\r
-            this.btn_addPreset.UseVisualStyleBackColor = false;\r
-            this.btn_addPreset.Visible = false;\r
-            this.btn_addPreset.Click += new System.EventHandler(this.btn_addPreset_Click);\r
-            // \r
             // ListBox_Presets\r
             // \r
             this.ListBox_Presets.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
@@ -1911,6 +1897,23 @@ namespace Handbrake
             this.ListBox_Presets.TabIndex = 104;\r
             this.ListBox_Presets.SelectedIndexChanged += new System.EventHandler(this.ListBox_Presets_SelectedIndexChanged);\r
             // \r
+            // btn_addPreset\r
+            // \r
+            this.btn_addPreset.BackColor = System.Drawing.SystemColors.ControlLight;\r
+            this.btn_addPreset.FlatAppearance.BorderColor = System.Drawing.Color.Black;\r
+            this.btn_addPreset.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
+            this.btn_addPreset.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.btn_addPreset.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
+            this.btn_addPreset.Location = new System.Drawing.Point(11, 445);\r
+            this.btn_addPreset.Name = "btn_addPreset";\r
+            this.btn_addPreset.Size = new System.Drawing.Size(35, 22);\r
+            this.btn_addPreset.TabIndex = 105;\r
+            this.btn_addPreset.TabStop = false;\r
+            this.btn_addPreset.Text = "Add";\r
+            this.btn_addPreset.UseVisualStyleBackColor = false;\r
+            this.btn_addPreset.Visible = false;\r
+            this.btn_addPreset.Click += new System.EventHandler(this.btn_addPreset_Click);\r
+            // \r
             // frmMain\r
             // \r
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
@@ -1971,8 +1974,6 @@ namespace Handbrake
         internal System.Windows.Forms.ToolStripMenuItem mnu_open3;\r
         internal System.Windows.Forms.ToolStripMenuItem mnu_save;\r
         internal System.Windows.Forms.ToolStripSeparator ToolStripSeparator1;\r
-        internal System.Windows.Forms.ToolStripMenuItem mnu_update;\r
-        internal System.Windows.Forms.ToolStripSeparator toolStripSeparator2;\r
         internal System.Windows.Forms.ToolStripMenuItem mnu_exit;\r
         internal System.Windows.Forms.ToolStripMenuItem ToolsToolStripMenuItem;\r
         internal System.Windows.Forms.ToolStripMenuItem mnu_encode;\r
@@ -2101,7 +2102,7 @@ namespace Handbrake
         internal System.Windows.Forms.Label label4;\r
         internal System.Windows.Forms.ComboBox drp_deInterlace_option;\r
         private System.Windows.Forms.Label label23;\r
-        internal System.Windows.Forms.Button button1;\r
+        internal System.Windows.Forms.Button btn_copy;\r
         private System.Windows.Forms.GroupBox groupBox2;\r
         internal System.Windows.Forms.Button btn_removePreset;\r
         internal System.Windows.Forms.Button btn_addPreset;\r
@@ -2110,6 +2111,8 @@ namespace Handbrake
         internal System.Windows.Forms.Button btn_setDefault;\r
         private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;\r
         private System.Windows.Forms.ToolStripMenuItem mnu_SelectDefault;\r
+        private System.Windows.Forms.ToolStripMenuItem mnu_UpdateCheck;\r
+        private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;\r
 \r
     }\r
 }
\ No newline at end of file
index e6302a2f3a6433fac74ea506f10b05c10ba1778c..ff1ec3b672fd0e7fdee03aeeaff72dd4649b863b 100644 (file)
@@ -183,7 +183,8 @@ namespace Handbrake
             }\r
         }\r
 \r
-        private int updateCheck()\r
+        // This is a re-usable function.\r
+        private Boolean updateCheck()\r
         {\r
             try\r
             {\r
@@ -194,25 +195,26 @@ namespace Handbrake
                     String data = client.DownloadString(updateFile);\r
                     String[] versionData = data.Split('\n');\r
 \r
-                    if ((versionData[0] != Properties.Settings.Default.GuiVersion) || (versionData[1] != Properties.Settings.Default.CliVersion))\r
-                    {\r
-                        lbl_update.Visible = true;\r
-                        return 1;\r
-                    }\r
-                    else\r
-                    {\r
-                        return 0;\r
-                    }\r
+                    int verdata = int.Parse(versionData[0].Replace(".", ""));\r
+                    int vergui = int.Parse(Properties.Settings.Default.GuiVersion.Replace(".", ""));\r
+                    int verd1 = int.Parse(versionData[1].Replace(".", ""));\r
+                    int cliversion = int.Parse(Properties.Settings.Default.CliVersion.Replace(".", ""));\r
+\r
+                    Boolean update = ((verdata > vergui) || (verd1 > cliversion));\r
+   \r
+                    lbl_update.Visible = update;\r
+\r
+                    return update;   \r
                 }\r
                 else\r
                 {\r
-                    return 0;\r
+                    return false;\r
                 }\r
             }\r
             catch (Exception)\r
             {\r
                 // Silently ignore the error\r
-                return 0;\r
+                return false;\r
             }\r
         }\r
 \r
@@ -483,19 +485,6 @@ namespace Handbrake
             }\r
         }\r
 \r
-        private void mnu_update_Click(object sender, EventArgs e)\r
-        {\r
-            int update = updateCheck();\r
-            if (update == 1)\r
-            {\r
-                MessageBox.Show("There is a new update available. Please visit http://handbrake.m0k.org for details!", "Update Check", MessageBoxButtons.OK, MessageBoxIcon.Information);\r
-            }\r
-            else\r
-            {\r
-                MessageBox.Show("There are no new updates at this time.", "Update Check", MessageBoxButtons.OK, MessageBoxIcon.Information);\r
-            }\r
-        }\r
-\r
         private void mnu_exit_Click(object sender, EventArgs e)\r
         {\r
             Application.Exit();\r
@@ -595,6 +584,19 @@ namespace Handbrake
             Process.Start("http://handbrake.m0k.org/forum");\r
         }\r
 \r
+        private void mnu_UpdateCheck_Click(object sender, EventArgs e)\r
+        {\r
+            Boolean update = updateCheck();\r
+            if (update == true)\r
+            {\r
+                MessageBox.Show("There is a new update available. Please visit http://handbrake.m0k.org for details!", "Update Check", MessageBoxButtons.OK, MessageBoxIcon.Information);\r
+            }\r
+            else\r
+            {\r
+                MessageBox.Show("There are no new updates at this time.", "Update Check", MessageBoxButtons.OK, MessageBoxIcon.Information);\r
+            }\r
+        }\r
+\r
         private void mnu_about_Click(object sender, EventArgs e)\r
         {\r
                        Form About = new frmAbout();\r
@@ -608,6 +610,7 @@ namespace Handbrake
         // --------------------------------------------------------------\r
 \r
         #region Buttons\r
+\r
         private void btn_Browse_Click(object sender, EventArgs e)\r
         {\r
             String filename =""; \r
@@ -701,6 +704,11 @@ namespace Handbrake
             }\r
         }\r
 \r
+        private void btn_copy_Click(object sender, EventArgs e)\r
+        {\r
+            Clipboard.SetText(QueryEditorText.Text, TextDataFormat.Text);\r
+        }\r
+\r
         private void showQueue()\r
         {\r
             queueWindow.Show();\r