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