diff options
author | sr55 <[email protected]> | 2007-07-25 21:07:13 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2007-07-25 21:07:13 +0000 |
commit | bc4964e49d17d09be0bf2d866579becb746fb176 (patch) | |
tree | 318e8f39122522e2f9a097d8c834e3eab0880b20 /win/C#/frmReadDVD.cs | |
parent | 44d8075999306aea28744b28f25f9c32d48b8d77 (diff) |
WinGui:
- Excluded brianmario's CLI handler until it's completed.
- Enabled cancel button on frmReadDVD (yes it actually works ;))
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@735 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/frmReadDVD.cs')
-rw-r--r-- | win/C#/frmReadDVD.cs | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/win/C#/frmReadDVD.cs b/win/C#/frmReadDVD.cs index b06d1009d..0a7108893 100644 --- a/win/C#/frmReadDVD.cs +++ b/win/C#/frmReadDVD.cs @@ -20,6 +20,7 @@ namespace Handbrake private Parsing.DVD thisDvd;
private Process hbProc;
private delegate void UpdateUIHandler();
+ private int cancel = 0;
public frmReadDVD(string inputFile, frmMain parent, frmDvdInfo dvdInfoWindow)
{
@@ -32,7 +33,7 @@ namespace Handbrake private void btn_ok_Click(object sender, EventArgs e)
{
btn_ok.Enabled = false;
- //btn_skip.Visible = true;
+ btn_skip.Visible = true;
lbl_pressOk.Visible = false;
lbl_progress.Text = "0%";
lbl_progress.Visible = true;
@@ -57,26 +58,28 @@ namespace Handbrake this.Close();
}
+ Functions.CLI process = new Functions.CLI();
private void startProc(object state)
{
string query = "-i " + '"' + inputFile + '"' + " -t0";
- Functions.CLI process = new Functions.CLI();
+
hbProc = process.runCli(this, query, true, true, false, true);
Parsing.Parser readData = new Parsing.Parser(hbProc.StandardError.BaseStream);
readData.OnScanProgress += Parser_OnScanProgress;
-
-
readData.OnReadLine += dvdInfo.HandleParsedData;
readData.OnReadToEnd += dvdInfo.HandleParsedData;
- hbProc.Close();
- hbProc.Dispose();
-
+
// Setup the parser
thisDvd = Parsing.DVD.Parse(readData);
- updateUIElements();
+ if (cancel != 1)
+ {
+ updateUIElements();
+ process.killCLI();
+ process.closeCLI();
+ }
}
private void Parser_OnScanProgress(object Sender, int CurrentTitle, int TitleCount)
@@ -96,10 +99,10 @@ namespace Handbrake private void btn_skip_Click(object sender, EventArgs e)
{
- // TODO *****************************************************************
- // This needs to be implimented so that is destroys the above thread
- // closing hbcli with it.
- //***********************************************************************
+ process.killCLI();
+ this.Close();
+ cancel = 1;
+
}
}
|