summaryrefslogtreecommitdiffstats
path: root/win/C#
diff options
context:
space:
mode:
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