]> granicus.if.org Git - handbrake/commitdiff
WinGui:
authorsr55 <sr55.hb@outlook.com>
Thu, 22 Jan 2009 21:13:59 +0000 (21:13 +0000)
committersr55 <sr55.hb@outlook.com>
Thu, 22 Jan 2009 21:13:59 +0000 (21:13 +0000)
- Fixes/Tweaks to the chapter markers tab and handling code.

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

win/C#/Functions/Main.cs
win/C#/Program.cs
win/C#/frmMain.Designer.cs
win/C#/frmMain.cs
win/C#/frmMain.resx
win/C#/frmMain/QueryGenerator.cs

index 1f14766c5ead69561af7e86b3c339e451c39dd6c..05bb00f56dfb238c8d62331321a9b9d19d3a5de4 100644 (file)
@@ -106,7 +106,7 @@ namespace Handbrake.Functions
         /// <summary>\r
         /// Select the longest title in the DVD title dropdown menu on frmMain\r
         /// </summary>\r
-        public Handbrake.Parsing.Title selectLongestTitle(ComboBox drp_dvdtitle)\r
+        public Parsing.Title selectLongestTitle(ComboBox drp_dvdtitle)\r
         {\r
             int current_largest = 0;\r
             Handbrake.Parsing.Title title2Select;\r
@@ -157,27 +157,23 @@ namespace Handbrake.Functions
         /// Set's up the DataGridView on the Chapters tab (frmMain)\r
         /// </summary>\r
         /// <param name="mainWindow"></param>\r
-        public DataGridView chapterNaming(DataGridView data_chpt, string chapter_start, string chapter_end)\r
+        public DataGridView chapterNaming(DataGridView data_chpt, string chapter_end)\r
         {\r
-            int i = 0, rowCount = 0, start = 0, finish = 0;\r
+            int i = 0, finish = 0;\r
 \r
             if (chapter_end != "Auto")\r
                 int.TryParse(chapter_end, out finish);\r
 \r
-            if (chapter_start != "Auto")\r
-                int.TryParse(chapter_start, out start);\r
-\r
-            rowCount = finish - (start - 1);\r
-\r
-            while (i < rowCount)\r
+            while (i < finish)\r
             {\r
-                DataGridViewRow row = new DataGridViewRow();\r
-\r
-                data_chpt.Rows.Insert(i, row);\r
-                data_chpt.Rows[i].Cells[0].Value = (i + 1);\r
-                data_chpt.Rows[i].Cells[1].Value = "Chapter " + (i + 1);\r
+                int n = data_chpt.Rows.Add();\r
+                data_chpt.Rows[n].Cells[0].Value = (i + 1);\r
+                data_chpt.Rows[n].Cells[1].Value = "Chapter " + (i + 1);\r
+                data_chpt.Rows[n].Cells[0].ValueType = typeof(int);\r
+                data_chpt.Rows[n].Cells[1].ValueType = typeof(string);\r
                 i++;\r
             }\r
+    \r
             return data_chpt;\r
         }\r
 \r
index 6f71b80f05f46c0ce37ff1cbfc6de6e9f96ea797..6ab76bbaef04c08dca2ccf4ae06fe8804344659a 100644 (file)
@@ -5,20 +5,7 @@
           It may be used under the terms of the GNU General Public License. */\r
 \r
 using System;\r
-using System.Collections.Generic;\r
-using System.Collections.Specialized;\r
-using System.ComponentModel;\r
-using System.Data;\r
-using System.Drawing;\r
-using System.Text;\r
 using System.Windows.Forms;\r
-using System.Net;\r
-using System.IO;\r
-using System.Diagnostics;\r
-using System.Threading;\r
-using System.Runtime.InteropServices;\r
-using System.Globalization;\r
-\r
 \r
 namespace Handbrake\r
 {\r
@@ -44,7 +31,7 @@ namespace Handbrake
             }\r
             catch (Exception exc)\r
             {\r
-                MessageBox.Show("frmMain.cs - systemCheck() " + exc.ToString());\r
+                MessageBox.Show("frmMain.cs - systemCheck() " + exc);\r
             }\r
 \r
             // Either Launch or Close the Application\r
index 487669468789f160d270e50760f2af9be7d3a5f6..a45aea778bd8e237fbe01a8ef253d0dfd3a65d9b 100644 (file)
@@ -38,7 +38,7 @@ namespace Handbrake
             System.Windows.Forms.Label Label38;\r
             System.Windows.Forms.ContextMenuStrip notifyIconMenu;\r
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));\r
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();\r
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = 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.File_Save = new System.Windows.Forms.SaveFileDialog();\r
@@ -65,8 +65,6 @@ namespace Handbrake
             this.check_optimiseMP4 = new System.Windows.Forms.CheckBox();\r
             this.check_iPodAtom = new System.Windows.Forms.CheckBox();\r
             this.data_chpt = new System.Windows.Forms.DataGridView();\r
-            this.number = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
-            this.name = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
             this.btn_addPreset = new System.Windows.Forms.Button();\r
             this.btn_removePreset = new System.Windows.Forms.Button();\r
             this.drp_audenc_1 = new System.Windows.Forms.ComboBox();\r
@@ -98,6 +96,7 @@ namespace Handbrake
             this.File_Open = new System.Windows.Forms.OpenFileDialog();\r
             this.ISO_Open = new System.Windows.Forms.OpenFileDialog();\r
             this.FileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
+            this.mnu_killCLI = new System.Windows.Forms.ToolStripMenuItem();\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
@@ -252,7 +251,8 @@ namespace Handbrake
             this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components);\r
             this.StatusStrip = new System.Windows.Forms.StatusStrip();\r
             this.lbl_encode = new System.Windows.Forms.ToolStripStatusLabel();\r
-            this.mnu_killCLI = new System.Windows.Forms.ToolStripMenuItem();\r
+            this.number = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
+            this.name = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
             Label38 = new System.Windows.Forms.Label();\r
             notifyIconMenu = new System.Windows.Forms.ContextMenuStrip(this.components);\r
             notifyIconMenu.SuspendLayout();\r
@@ -302,12 +302,12 @@ namespace Handbrake
             this.btn_restore});\r
             notifyIconMenu.Name = "notifyIconMenu";\r
             notifyIconMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;\r
-            notifyIconMenu.Size = new System.Drawing.Size(124, 26);\r
+            notifyIconMenu.Size = new System.Drawing.Size(129, 26);\r
             // \r
             // btn_restore\r
             // \r
             this.btn_restore.Name = "btn_restore";\r
-            this.btn_restore.Size = new System.Drawing.Size(123, 22);\r
+            this.btn_restore.Size = new System.Drawing.Size(128, 22);\r
             this.btn_restore.Text = "Restore";\r
             this.btn_restore.Click += new System.EventHandler(this.btn_restore_Click);\r
             // \r
@@ -639,27 +639,13 @@ namespace Handbrake
             this.number,\r
             this.name});\r
             this.data_chpt.Location = new System.Drawing.Point(16, 55);\r
+            this.data_chpt.MultiSelect = false;\r
             this.data_chpt.Name = "data_chpt";\r
+            this.data_chpt.RowHeadersVisible = false;\r
             this.data_chpt.Size = new System.Drawing.Size(661, 234);\r
             this.data_chpt.TabIndex = 3;\r
             this.ToolTip.SetToolTip(this.data_chpt, resources.GetString("data_chpt.ToolTip"));\r
             // \r
-            // number\r
-            // \r
-            dataGridViewCellStyle1.Format = "N0";\r
-            dataGridViewCellStyle1.NullValue = null;\r
-            this.number.DefaultCellStyle = dataGridViewCellStyle1;\r
-            this.number.HeaderText = "Chapter Number";\r
-            this.number.MaxInputLength = 3;\r
-            this.number.Name = "number";\r
-            this.number.Width = 135;\r
-            // \r
-            // name\r
-            // \r
-            this.name.HeaderText = "Chapter Name";\r
-            this.name.Name = "name";\r
-            this.name.Width = 460;\r
-            // \r
             // btn_addPreset\r
             // \r
             this.btn_addPreset.FlatAppearance.BorderColor = System.Drawing.Color.Black;\r
@@ -1225,6 +1211,14 @@ namespace Handbrake
             this.FileToolStripMenuItem.Size = new System.Drawing.Size(38, 20);\r
             this.FileToolStripMenuItem.Text = "&File";\r
             // \r
+            // mnu_killCLI\r
+            // \r
+            this.mnu_killCLI.Name = "mnu_killCLI";\r
+            this.mnu_killCLI.Size = new System.Drawing.Size(156, 22);\r
+            this.mnu_killCLI.Text = "Cancel Scan";\r
+            this.mnu_killCLI.Visible = false;\r
+            this.mnu_killCLI.Click += new System.EventHandler(this.mnu_killCLI_Click);\r
+            // \r
             // mnu_exit\r
             // \r
             this.mnu_exit.Name = "mnu_exit";\r
@@ -1610,19 +1604,19 @@ namespace Handbrake
             this.toolStripSeparator2,\r
             this.audioList_remove});\r
             this.audioMenu.Name = "audioMenu";\r
-            this.audioMenu.Size = new System.Drawing.Size(142, 76);\r
+            this.audioMenu.Size = new System.Drawing.Size(152, 76);\r
             // \r
             // audioList_moveup\r
             // \r
             this.audioList_moveup.Name = "audioList_moveup";\r
-            this.audioList_moveup.Size = new System.Drawing.Size(141, 22);\r
+            this.audioList_moveup.Size = new System.Drawing.Size(151, 22);\r
             this.audioList_moveup.Text = "Move Up";\r
             this.audioList_moveup.Click += new System.EventHandler(this.audioList_moveup_Click);\r
             // \r
             // audioList_movedown\r
             // \r
             this.audioList_movedown.Name = "audioList_movedown";\r
-            this.audioList_movedown.Size = new System.Drawing.Size(141, 22);\r
+            this.audioList_movedown.Size = new System.Drawing.Size(151, 22);\r
             this.audioList_movedown.Text = "Move Down";\r
             this.audioList_movedown.TextAlign = System.Drawing.ContentAlignment.MiddleRight;\r
             this.audioList_movedown.Click += new System.EventHandler(this.audioList_movedown_Click);\r
@@ -1630,12 +1624,12 @@ namespace Handbrake
             // toolStripSeparator2\r
             // \r
             this.toolStripSeparator2.Name = "toolStripSeparator2";\r
-            this.toolStripSeparator2.Size = new System.Drawing.Size(138, 6);\r
+            this.toolStripSeparator2.Size = new System.Drawing.Size(148, 6);\r
             // \r
             // audioList_remove\r
             // \r
             this.audioList_remove.Name = "audioList_remove";\r
-            this.audioList_remove.Size = new System.Drawing.Size(141, 22);\r
+            this.audioList_remove.Size = new System.Drawing.Size(151, 22);\r
             this.audioList_remove.Text = "Remove";\r
             this.audioList_remove.Click += new System.EventHandler(this.audioList_remove_Click);\r
             // \r
@@ -2711,40 +2705,40 @@ namespace Handbrake
             this.pmnu_saveChanges,\r
             this.pmnu_delete});\r
             this.presets_menu.Name = "presets_menu";\r
-            this.presets_menu.Size = new System.Drawing.Size(155, 98);\r
+            this.presets_menu.Size = new System.Drawing.Size(163, 98);\r
             this.presets_menu.Text = ";";\r
             this.presets_menu.Opening += new System.ComponentModel.CancelEventHandler(this.presets_menu_Opening);\r
             // \r
             // pmnu_expandAll\r
             // \r
             this.pmnu_expandAll.Name = "pmnu_expandAll";\r
-            this.pmnu_expandAll.Size = new System.Drawing.Size(154, 22);\r
+            this.pmnu_expandAll.Size = new System.Drawing.Size(162, 22);\r
             this.pmnu_expandAll.Text = "Expand All";\r
             this.pmnu_expandAll.Click += new System.EventHandler(this.pmnu_expandAll_Click);\r
             // \r
             // pmnu_collapse\r
             // \r
             this.pmnu_collapse.Name = "pmnu_collapse";\r
-            this.pmnu_collapse.Size = new System.Drawing.Size(154, 22);\r
+            this.pmnu_collapse.Size = new System.Drawing.Size(162, 22);\r
             this.pmnu_collapse.Text = "Collapse All";\r
             this.pmnu_collapse.Click += new System.EventHandler(this.pmnu_collapse_Click);\r
             // \r
             // sep1\r
             // \r
             this.sep1.Name = "sep1";\r
-            this.sep1.Size = new System.Drawing.Size(151, 6);\r
+            this.sep1.Size = new System.Drawing.Size(159, 6);\r
             // \r
             // pmnu_saveChanges\r
             // \r
             this.pmnu_saveChanges.Name = "pmnu_saveChanges";\r
-            this.pmnu_saveChanges.Size = new System.Drawing.Size(154, 22);\r
+            this.pmnu_saveChanges.Size = new System.Drawing.Size(162, 22);\r
             this.pmnu_saveChanges.Text = "Save Changes";\r
             this.pmnu_saveChanges.Click += new System.EventHandler(this.pmnu_saveChanges_Click);\r
             // \r
             // pmnu_delete\r
             // \r
             this.pmnu_delete.Name = "pmnu_delete";\r
-            this.pmnu_delete.Size = new System.Drawing.Size(154, 22);\r
+            this.pmnu_delete.Size = new System.Drawing.Size(162, 22);\r
             this.pmnu_delete.Text = "Delete";\r
             this.pmnu_delete.Click += new System.EventHandler(this.pmnu_delete_click);\r
             // \r
@@ -2778,7 +2772,7 @@ namespace Handbrake
             this.btn_source.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;\r
             this.btn_source.ImageTransparentColor = System.Drawing.Color.Magenta;\r
             this.btn_source.Name = "btn_source";\r
-            this.btn_source.Size = new System.Drawing.Size(85, 36);\r
+            this.btn_source.Size = new System.Drawing.Size(90, 36);\r
             this.btn_source.Text = "Source";\r
             this.btn_source.ToolTipText = "Open a new source file or folder.";\r
             this.btn_source.Click += new System.EventHandler(this.btn_source_Click);\r
@@ -2787,7 +2781,7 @@ namespace Handbrake
             // \r
             this.btn_file_source.Image = global::Handbrake.Properties.Resources.Movies_Small;\r
             this.btn_file_source.Name = "btn_file_source";\r
-            this.btn_file_source.Size = new System.Drawing.Size(194, 22);\r
+            this.btn_file_source.Size = new System.Drawing.Size(214, 22);\r
             this.btn_file_source.Text = "Video File";\r
             this.btn_file_source.Click += new System.EventHandler(this.btn_file_source_Click);\r
             // \r
@@ -2796,20 +2790,20 @@ namespace Handbrake
             this.btn_dvd_source.Image = ((System.Drawing.Image)(resources.GetObject("btn_dvd_source.Image")));\r
             this.btn_dvd_source.ImageTransparentColor = System.Drawing.Color.Magenta;\r
             this.btn_dvd_source.Name = "btn_dvd_source";\r
-            this.btn_dvd_source.Size = new System.Drawing.Size(194, 22);\r
+            this.btn_dvd_source.Size = new System.Drawing.Size(214, 22);\r
             this.btn_dvd_source.Text = "DVD/ VIDEO_TS Folder";\r
             this.btn_dvd_source.Click += new System.EventHandler(this.btn_dvd_source_Click);\r
             // \r
             // toolStripSeparator1\r
             // \r
             this.toolStripSeparator1.Name = "toolStripSeparator1";\r
-            this.toolStripSeparator1.Size = new System.Drawing.Size(191, 6);\r
+            this.toolStripSeparator1.Size = new System.Drawing.Size(211, 6);\r
             // \r
             // mnu_dvd_drive\r
             // \r
             this.mnu_dvd_drive.Image = global::Handbrake.Properties.Resources.disc_small;\r
             this.mnu_dvd_drive.Name = "mnu_dvd_drive";\r
-            this.mnu_dvd_drive.Size = new System.Drawing.Size(194, 22);\r
+            this.mnu_dvd_drive.Size = new System.Drawing.Size(214, 22);\r
             this.mnu_dvd_drive.Text = "[No DVD Drive Ready]";\r
             this.mnu_dvd_drive.Visible = false;\r
             this.mnu_dvd_drive.Click += new System.EventHandler(this.mnu_dvd_drive_Click);\r
@@ -2825,7 +2819,7 @@ namespace Handbrake
             this.btn_start.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;\r
             this.btn_start.ImageTransparentColor = System.Drawing.Color.Magenta;\r
             this.btn_start.Name = "btn_start";\r
-            this.btn_start.Size = new System.Drawing.Size(67, 36);\r
+            this.btn_start.Size = new System.Drawing.Size(70, 36);\r
             this.btn_start.Text = "Start";\r
             this.btn_start.ToolTipText = "Start the encoding process";\r
             this.btn_start.Click += new System.EventHandler(this.btn_start_Click);\r
@@ -2836,7 +2830,7 @@ namespace Handbrake
             this.btn_add2Queue.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;\r
             this.btn_add2Queue.ImageTransparentColor = System.Drawing.Color.Magenta;\r
             this.btn_add2Queue.Name = "btn_add2Queue";\r
-            this.btn_add2Queue.Size = new System.Drawing.Size(110, 36);\r
+            this.btn_add2Queue.Size = new System.Drawing.Size(122, 36);\r
             this.btn_add2Queue.Text = "Add to Queue";\r
             this.btn_add2Queue.ToolTipText = "Add a new item to the Queue";\r
             this.btn_add2Queue.Click += new System.EventHandler(this.btn_add2Queue_Click);\r
@@ -2847,7 +2841,7 @@ namespace Handbrake
             this.btn_showQueue.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;\r
             this.btn_showQueue.ImageTransparentColor = System.Drawing.Color.Magenta;\r
             this.btn_showQueue.Name = "btn_showQueue";\r
-            this.btn_showQueue.Size = new System.Drawing.Size(104, 36);\r
+            this.btn_showQueue.Size = new System.Drawing.Size(115, 36);\r
             this.btn_showQueue.Tag = "";\r
             this.btn_showQueue.Text = "Show Queue";\r
             this.btn_showQueue.Click += new System.EventHandler(this.btn_showQueue_Click);\r
@@ -2866,20 +2860,20 @@ namespace Handbrake
             this.tb_preview.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;\r
             this.tb_preview.ImageTransparentColor = System.Drawing.Color.Magenta;\r
             this.tb_preview.Name = "tb_preview";\r
-            this.tb_preview.Size = new System.Drawing.Size(90, 36);\r
+            this.tb_preview.Size = new System.Drawing.Size(95, 36);\r
             this.tb_preview.Text = "Preview";\r
             // \r
             // mnu_qtpreview\r
             // \r
             this.mnu_qtpreview.Name = "mnu_qtpreview";\r
-            this.mnu_qtpreview.Size = new System.Drawing.Size(185, 22);\r
+            this.mnu_qtpreview.Size = new System.Drawing.Size(203, 22);\r
             this.mnu_qtpreview.Text = "Preview in QuickTime";\r
             this.mnu_qtpreview.Click += new System.EventHandler(this.mnu_qtpreview_Click);\r
             // \r
             // mnu_vlcpreview\r
             // \r
             this.mnu_vlcpreview.Name = "mnu_vlcpreview";\r
-            this.mnu_vlcpreview.Size = new System.Drawing.Size(185, 22);\r
+            this.mnu_vlcpreview.Size = new System.Drawing.Size(203, 22);\r
             this.mnu_vlcpreview.Text = "Preview in VLC";\r
             this.mnu_vlcpreview.Click += new System.EventHandler(this.mnu_vlcpreview_Click);\r
             // \r
@@ -2889,7 +2883,7 @@ namespace Handbrake
             this.btn_ActivityWindow.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;\r
             this.btn_ActivityWindow.ImageTransparentColor = System.Drawing.Color.Magenta;\r
             this.btn_ActivityWindow.Name = "btn_ActivityWindow";\r
-            this.btn_ActivityWindow.Size = new System.Drawing.Size(120, 36);\r
+            this.btn_ActivityWindow.Size = new System.Drawing.Size(132, 36);\r
             this.btn_ActivityWindow.Text = "Activity Window";\r
             this.btn_ActivityWindow.ToolTipText = "Displays the activity window which displays the log of the last completed or curr" +\r
                 "ently running encode.";\r
@@ -2922,13 +2916,21 @@ namespace Handbrake
             this.lbl_encode.Size = new System.Drawing.Size(31, 17);\r
             this.lbl_encode.Text = "{0}";\r
             // \r
-            // mnu_killCLI\r
+            // number\r
             // \r
-            this.mnu_killCLI.Name = "mnu_killCLI";\r
-            this.mnu_killCLI.Size = new System.Drawing.Size(156, 22);\r
-            this.mnu_killCLI.Text = "Cancel Scan";\r
-            this.mnu_killCLI.Visible = false;\r
-            this.mnu_killCLI.Click += new System.EventHandler(this.mnu_killCLI_Click);\r
+            dataGridViewCellStyle2.Format = "N0";\r
+            dataGridViewCellStyle2.NullValue = null;\r
+            this.number.DefaultCellStyle = dataGridViewCellStyle2;\r
+            this.number.HeaderText = "Chapter Number";\r
+            this.number.MaxInputLength = 3;\r
+            this.number.Name = "number";\r
+            this.number.Width = 165;\r
+            // \r
+            // name\r
+            // \r
+            this.name.HeaderText = "Chapter Name";\r
+            this.name.Name = "name";\r
+            this.name.Width = 460;\r
             // \r
             // frmMain\r
             // \r
@@ -3144,8 +3146,6 @@ namespace Handbrake
         internal System.Windows.Forms.Label label66;\r
         internal System.Windows.Forms.Label label67;\r
         internal System.Windows.Forms.Label label68;\r
-        private System.Windows.Forms.DataGridViewTextBoxColumn number;\r
-        private System.Windows.Forms.DataGridViewTextBoxColumn name;\r
         private System.Windows.Forms.GroupBox groupBox3;\r
         private System.Windows.Forms.GroupBox groupBox5;\r
         private System.Windows.Forms.Button btn_destBrowse;\r
@@ -3210,6 +3210,8 @@ namespace Handbrake
         private System.Windows.Forms.ToolStripMenuItem mnu_vlcpreview;\r
         private System.Windows.Forms.ToolStripMenuItem pmnu_saveChanges;\r
         private System.Windows.Forms.ToolStripMenuItem mnu_killCLI;\r
+        private System.Windows.Forms.DataGridViewTextBoxColumn number;\r
+        private System.Windows.Forms.DataGridViewTextBoxColumn name;\r
 \r
     }\r
 }
\ No newline at end of file
index 9a5b5da49809778517bc594a2d558b49cbfdd76d..e3537408c14b4bd2057baecf469ac3fcd3ba5784 100644 (file)
@@ -862,9 +862,13 @@ namespace Handbrake
                 text_destination.Text = hb_common_func.autoName(drp_dvdtitle, drop_chapterStart.Text, drop_chapterFinish.Text, text_source.Text, text_destination.Text, drop_format.SelectedIndex);\r
 \r
             data_chpt.Rows.Clear();\r
-            DataGridView chapterGridView = hb_common_func.chapterNaming(data_chpt, drop_chapterStart.Text, drop_chapterFinish.Text);\r
+            DataGridView chapterGridView = hb_common_func.chapterNaming(data_chpt, drop_chapterFinish.Text);\r
             if (chapterGridView != null)\r
                 data_chpt = chapterGridView;\r
+\r
+            // Hack to force the redraw of the scrollbars which don't resize properly when the control is disabled.\r
+            data_chpt.Columns[0].Width = 166;\r
+            data_chpt.Columns[0].Width = 165;\r
         }\r
         private void drop_chapterStart_SelectedIndexChanged(object sender, EventArgs e)\r
         {\r
@@ -887,6 +891,7 @@ namespace Handbrake
             // Run the Autonaming function\r
             if (Properties.Settings.Default.autoNaming == "Checked")\r
                 text_destination.Text = hb_common_func.autoName(drp_dvdtitle, drop_chapterStart.Text, drop_chapterFinish.Text, text_source.Text, text_destination.Text, drop_format.SelectedIndex);\r
+\r
         }\r
         private void drop_chapterFinish_SelectedIndexChanged(object sender, EventArgs e)\r
         {\r
@@ -909,6 +914,25 @@ namespace Handbrake
             // Run the Autonaming function\r
             if (Properties.Settings.Default.autoNaming == "Checked")\r
                 text_destination.Text = hb_common_func.autoName(drp_dvdtitle, drop_chapterStart.Text, drop_chapterFinish.Text, text_source.Text, text_destination.Text, drop_format.SelectedIndex);\r
+        \r
+            // Add more rows to the Chapter menu if needed.\r
+            if (Check_ChapterMarkers.Checked)\r
+            {\r
+                int i = data_chpt.Rows.Count, finish = 0;\r
+\r
+                if (drop_chapterFinish.Text != "Auto")\r
+                    int.TryParse(drop_chapterFinish.Text, out finish);\r
+\r
+                while (i < finish)\r
+                {\r
+                    int n = data_chpt.Rows.Add();\r
+                    data_chpt.Rows[n].Cells[0].Value = (i + 1);\r
+                    data_chpt.Rows[n].Cells[1].Value = "Chapter " + (i + 1);\r
+                    data_chpt.Rows[n].Cells[0].ValueType = typeof (int);\r
+                    data_chpt.Rows[n].Cells[1].ValueType = typeof (string);\r
+                    i++;\r
+                }\r
+            }\r
         }\r
 \r
         //Destination\r
@@ -1396,7 +1420,7 @@ namespace Handbrake
                 text_destination.Text = text_destination.Text.Replace(".m4v", ".mp4");\r
                 data_chpt.Rows.Clear();\r
                 data_chpt.Enabled = true;\r
-                DataGridView chapterGridView = hb_common_func.chapterNaming(data_chpt, drop_chapterStart.Text, drop_chapterFinish.Text);\r
+                DataGridView chapterGridView = hb_common_func.chapterNaming(data_chpt, drop_chapterFinish.Text);\r
                 if (chapterGridView != null)\r
                     data_chpt = chapterGridView;\r
             }\r
@@ -1533,6 +1557,7 @@ namespace Handbrake
             tb_preview.Enabled = false;\r
             mnu_killCLI.Visible = true;\r
         }\r
+\r
         private void startScan(String filename)\r
         {\r
             try\r
@@ -1585,8 +1610,7 @@ namespace Handbrake
             catch (Exception exc)\r
             {\r
                 MessageBox.Show("frmMain.cs - scanProcess() " + exc.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
-\r
-                // Recover From Error Here\r
+                enableGUI();\r
             }\r
         }\r
         private void updateUIafterScan()\r
@@ -1626,11 +1650,27 @@ namespace Handbrake
                     MessageBox.Show("No Title(s) found. Please make sure you have selected a valid, non-copy protected source.\nYour Source may be copy protected, badly mastered or a format which HandBrake does not support. \nPlease refer to the Documentation and FAQ (see Help Menu).", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);\r
 \r
                 // Enable the GUI components and enable any disabled components\r
+                enableGUI();\r
+            }\r
+            catch (Exception exc)\r
+            {\r
+                MessageBox.Show("frmMain.cs - updateUIafterScan " + exc, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
+                enableGUI();\r
+            }\r
+        }\r
+\r
+        private void enableGUI()\r
+        {\r
+            try\r
+            {\r
+                if (InvokeRequired)\r
+                {\r
+                    BeginInvoke(new UpdateWindowHandler(updateUIafterScan));\r
+                }\r
                 lbl_encode.Text = "Scan Completed";\r
                 gb_source.Text = "Source";\r
                 foreach (Control ctrl in Controls)\r
                     ctrl.Enabled = true;\r
-\r
                 btn_start.Enabled = true;\r
                 btn_showQueue.Enabled = true;\r
                 btn_add2Queue.Enabled = true;\r
@@ -1640,10 +1680,11 @@ namespace Handbrake
             }\r
             catch (Exception exc)\r
             {\r
-                MessageBox.Show("frmMain.cs - updateUIafterScan " + exc, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
+                MessageBox.Show("frmMain.cs - enableGUI " + exc, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
             }\r
         }\r
-        private void killCLI()\r
+\r
+        private static void killCLI()\r
         {\r
             // This may seem like a long way of killing HandBrakeCLI, but for whatever reason,\r
             // hbproc.kill/close just won't do the trick.\r
@@ -2080,6 +2121,7 @@ namespace Handbrake
         }\r
 \r
         #endregion\r
+\r
         // This is the END of the road ------------------------------------------------------------------------------\r
     }\r
 }
\ No newline at end of file
index d6bf08e3e0a56db8abc5c1a5207fa657ea90865f..397e41ca709c7a64eedbe7452c31237481bcaba5 100644 (file)
@@ -669,6 +669,12 @@ If you're going to choose between spatial and temporal, spatial is usually bette
   <metadata name="StatusStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
     <value>1113, 15</value>\r
   </metadata>\r
+  <metadata name="number.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
+    <value>True</value>\r
+  </metadata>\r
+  <metadata name="name.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
+    <value>True</value>\r
+  </metadata>\r
   <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
     <value>56</value>\r
   </metadata>\r
index f9f84bbd5d8c1d468d3680a72446ab1b862c452c..346657c4df43d1f3677f20d36e1bcd66051d57a8 100644 (file)
@@ -1,5 +1,4 @@
 using System;\r
-using System.Collections;\r
 using System.Text;\r
 using System.Windows.Forms;\r
 using System.Globalization;\r
@@ -414,10 +413,10 @@ namespace Handbrake
 \r
             // Attach Source name and dvd title to the start of the chapters.csv filename.\r
             // This is for the queue. It allows different chapter name files for each title.\r
-            string source_name = mainWindow.text_source.Text;\r
-            string[] sourceName = source_name.Split('\\');\r
-            source_name = sourceName[sourceName.Length - 1];\r
-            source_name = source_name.Replace("\"", "");\r
+            string[] destName =  mainWindow.text_destination.Text.Split('\\');\r
+            string dest_name = destName[destName.Length - 1];\r
+            dest_name = dest_name.Replace("\"", "");\r
+            dest_name = dest_name.Replace(".mp4", "").Replace(".m4v", "").Replace(".avi", "").Replace(".mkv", "").Replace(".ogm", "");\r
 \r
             string source_title = mainWindow.drp_dvdtitle.Text;\r
             string[] titlesplit = source_title.Split(' ');\r
@@ -425,13 +424,13 @@ namespace Handbrake
 \r
             if (mainWindow.Check_ChapterMarkers.Checked)\r
             {\r
-                if ((source_name.Trim() != "Click 'Source' to continue") && (source_name.Trim() != ""))\r
+                if (dest_name.Trim() != String.Empty)\r
                 {\r
-                    string path = "";\r
+                    string path;\r
                     if (source_title != "Automatic")\r
-                        path = Path.Combine(Path.GetTempPath(), source_name + "-" + source_title + "-chapters.csv");\r
+                        path = Path.Combine(Path.GetTempPath(), dest_name + "-" + source_title + "-chapters.csv");\r
                     else\r
-                        path = Path.Combine(Path.GetTempPath(), source_name + "-chapters.csv");\r
+                        path = Path.Combine(Path.GetTempPath(), dest_name + "-chapters.csv");\r
 \r
                     if (chapterCSVSave(mainWindow, path) == false)\r
                         query += " -m ";\r
@@ -540,7 +539,7 @@ namespace Handbrake
             }\r
             catch (Exception exc)\r
             {\r
-                MessageBox.Show("Unable to save Chapter Makrers file! \nChapter marker names will NOT be saved in your encode \n\n" + exc.ToString(), "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
+                MessageBox.Show("Unable to save Chapter Makrers file! \nChapter marker names will NOT be saved in your encode \n\n" + exc, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
                 return false;\r
             }\r
         }\r