diff options
author | sr55 <[email protected]> | 2008-12-19 13:57:08 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2008-12-19 13:57:08 +0000 |
commit | ac1f7bafb2f980eda44bd93e507914ae8aa284dc (patch) | |
tree | 236f334148ef44a1caec1b70065b60b71781a37d /win/C#/frmQueue.cs | |
parent | e3097f34b3f5ba278a90721d131b97890d92e006 (diff) |
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
Diffstat (limited to 'win/C#/frmQueue.cs')
-rw-r--r-- | win/C#/frmQueue.cs | 51 |
1 files changed, 13 insertions, 38 deletions
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);
- }
}
/// <summary>
@@ -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)
|