From e3097f34b3f5ba278a90721d131b97890d92e006 Mon Sep 17 00:00:00 2001 From: sr55 Date: Wed, 17 Dec 2008 00:11:23 +0000 Subject: [PATCH] WinGui: - Some fixes in the new code which handles encoding across the Queue and MainWindow. - Small UI tweaks on Activity Window and Generate Preview Window git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2039 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/C#/frmActivityWindow.Designer.cs | 15 ++++++----- win/C#/frmGenPreview.cs | 1 + win/C#/frmMain.Designer.cs | 11 ++++---- win/C#/frmMain.cs | 8 ++++-- win/C#/frmQueue.cs | 38 ++++++++++++++++------------ 5 files changed, 43 insertions(+), 30 deletions(-) diff --git a/win/C#/frmActivityWindow.Designer.cs b/win/C#/frmActivityWindow.Designer.cs index a57603e50..cdd7d2d60 100644 --- a/win/C#/frmActivityWindow.Designer.cs +++ b/win/C#/frmActivityWindow.Designer.cs @@ -72,13 +72,13 @@ namespace Handbrake this.rightClickMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.mnu_copy_log}); this.rightClickMenu.Name = "rightClickMenu"; - this.rightClickMenu.Size = new System.Drawing.Size(153, 48); + this.rightClickMenu.Size = new System.Drawing.Size(111, 26); // // mnu_copy_log // this.mnu_copy_log.Image = global::Handbrake.Properties.Resources.copy; this.mnu_copy_log.Name = "mnu_copy_log"; - this.mnu_copy_log.Size = new System.Drawing.Size(152, 22); + this.mnu_copy_log.Size = new System.Drawing.Size(110, 22); this.mnu_copy_log.Text = "Copy"; this.mnu_copy_log.Click += new System.EventHandler(this.mnu_copy_log_Click); // @@ -109,14 +109,14 @@ namespace Handbrake this.toolStripDropDownButton1.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripDropDownButton1.Name = "toolStripDropDownButton1"; - this.toolStripDropDownButton1.Size = new System.Drawing.Size(94, 22); + this.toolStripDropDownButton1.Size = new System.Drawing.Size(85, 22); this.toolStripDropDownButton1.Text = "Select Log"; // // btn_encode_log // this.btn_encode_log.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.btn_encode_log.Name = "btn_encode_log"; - this.btn_encode_log.Size = new System.Drawing.Size(151, 22); + this.btn_encode_log.Size = new System.Drawing.Size(140, 22); this.btn_encode_log.Text = "Encode Log"; this.btn_encode_log.Click += new System.EventHandler(this.btn_encode_log_Click); // @@ -124,7 +124,7 @@ namespace Handbrake // this.btn_scan_log.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.btn_scan_log.Name = "btn_scan_log"; - this.btn_scan_log.Size = new System.Drawing.Size(151, 22); + this.btn_scan_log.Size = new System.Drawing.Size(140, 22); this.btn_scan_log.Text = "Scan Log"; this.btn_scan_log.Click += new System.EventHandler(this.btn_scan_log_Click); // @@ -134,7 +134,7 @@ namespace Handbrake this.btn_copy.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; this.btn_copy.ImageTransparentColor = System.Drawing.Color.Magenta; this.btn_copy.Name = "btn_copy"; - this.btn_copy.Size = new System.Drawing.Size(122, 22); + this.btn_copy.Size = new System.Drawing.Size(111, 22); this.btn_copy.Text = "Copy to clipboard"; this.btn_copy.Click += new System.EventHandler(this.btn_copy_Click); // @@ -159,6 +159,7 @@ namespace Handbrake // // lbl_slb // + this.lbl_slb.BackColor = System.Drawing.Color.Transparent; this.lbl_slb.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lbl_slb.Name = "lbl_slb"; this.lbl_slb.Size = new System.Drawing.Size(94, 17); @@ -168,7 +169,7 @@ namespace Handbrake // this.txt_log.BackColor = System.Drawing.Color.Transparent; this.txt_log.Name = "txt_log"; - this.txt_log.Size = new System.Drawing.Size(85, 17); + this.txt_log.Size = new System.Drawing.Size(74, 17); this.txt_log.Text = "{selected log}"; // // frmActivityWindow diff --git a/win/C#/frmGenPreview.cs b/win/C#/frmGenPreview.cs index 3d6528de9..d2d7aee14 100644 --- a/win/C#/frmGenPreview.cs +++ b/win/C#/frmGenPreview.cs @@ -24,6 +24,7 @@ namespace Handbrake { InitializeComponent(); this.mainWindow = mw; + cb_duration.SelectedIndex = 0; } private void btn_play_Click(object sender, EventArgs e) diff --git a/win/C#/frmMain.Designer.cs b/win/C#/frmMain.Designer.cs index 34bbd48cb..2911b062c 100644 --- a/win/C#/frmMain.Designer.cs +++ b/win/C#/frmMain.Designer.cs @@ -1639,7 +1639,8 @@ namespace Handbrake this.HelpToolStripMenuItem}); this.frmMainMenu.Location = new System.Drawing.Point(0, 0); this.frmMainMenu.Name = "frmMainMenu"; - this.frmMainMenu.Size = new System.Drawing.Size(985, 24); + this.frmMainMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional; + this.frmMainMenu.Size = new System.Drawing.Size(983, 24); this.frmMainMenu.TabIndex = 0; this.frmMainMenu.Text = "MenuStrip1"; // @@ -3042,7 +3043,7 @@ namespace Handbrake this.toolStrip1.Location = new System.Drawing.Point(0, 24); this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; - this.toolStrip1.Size = new System.Drawing.Size(985, 39); + this.toolStrip1.Size = new System.Drawing.Size(983, 39); this.toolStrip1.TabIndex = 1; this.toolStrip1.Text = "toolStrip1"; // @@ -3172,9 +3173,9 @@ namespace Handbrake // this.StatusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.lbl_encode}); - this.StatusStrip.Location = new System.Drawing.Point(0, 629); + this.StatusStrip.Location = new System.Drawing.Point(0, 627); this.StatusStrip.Name = "StatusStrip"; - this.StatusStrip.Size = new System.Drawing.Size(985, 22); + this.StatusStrip.Size = new System.Drawing.Size(983, 22); this.StatusStrip.TabIndex = 7; this.StatusStrip.Text = "statusStrip1"; // @@ -3189,7 +3190,7 @@ namespace Handbrake // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(985, 651); + this.ClientSize = new System.Drawing.Size(983, 649); this.Controls.Add(this.GroupBox1); this.Controls.Add(this.groupBox_dest); this.Controls.Add(this.groupBox_output); diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 3efa040c5..d5b70e363 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -471,9 +471,13 @@ namespace Handbrake else query = queryGen.GenerateTheQuery(this); - encodeQueue.add(query, text_source.Text, text_destination.Text); - encodeQueue.write2disk("hb_queue_recovery.xml"); + if (encodeQueue.count() == 0) + { + encodeQueue.add(query, text_source.Text, text_destination.Text); + encodeQueue.write2disk("hb_queue_recovery.xml"); + } queueWindow.setQueue(encodeQueue); + queueWindow.Show(); queueWindow.frmMain_encode(); setEncodeStatus(1); // Encode is running, so setup the GUI appropriately diff --git a/win/C#/frmQueue.cs b/win/C#/frmQueue.cs index 86ae4b5bd..648deef89 100644 --- a/win/C#/frmQueue.cs +++ b/win/C#/frmQueue.cs @@ -81,6 +81,15 @@ namespace Handbrake { if (queue.count() != 0) { + // Setup or reset some values + btn_encode.Enabled = false; + btn_stop.Visible = true; + progressBar.Value = 0; + lbl_progressValue.Text = "0 %"; + if (queue.count() == 0) + progressBar.Step = 100; + else + progressBar.Step = 100 / queue.count(); Thread theQ = new Thread(startProc); theQ.IsBackground = true; theQ.Start(); @@ -135,19 +144,16 @@ namespace Handbrake // Initializes the encode process private void btn_encode_Click(object sender, EventArgs e) { - mainWindow.setLastAction("encode"); - mainWindow.setEncodeStatus(1); - if (queue.count() != 0) { btn_encode.Enabled = false; - } - cancel = false; + mainWindow.setLastAction("encode"); + mainWindow.setEncodeStatus(1); - // Start the encode - try - { - if (queue.count() != 0) + cancel = false; + + // Start the encode + try { // Setup or reset some values btn_encode.Enabled = false; @@ -162,10 +168,10 @@ namespace Handbrake theQ.IsBackground = true; theQ.Start(); } - } - catch (Exception exc) - { - MessageBox.Show(exc.ToString()); + catch (Exception exc) + { + MessageBox.Show(exc.ToString()); + } } } @@ -339,8 +345,8 @@ namespace Handbrake queue.write2disk("hb_queue_recovery.xml"); // Update the queue recovery file redrawQueue(); - if (selected - 1 > 0) - list_queue.Items[selected -1].Selected = true; + if (selected - 1 > 0) + list_queue.Items[selected - 1].Selected = true; list_queue.Select(); } @@ -355,7 +361,7 @@ namespace Handbrake queue.write2disk("hb_queue_recovery.xml"); // Update the queue recovery file redrawQueue(); - if (selected +1 < list_queue.Items.Count) + if (selected + 1 < list_queue.Items.Count) list_queue.Items[selected + 1].Selected = true; list_queue.Select(); -- 2.40.0