summaryrefslogtreecommitdiffstats
path: root/win/C#/frmQueue.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2007-09-06 18:53:12 +0000
committersr55 <[email protected]>2007-09-06 18:53:12 +0000
commit34066d8b700f3ec50e77a59844e8467335ca043f (patch)
tree6b8fbf3d8f59b2f98b1a2377581359e4aaa0683e /win/C#/frmQueue.cs
parent47adb09d6cd176ca71bec813f4b47bef4b166343 (diff)
WinGui:
- Fixes a few issues with the queue. Should no longer miss items at random. Should also be a little more stable now too. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@929 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/frmQueue.cs')
-rw-r--r--win/C#/frmQueue.cs89
1 files changed, 46 insertions, 43 deletions
diff --git a/win/C#/frmQueue.cs b/win/C#/frmQueue.cs
index 5d2b7ba2b..5dfdec47b 100644
--- a/win/C#/frmQueue.cs
+++ b/win/C#/frmQueue.cs
@@ -42,59 +42,64 @@ namespace Handbrake
[DllImport("user32.dll")]
public static extern void LockWorkStation();
[DllImport("user32.dll")]
- public static extern int ExitWindowsEx(int uFlags, int dwReason);
+ public static extern int ExitWindowsEx(int uFlags, int dwReason);
+ private void processItem()
+ {
+
+ }
private void startProc(object state)
{
- started = true;
- initialListCount = list_queue.Items.Count;
- for (int i = 0; i < initialListCount; i++)
+ try
{
- string query = list_queue.Items[0].ToString();
+ initialListCount = list_queue.Items.Count;
+ while (list_queue.Items.Count != 0)
+ {
+ string query = list_queue.Items[0].ToString();
+ updateUIElements();
+
+ Functions.CLI process = new Functions.CLI();
+ Process hbProc = process.runCli(this, query, false, false, false, false);
+
+ hbProc.WaitForExit();
+ hbProc.Close();
+ hbProc.Dispose();
+ }
- Functions.CLI process = new Functions.CLI();
- Process hbProc = process.runCli(this, query, false, false, false, false);
-
- hbProc.WaitForExit();
- hbProc.Close();
- hbProc.Dispose();
- updateUIElements();
+ resetQueue();
- if ((initialListCount - i) != (list_queue.Items.Count))
+ // Do something whent he encode ends.
+ switch (Properties.Settings.Default.CompletionOption)
{
- initialListCount++;
+ case "Shutdown":
+ System.Diagnostics.Process.Start("Shutdown", "-s -t 60");
+ break;
+ case "Log Off":
+ ExitWindowsEx(0, 0);
+ break;
+ case "Suspend":
+ Application.SetSuspendState(PowerState.Suspend, true, true);
+ break;
+ case "Hibernate":
+ Application.SetSuspendState(PowerState.Hibernate, true, true);
+ break;
+ case "Lock System":
+ LockWorkStation();
+ break;
+ case "Quit HandBrake":
+ Application.Exit();
+ break;
+ default:
+ break;
}
- }
- started = false;
- resetQueue();
- // Do something whent he encode ends.
- switch (Properties.Settings.Default.CompletionOption)
+ MessageBox.Show("Encode Queue Completed!", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
+ }
+ catch (Exception exc)
{
- case "Shutdown":
- System.Diagnostics.Process.Start("Shutdown", "-s -t 60");
- break;
- case "Log Off":
- ExitWindowsEx(0, 0);
- break;
- case "Suspend":
- Application.SetSuspendState(PowerState.Suspend, true, true);
- break;
- case "Hibernate":
- Application.SetSuspendState(PowerState.Hibernate, true, true);
- break;
- case "Lock System":
- LockWorkStation();
- break;
- case "Quit HandBrake":
- Application.Exit();
- break;
- default:
- break;
+ MessageBox.Show(exc.ToString());
}
-
- MessageBox.Show("Encode Queue Completed!", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
private void updateUIElements()
@@ -167,8 +172,6 @@ namespace Handbrake
private void btn_delete_Click(object sender, EventArgs e)
{
list_queue.Items.Remove(list_queue.SelectedItem);
- if (started == true)
- initialListCount--;
}
#endregion