From ac1f7bafb2f980eda44bd93e507914ae8aa284dc Mon Sep 17 00:00:00 2001 From: sr55 Date: Fri, 19 Dec 2008 13:57:08 +0000 Subject: WinGui: - Fixes for a few rather stupid issues with the new queue/mainwindow encode link. - Got rid of the queue encode progress bar. It's just a pain to keep it working and doesn't really offer much. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2040 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/C#/frmQueue.cs | 51 +++++++++++++-------------------------------------- 1 file changed, 13 insertions(+), 38 deletions(-) (limited to 'win/C#/frmQueue.cs') diff --git a/win/C#/frmQueue.cs b/win/C#/frmQueue.cs index 648deef89..ed1eb5a9b 100644 --- a/win/C#/frmQueue.cs +++ b/win/C#/frmQueue.cs @@ -44,18 +44,6 @@ namespace Handbrake queue = qw; redrawQueue(); lbl_encodesPending.Text = list_queue.Items.Count + " encode(s) pending"; - - // Recalculate the progress bar, but only if the queue has already started. - if (progressBar.Value != 0) - { - progressBar.Value = 0; - if (queue.count() == 0) - progressBar.Step = 100; - else - progressBar.Step = 100 / queue.count(); - progressBar.PerformStep(); - lbl_progressValue.Text = string.Format("{0} %", progressBar.Value); - } } /// @@ -84,12 +72,7 @@ namespace Handbrake // 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(); @@ -101,6 +84,17 @@ namespace Handbrake } } + public void frmMain_cancelEncode() + { + Process[] aProc = Process.GetProcessesByName("HandBrakeCLI"); + Process HandBrakeCLI; + if (aProc.Length > 0) + { + HandBrakeCLI = aProc[0]; + HandBrakeCLI.Kill(); + } + } + // Redraw's the queue with the latest data from the Queue class private void redrawQueue() { @@ -158,12 +152,7 @@ namespace Handbrake // 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(); @@ -233,17 +222,6 @@ namespace Handbrake btn_stop.Visible = false; btn_encode.Enabled = true; - if (cancel == true) - { - lbl_progressValue.Text = "Encode Queue Cancelled!"; - } - else - { - lbl_progressValue.Text = "Encode Queue Completed!"; - } - - progressBar.Value = 0; - lbl_source.Text = "-"; lbl_dest.Text = "-"; lbl_vEnc.Text = "-"; @@ -280,9 +258,6 @@ namespace Handbrake } redrawQueue(); - - progressBar.PerformStep(); - lbl_progressValue.Text = string.Format("{0} %", progressBar.Value); lbl_encodesPending.Text = list_queue.Items.Count + " encode(s) pending"; } catch (Exception exc) -- cgit v1.2.3