OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 24 Jan 2010 16:15:16 +0000 (16:15 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 24 Jan 2010 16:15:16 +0000 (16:15 +0000)
More Keyboard ShortCuts
- Ctrl-A remapped to add to queue
- Ctrl-L for log window
- Ctrl-S to start an encode

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

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

index b3397cf..f716d92 100644 (file)
@@ -40,7 +40,7 @@ namespace Handbrake
             this.components = new System.ComponentModel.Container();\r
             System.Windows.Forms.ContextMenuStrip notifyIconMenu;\r
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));\r
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();\r
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();\r
             this.btn_restore = new System.Windows.Forms.ToolStripMenuItem();\r
             this.DVD_Save = new System.Windows.Forms.SaveFileDialog();\r
             this.ToolTip = new System.Windows.Forms.ToolTip(this.components);\r
@@ -401,9 +401,9 @@ namespace Handbrake
             // \r
             // number\r
             // \r
-            dataGridViewCellStyle2.Format = "N0";\r
-            dataGridViewCellStyle2.NullValue = null;\r
-            this.number.DefaultCellStyle = dataGridViewCellStyle2;\r
+            dataGridViewCellStyle1.Format = "N0";\r
+            dataGridViewCellStyle1.NullValue = null;\r
+            this.number.DefaultCellStyle = dataGridViewCellStyle1;\r
             this.number.Frozen = true;\r
             this.number.HeaderText = "Chapter Number";\r
             this.number.MaxInputLength = 3;\r
@@ -613,7 +613,7 @@ namespace Handbrake
             this.mnu_encode.Image = global::Handbrake.Properties.Resources.Queue_Small;\r
             this.mnu_encode.Name = "mnu_encode";\r
             this.mnu_encode.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Q)));\r
-            this.mnu_encode.Size = new System.Drawing.Size(203, 22);\r
+            this.mnu_encode.Size = new System.Drawing.Size(201, 22);\r
             this.mnu_encode.Text = "Show Queue";\r
             this.mnu_encode.Click += new System.EventHandler(this.mnu_encode_Click);\r
             // \r
@@ -621,21 +621,21 @@ namespace Handbrake
             // \r
             this.mnu_encodeLog.Image = global::Handbrake.Properties.Resources.ActivityWindow_small;\r
             this.mnu_encodeLog.Name = "mnu_encodeLog";\r
-            this.mnu_encodeLog.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A)));\r
-            this.mnu_encodeLog.Size = new System.Drawing.Size(203, 22);\r
+            this.mnu_encodeLog.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.L)));\r
+            this.mnu_encodeLog.Size = new System.Drawing.Size(201, 22);\r
             this.mnu_encodeLog.Text = "Activity Window";\r
             this.mnu_encodeLog.Click += new System.EventHandler(this.mnu_encodeLog_Click);\r
             // \r
             // ToolStripSeparator5\r
             // \r
             this.ToolStripSeparator5.Name = "ToolStripSeparator5";\r
-            this.ToolStripSeparator5.Size = new System.Drawing.Size(200, 6);\r
+            this.ToolStripSeparator5.Size = new System.Drawing.Size(198, 6);\r
             // \r
             // mnu_options\r
             // \r
             this.mnu_options.Image = global::Handbrake.Properties.Resources.Pref_Small;\r
             this.mnu_options.Name = "mnu_options";\r
-            this.mnu_options.Size = new System.Drawing.Size(203, 22);\r
+            this.mnu_options.Size = new System.Drawing.Size(201, 22);\r
             this.mnu_options.Text = "Options";\r
             this.mnu_options.Click += new System.EventHandler(this.mnu_options_Click);\r
             // \r
@@ -1678,6 +1678,7 @@ namespace Handbrake
             this.DoubleBuffered = true;\r
             this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));\r
+            this.KeyPreview = true;\r
             this.MinimumSize = new System.Drawing.Size(900, 500);\r
             this.Name = "frmMain";\r
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;\r
index fc8728f..2f8c1c1 100644 (file)
@@ -1666,6 +1666,34 @@ namespace Handbrake
                 if (!string.IsNullOrEmpty(selectedTitle.SourceName)) // If it's one of multiple source files, make sure we don't use the folder name\r
                     labelSource.Text = Path.GetFileName(selectedTitle.SourceName);\r
         }\r
+\r
+        public void RecievingJob(Job job)\r
+        {\r
+            string query = job.Query;\r
+            StartScan(job.Source, 0);\r
+\r
+\r
+            if (query != null)\r
+            {\r
+                //Ok, Reset all the H264 widgets before changing the preset\r
+                x264Panel.reset2Defaults();\r
+\r
+                // Send the query from the file to the Query Parser class\r
+                QueryParser presetQuery = QueryParser.Parse(query);\r
+\r
+                // Now load the preset\r
+                PresetLoader.presetLoader(this, presetQuery, "Load Back From Queue", true);\r
+\r
+                // The x264 widgets will need updated, so do this now:\r
+                x264Panel.X264_StandardizeOptString();\r
+                x264Panel.X264_SetCurrentSettingsInPanel();\r
+\r
+                // Finally, let this window have a copy of the preset settings.\r
+                CurrentlySelectedPreset = null;\r
+                PictureSettings.SetPresetCropWarningLabel(null);\r
+            }\r
+\r
+        }\r
         #endregion\r
 \r
         #region GUI\r
@@ -1783,6 +1811,29 @@ namespace Handbrake
         #endregion\r
 \r
         #region Overrides\r
+\r
+        /// <summary>\r
+        /// Handle GUI shortcuts\r
+        /// </summary>\r
+        /// <param name="msg"></param>\r
+        /// <param name="keyData"></param>\r
+        /// <returns></returns>\r
+        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)\r
+        {\r
+            if (keyData == (Keys.Control | Keys.S))\r
+            {\r
+                btn_start_Click(this, new EventArgs());\r
+                return true;\r
+            }\r
+\r
+            if (keyData == (Keys.Control | Keys.A))\r
+            {\r
+                btn_add2Queue_Click(this, new EventArgs());\r
+                return true;\r
+            }\r
+            return base.ProcessCmdKey(ref msg, keyData);\r
+        }\r
+\r
         /// <summary>\r
         /// If the queue is being processed, prompt the user to confirm application close.\r
         /// </summary>\r
@@ -1838,34 +1889,6 @@ namespace Handbrake
         }\r
         #endregion\r
 \r
-        public void RecievingJob(Job job)\r
-        {\r
-            string query = job.Query;\r
-            StartScan(job.Source, 0);\r
-     \r
-\r
-            if (query != null)\r
-            {\r
-                //Ok, Reset all the H264 widgets before changing the preset\r
-                x264Panel.reset2Defaults();\r
-\r
-                // Send the query from the file to the Query Parser class\r
-                QueryParser presetQuery = QueryParser.Parse(query);\r
-\r
-                // Now load the preset\r
-                PresetLoader.presetLoader(this, presetQuery, "Load Back From Queue", true);\r
-\r
-                // The x264 widgets will need updated, so do this now:\r
-                x264Panel.X264_StandardizeOptString();\r
-                x264Panel.X264_SetCurrentSettingsInPanel();\r
-\r
-                // Finally, let this window have a copy of the preset settings.\r
-                CurrentlySelectedPreset = null;\r
-                PictureSettings.SetPresetCropWarningLabel(null);\r
-            }\r
-\r
-        }\r
-\r
         // This is the END of the road ****************************************\r
     }\r
 }
\ No newline at end of file