From a0985795ca8a5f003272f713c57cd208b8097872 Mon Sep 17 00:00:00 2001 From: sr55 Date: Tue, 17 Jul 2007 20:32:06 +0000 Subject: WinGui: - Fixed resolution calculation bug. Mod16 res calculation now works. - Fixed hbproc issue when clicking encode video. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@707 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/C#/frmMain.cs | 50 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 428b1b06a..7f6ece4ea 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -14,7 +14,7 @@ namespace Handbrake { public partial class frmMain : Form { - private System.Diagnostics.Process hbProc; + private Process hbProc; private Parsing.DVD thisDVD; // -------------------------------------------------------------- @@ -604,14 +604,13 @@ namespace Handbrake } Functions.CLI process = new Functions.CLI(); - Process hbProc = process.runCli(this, query, false, false, false, false); - + hbProc = process.runCli(this, query, false, false, false, false); + ThreadPool.QueueUserWorkItem(procMonitor); } private void procMonitor(object state) { - //******* BUG HERE, hbProc is not getting passed in here. MessageBox.Show("The encode process has now started.", "Status", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); hbProc.WaitForExit(); hbProc.Close(); @@ -706,31 +705,48 @@ namespace Handbrake private void text_width_TextChanged(object sender, EventArgs e) { + try { - if (CheckPixelRatio.Checked) { + if (CheckPixelRatio.Checked) + { text_width.Text = ""; - } else { - if ((int.Parse(text_width.Text) % 16) != 0){ + } + else + { + if ((int.Parse(text_width.Text) % 16) != 0) + { text_width.BackColor = Color.LightCoral; - }else { + } + else + { text_width.BackColor = Color.LightGreen; } } - - // There is a bug here ******************************************************************* + if (lbl_Aspect.Text != "Select a Title") { - int height = int.Parse(text_width.Text) / int.Parse(lbl_Aspect.Text); - MessageBox.Show("test"); - int mod16 = height % 16; + double height = int.Parse(text_width.Text) / double.Parse(lbl_Aspect.Text); + double mod16 = height % 16; height = height - mod16; - text_height.Text = height.ToString(); + + if (text_width.Text == "") + { + text_height.Text = ""; + text_width.BackColor = Color.White; + } + else + { + text_height.Text = height.ToString(); + } } - - } catch(Exception){ - // No need to alert the user if there is a problem here. } + catch (Exception) + { + // No need to throw an error here. + } + + } private void text_height_TextChanged(object sender, EventArgs e) -- cgit v1.2.3