OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 19 Nov 2010 18:22:58 +0000 (18:22 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 19 Nov 2010 18:22:58 +0000 (18:22 +0000)
- Some code (currently disabled) to support reading chapter names from source.
- Updates to tooltips for the release.

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

win/C#/Controls/Filters.cs
win/C#/Functions/Main.cs
win/C#/HandBrake.ApplicationServices/Parsing/Chapter.cs
win/C#/Program.cs
win/C#/frmMain.Designer.cs
win/C#/frmMain.cs
win/C#/frmMain.resx

index dda8c95..e5dbd88 100644 (file)
@@ -274,7 +274,7 @@ namespace Handbrake.Controls
         private void DropDecombSelectedIndexChanged(object sender, EventArgs e)\r
         {\r
             text_customDC.Visible = drop_decomb.Text == "Custom";\r
-            if (drop_decomb.SelectedIndex != 0 && drop_deinterlace.SelectedIndex != 0)\r
+            if (drop_decomb.SelectedIndex != 0 && drop_deinterlace.SelectedIndex != 0)0000\r
                 drop_deinterlace.SelectedIndex = 0;\r
 \r
             // A Filter has changed so raise a FilterSettingsChanged event.\r
index c26d595..d061f67 100644 (file)
@@ -69,6 +69,10 @@ namespace Handbrake.Functions
         /// <summary>\r
         /// Set's up the DataGridView on the Chapters tab (frmMain)\r
         /// </summary>\r
+        /// <param name="title">\r
+        /// The currently selected title object.\r
+        /// This will be used to get chapter names if they exist.\r
+        /// </param>\r
         /// <param name="dataChpt">\r
         /// The DataGridView Control\r
         /// </param>\r
@@ -78,7 +82,7 @@ namespace Handbrake.Functions
         /// <returns>\r
         /// The chapter naming.\r
         /// </returns>\r
-        public static DataGridView ChapterNaming(DataGridView dataChpt, string chapterEnd)\r
+        public static DataGridView ChapterNaming(Title title, DataGridView dataChpt, string chapterEnd)\r
         {\r
             int i = 0, finish = 0;\r
 \r
@@ -87,9 +91,18 @@ namespace Handbrake.Functions
 \r
             while (i < finish)\r
             {\r
+                string chapterName = string.Empty;\r
+                if (title != null)\r
+                {\r
+                    if (title.Chapters.Count <= i && title.Chapters[i] != null)\r
+                    {\r
+                        chapterName = title.Chapters[i].ChapterName;\r
+                    }\r
+                }\r
+\r
                 int n = dataChpt.Rows.Add();\r
                 dataChpt.Rows[n].Cells[0].Value = i + 1;\r
-                dataChpt.Rows[n].Cells[1].Value = "Chapter " + (i + 1);\r
+                dataChpt.Rows[n].Cells[1].Value = string.IsNullOrEmpty(chapterName) ? "Chapter " + (i + 1) : chapterName;\r
                 dataChpt.Rows[n].Cells[0].ValueType = typeof(int);\r
                 dataChpt.Rows[n].Cells[1].ValueType = typeof(string);\r
                 i++;\r
index 0545dd1..949b73f 100644 (file)
@@ -21,6 +21,11 @@ namespace HandBrake.ApplicationServices.Parsing
         public int ChapterNumber { get; set; }\r
 \r
         /// <summary>\r
+        /// Gets or sets ChapterName.\r
+        /// </summary>\r
+        public string ChapterName { get; set; }\r
+\r
+        /// <summary>\r
         /// Gets or sets The length in time this Chapter spans\r
         /// </summary>\r
         public TimeSpan Duration { get; set; }\r
@@ -36,6 +41,7 @@ namespace HandBrake.ApplicationServices.Parsing
         /// </returns>\r
         public static Chapter Parse(StringReader output)\r
         {\r
+            // TODO add support for reading chapter names to the regex.\r
             Match m = Regex.Match(\r
                                   output.ReadLine(),\r
                                   @"^    \+ ([0-9]*): cells ([0-9]*)->([0-9]*), ([0-9]*) blocks, duration ([0-9]{2}:[0-9]{2}:[0-9]{2})");\r
@@ -44,6 +50,7 @@ namespace HandBrake.ApplicationServices.Parsing
                 var thisChapter = new Chapter\r
                                       {\r
                                           ChapterNumber = int.Parse(m.Groups[1].Value.Trim()), \r
+                                          ChapterName = string.Empty,\r
                                           Duration = TimeSpan.Parse(m.Groups[5].Value)\r
                                       };\r
                 return thisChapter;\r
index 24d1507..c147542 100644 (file)
@@ -7,6 +7,7 @@ namespace Handbrake
 {\r
     using System;\r
     using System.Diagnostics;\r
+    using System.Drawing;\r
     using System.IO;\r
     using System.Windows.Forms;\r
 \r
@@ -43,10 +44,7 @@ namespace Handbrake
             }\r
 \r
             // Make sure we have any pre-requesits before trying to launch\r
-            const string FailedInstall = "HandBrake is not installed properly. Please reinstall HandBrake. \n\n";\r
-            const string NightlyCLIMissing =\r
-                "If you have downloaded the \"HandBrakeGUI\" nightly, " +\r
-                "please make sure you have also downloaded the \"HandBrakeCLI\" nightly and extracted it's contents to the same folder. ";\r
+            string failedInstall = "HandBrake is not installed properly. Please reinstall HandBrake. \n\n";\r
             string missingFiles = string.Empty;\r
 \r
             // Verify HandBrakeCLI.exe exists\r
@@ -58,7 +56,7 @@ namespace Handbrake
             if (missingFiles != string.Empty)\r
             {\r
                 MessageBox.Show(\r
-                    FailedInstall + missingFiles + "\n\n" + NightlyCLIMissing,\r
+                    failedInstall + missingFiles,\r
                     "Error",\r
                     MessageBoxButtons.OK,\r
                     MessageBoxIcon.Error);\r
@@ -68,7 +66,15 @@ namespace Handbrake
             // Check were not running on a screen that's going to cause some funnies to happen.\r
             Screen scr = Screen.PrimaryScreen;\r
             if ((scr.Bounds.Width < 1024) || (scr.Bounds.Height < 620))\r
-                MessageBox.Show("Your system does not meet the minimum requirements for HandBrake. \n" + "Your screen is running at: " + scr.Bounds.Width + "x" + scr.Bounds.Height + " \nScreen resolution is too Low. Must be 1024x620 or greater", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
+            {\r
+                MessageBox.Show(\r
+                    "Your system does not meet the minimum requirements for HandBrake. \n" +\r
+                    "Your screen is running at: " + scr.Bounds.Width + "x" + scr.Bounds.Height +\r
+                    " \nScreen resolution is too Low. Must be 1024x620 or greater.\n\n",\r
+                    "Error",\r
+                    MessageBoxButtons.OK,\r
+                    MessageBoxIcon.Error);\r
+            } \r
             else\r
             {\r
                 string logDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"HandBrake\logs");\r
index 7761f21..3e2399a 100644 (file)
@@ -70,6 +70,7 @@ namespace Handbrake
             this.btn_importChapters = new System.Windows.Forms.Button();\r
             this.btn_export = new System.Windows.Forms.Button();\r
             this.drop_mode = new System.Windows.Forms.ComboBox();\r
+            this.btn_generate_Query = 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
@@ -128,7 +129,6 @@ namespace Handbrake
             this.tab_query = new System.Windows.Forms.TabPage();\r
             this.btn_clear = new System.Windows.Forms.Button();\r
             this.label34 = new System.Windows.Forms.Label();\r
-            this.btn_generate_Query = new System.Windows.Forms.Button();\r
             this.label33 = new System.Windows.Forms.Label();\r
             this.rtf_query = new System.Windows.Forms.RichTextBox();\r
             this.groupBox2 = new System.Windows.Forms.GroupBox();\r
@@ -351,8 +351,7 @@ namespace Handbrake
             this.btn_setDefault.TabIndex = 1;\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.ToolTip.SetToolTip(this.btn_setDefault, "Set current settings as program defaults.");\r
             this.btn_setDefault.UseVisualStyleBackColor = true;\r
             this.btn_setDefault.Click += new System.EventHandler(this.btn_setDefault_Click);\r
             // \r
@@ -461,7 +460,7 @@ namespace Handbrake
             this.btn_addPreset.TabIndex = 3;\r
             this.btn_addPreset.TabStop = false;\r
             this.btn_addPreset.Text = "Add";\r
-            this.ToolTip.SetToolTip(this.btn_addPreset, "Add a preset to the preset panel");\r
+            this.ToolTip.SetToolTip(this.btn_addPreset, "This option will take the current settings and add it as a new preset.");\r
             this.btn_addPreset.UseVisualStyleBackColor = true;\r
             this.btn_addPreset.Click += new System.EventHandler(this.btn_addPreset_Click);\r
             // \r
@@ -476,7 +475,7 @@ namespace Handbrake
             this.btn_removePreset.TabIndex = 4;\r
             this.btn_removePreset.TabStop = false;\r
             this.btn_removePreset.Text = "Remove";\r
-            this.ToolTip.SetToolTip(this.btn_removePreset, "Remove a preset from the panel above.");\r
+            this.ToolTip.SetToolTip(this.btn_removePreset, "Remove the selected preset from the panel above.");\r
             this.btn_removePreset.UseVisualStyleBackColor = true;\r
             this.btn_removePreset.Click += new System.EventHandler(this.btn_removePreset_Click);\r
             // \r
@@ -491,7 +490,7 @@ namespace Handbrake
             this.drop_format.Name = "drop_format";\r
             this.drop_format.Size = new System.Drawing.Size(106, 21);\r
             this.drop_format.TabIndex = 28;\r
-            this.ToolTip.SetToolTip(this.drop_format, "Select the file container format.");\r
+            this.ToolTip.SetToolTip(this.drop_format, "Select the file container format.\r\nHandBrake supports MKV and MP4(M4v)");\r
             this.drop_format.SelectedIndexChanged += new System.EventHandler(this.drop_format_SelectedIndexChanged);\r
             // \r
             // drop_chapterFinish\r
@@ -536,8 +535,9 @@ namespace Handbrake
             this.drp_dvdtitle.Name = "drp_dvdtitle";\r
             this.drp_dvdtitle.Size = new System.Drawing.Size(119, 21);\r
             this.drp_dvdtitle.TabIndex = 7;\r
-            this.ToolTip.SetToolTip(this.drp_dvdtitle, "Select the title you wish to encode.\r\nThe longest title is selected by default af" +\r
-                    "ter you have scanned a source.");\r
+            this.ToolTip.SetToolTip(this.drp_dvdtitle, "Select the title you wish to encode.\r\n\r\nWhen a DVD is in use, HandBrake will try " +\r
+                    "to determine the \"Main Feature\" title automatically.\r\nPlease note, this is not a" +\r
+                    "lways accurate and should be checked.");\r
             this.drp_dvdtitle.SelectedIndexChanged += new System.EventHandler(this.drp_dvdtitle_SelectedIndexChanged);\r
             this.drp_dvdtitle.Click += new System.EventHandler(this.drp_dvdtitle_Click);\r
             // \r
@@ -581,8 +581,25 @@ namespace Handbrake
             this.drop_mode.Name = "drop_mode";\r
             this.drop_mode.Size = new System.Drawing.Size(77, 21);\r
             this.drop_mode.TabIndex = 46;\r
+            this.ToolTip.SetToolTip(this.drop_mode, resources.GetString("drop_mode.ToolTip"));\r
             this.drop_mode.SelectedIndexChanged += new System.EventHandler(this.drop_mode_SelectedIndexChanged);\r
             // \r
+            // btn_generate_Query\r
+            // \r
+            this.btn_generate_Query.FlatAppearance.BorderColor = System.Drawing.Color.Black;\r
+            this.btn_generate_Query.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.btn_generate_Query.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
+            this.btn_generate_Query.Location = new System.Drawing.Point(16, 104);\r
+            this.btn_generate_Query.Name = "btn_generate_Query";\r
+            this.btn_generate_Query.Size = new System.Drawing.Size(126, 22);\r
+            this.btn_generate_Query.TabIndex = 2;\r
+            this.btn_generate_Query.Text = "Generate Query";\r
+            this.ToolTip.SetToolTip(this.btn_generate_Query, "This will allow you to override the generated query.\r\nNote, The query in the box " +\r
+                    "below will always override any automatically generated query, even if you change" +\r
+                    " title or source.");\r
+            this.btn_generate_Query.UseVisualStyleBackColor = true;\r
+            this.btn_generate_Query.Click += new System.EventHandler(this.btn_generate_Query_Click);\r
+            // \r
             // DVD_Open\r
             // \r
             this.DVD_Open.Description = "Select the \"VIDEO_TS\" folder from your DVD Drive.";\r
@@ -1164,19 +1181,6 @@ namespace Handbrake
             this.label34.TabIndex = 1;\r
             this.label34.Text = resources.GetString("label34.Text");\r
             // \r
-            // btn_generate_Query\r
-            // \r
-            this.btn_generate_Query.FlatAppearance.BorderColor = System.Drawing.Color.Black;\r
-            this.btn_generate_Query.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.btn_generate_Query.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
-            this.btn_generate_Query.Location = new System.Drawing.Point(16, 104);\r
-            this.btn_generate_Query.Name = "btn_generate_Query";\r
-            this.btn_generate_Query.Size = new System.Drawing.Size(126, 22);\r
-            this.btn_generate_Query.TabIndex = 2;\r
-            this.btn_generate_Query.Text = "Generate Query";\r
-            this.btn_generate_Query.UseVisualStyleBackColor = true;\r
-            this.btn_generate_Query.Click += new System.EventHandler(this.btn_generate_Query_Click);\r
-            // \r
             // label33\r
             // \r
             this.label33.AutoSize = true;\r
index c25a996..af58957 100644 (file)
@@ -1529,7 +1529,7 @@ namespace Handbrake
             data_chpt.Rows.Clear();\r
             if (selectedTitle.Chapters.Count != 1)\r
             {\r
-                DataGridView chapterGridView = Main.ChapterNaming(data_chpt, drop_chapterFinish.Text);\r
+                DataGridView chapterGridView = Main.ChapterNaming(selectedTitle, data_chpt, drop_chapterFinish.Text);\r
                 if (chapterGridView != null)\r
                     data_chpt = chapterGridView;\r
             }\r
@@ -2031,7 +2031,7 @@ namespace Handbrake
         private void mnu_resetChapters_Click(object sender, EventArgs e)\r
         {\r
             data_chpt.Rows.Clear();\r
-            DataGridView chapterGridView = Main.ChapterNaming(data_chpt, drop_chapterFinish.Text);\r
+            DataGridView chapterGridView = Main.ChapterNaming(selectedTitle, data_chpt, drop_chapterFinish.Text);\r
             if (chapterGridView != null)\r
             {\r
                 data_chpt = chapterGridView;\r
index ef0cad2..c173c69 100644 (file)
@@ -152,7 +152,8 @@ The CSV should be formatted as follows:
 2,Chapter 2 Name\r
 3,Chapter 3 Name\r
 \r
-Note: Currently, if you wish to use a , in your chapter name, you must escape it with a \</value>\r
+Note: Currently, if you wish to use a , in your chapter name, you must escape it with a \\r
+Note2: HandBrake can NOT create chapters, only add a name to any chapters your source currently has.</value>\r
   </data>\r
   <data name="btn_export.ToolTip" xml:space="preserve">\r
     <value>Export to a comma separated file containing the chapter information.\r
@@ -164,6 +165,14 @@ The CSV is formatted as follows:
 \r
 Note: Commas in names are escaped by a \</value>\r
   </data>\r
+  <data name="drop_mode.ToolTip" xml:space="preserve">\r
+    <value>There are several ranges which can be encoded:\r
+- Encode a range of Chapters.\r
+\r
+The Following options are not 100% accurate:\r
+- Encode video between a start and end time, measured in seconds\r
+- Encode video between a start and end frame.</value>\r
+  </data>\r
   <metadata name="DVD_Open.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
     <value>232, 15</value>\r
   </metadata>\r