summaryrefslogtreecommitdiffstats
path: root/win/C#
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#
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#')
-rw-r--r--win/C#/HandBrakeCS.csproj10
-rw-r--r--win/C#/frmQueue.cs89
2 files changed, 46 insertions, 53 deletions
diff --git a/win/C#/HandBrakeCS.csproj b/win/C#/HandBrakeCS.csproj
index 4c257c5b9..97918ad34 100644
--- a/win/C#/HandBrakeCS.csproj
+++ b/win/C#/HandBrakeCS.csproj
@@ -102,12 +102,6 @@
<Compile Include="Parsing\Parser.cs" />
<Compile Include="Parsing\Subtitle.cs" />
<Compile Include="Parsing\Title.cs" />
- <Compile Include="PictureController.cs">
- <SubType>Form</SubType>
- </Compile>
- <Compile Include="PictureController.Designer.cs">
- <DependentUpon>PictureController.cs</DependentUpon>
- </Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="frmAbout.resx">
@@ -130,10 +124,6 @@
<SubType>Designer</SubType>
<DependentUpon>frmQuickStart.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="PictureController.resx">
- <SubType>Designer</SubType>
- <DependentUpon>PictureController.cs</DependentUpon>
- </EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
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