From 20eb2b695e82084bb4d659e2674be07aeaf28311 Mon Sep 17 00:00:00 2001 From: sr55 Date: Fri, 24 Aug 2007 21:10:32 +0000 Subject: [PATCH] WinGui: - Fixed View DVD Information window not loading the dvdinfo.dat file every time the window is launched. - Fixed a small file path issue with frmReadDVD git-svn-id: svn://localhost/HandBrake/trunk@865 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/C#/Properties/Settings.Designer.cs | 2 +- win/C#/Properties/Settings.settings | 2 +- win/C#/app.config | 2 +- win/C#/frmDvdInfo.Designer.cs | 1 + win/C#/frmDvdInfo.cs | 42 +++++++++++++++++++++------------- win/C#/frmMain.cs | 14 ++++++------ win/C#/frmReadDVD.cs | 6 ++--- 7 files changed, 39 insertions(+), 30 deletions(-) diff --git a/win/C#/Properties/Settings.Designer.cs b/win/C#/Properties/Settings.Designer.cs index 50df43d0..c85849e3 100644 --- a/win/C#/Properties/Settings.Designer.cs +++ b/win/C#/Properties/Settings.Designer.cs @@ -528,7 +528,7 @@ namespace Handbrake.Properties { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("0.9.1")] + [global::System.Configuration.DefaultSettingValueAttribute("0.9.0")] public string CliVersion { get { return ((string)(this["CliVersion"])); diff --git a/win/C#/Properties/Settings.settings b/win/C#/Properties/Settings.settings index f0356a9b..4c573b0e 100644 --- a/win/C#/Properties/Settings.settings +++ b/win/C#/Properties/Settings.settings @@ -129,7 +129,7 @@ - 0.9.1 + 0.9.0 \ No newline at end of file diff --git a/win/C#/app.config b/win/C#/app.config index de5b4450..cbddc2c9 100644 --- a/win/C#/app.config +++ b/win/C#/app.config @@ -131,7 +131,7 @@ - 0.9.1 + 0.9.0 diff --git a/win/C#/frmDvdInfo.Designer.cs b/win/C#/frmDvdInfo.Designer.cs index 3db856d1..6777d166 100644 --- a/win/C#/frmDvdInfo.Designer.cs +++ b/win/C#/frmDvdInfo.Designer.cs @@ -91,6 +91,7 @@ namespace Handbrake this.Name = "frmDvdInfo"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Read DVD"; + this.Load += new System.EventHandler(this.frmDvdInfo_Load); this.ResumeLayout(false); this.PerformLayout(); diff --git a/win/C#/frmDvdInfo.cs b/win/C#/frmDvdInfo.cs index 3b2cfd87..b4160200 100644 --- a/win/C#/frmDvdInfo.cs +++ b/win/C#/frmDvdInfo.cs @@ -19,7 +19,32 @@ namespace Handbrake { InitializeComponent(); this.rtf_dvdInfo.Text = string.Empty; + + } + + /*public void HandleParsedData(object Sender, string Data) + { + if (this.InvokeRequired) + { + this.BeginInvoke(new Parsing.DataReadEventHandler(HandleParsedData), new object[] { Sender, Data }); + return; + } + this.rtf_dvdInfo.AppendText(Data + System.Environment.NewLine); + }*/ + private void btn_close_Click(object sender, EventArgs e) + { + this.Hide(); + } + + private void frmDvdInfo_Load(object sender, EventArgs e) + { + this.rtf_dvdInfo.Text = string.Empty; + readFile(); + } + + private void readFile() + { try { string appPath = Application.StartupPath.ToString(); @@ -36,24 +61,9 @@ namespace Handbrake sr.Close(); } catch (Exception) - { - // Don't do anything - } - } - - /*public void HandleParsedData(object Sender, string Data) - { - if (this.InvokeRequired) { - this.BeginInvoke(new Parsing.DataReadEventHandler(HandleParsedData), new object[] { Sender, Data }); - return; + // Don't do anything } - this.rtf_dvdInfo.AppendText(Data + System.Environment.NewLine); - }*/ - - private void btn_close_Click(object sender, EventArgs e) - { - this.Hide(); } /*protected override void OnClosing(CancelEventArgs e) diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 72c87904..30360a66 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -30,7 +30,7 @@ namespace Handbrake // - Load users default settings. (if required) // - Do an update check (if required) // -------------------------------------------------------------- - private frmDvdInfo dvdInfoWindow = new frmDvdInfo(); + //private frmDvdInfo dvdInfoWindow = new frmDvdInfo(); public frmMain() { @@ -41,8 +41,8 @@ namespace Handbrake InitializeComponent(); // This is a quick Hack fix for the cross-thread problem with frmDvdIndo ************************ - dvdInfoWindow.Show(); - dvdInfoWindow.Hide(); + //dvdInfoWindow.Show(); + //dvdInfoWindow.Hide(); // ********************************************************************************************** @@ -383,8 +383,8 @@ namespace Handbrake { try { + frmDvdInfo dvdInfoWindow = new frmDvdInfo(); dvdInfoWindow.Show(); - } catch (Exception) { @@ -911,8 +911,8 @@ namespace Handbrake private void btn_Browse_Click(object sender, EventArgs e) { String filename =""; - text_source.Text = ""; - + text_source.Text = ""; + frmDvdInfo dvdInfoWindow = new frmDvdInfo(); if (RadioDVD.Checked) { DVD_Open.ShowDialog(); @@ -1229,7 +1229,7 @@ namespace Handbrake } } } - catch (Exception exc) + catch (Exception) { // No need to throw an error here. // Note on non english systems, this will throw an error because of double.Parse(lbl_Aspect.Text); not working. diff --git a/win/C#/frmReadDVD.cs b/win/C#/frmReadDVD.cs index ad555118..caef654c 100644 --- a/win/C#/frmReadDVD.cs +++ b/win/C#/frmReadDVD.cs @@ -85,9 +85,8 @@ namespace Handbrake */ try { - string appPath = Application.StartupPath.ToString(); - appPath = appPath + "\\"; - string strCmdLine = "cmd /c " + '"' + '"' + appPath + "\\hbcli.exe" + '"' + " -i" + '"' + inputFile + '"' + " -t0 >" + '"'+ appPath + "\\dvdinfo.dat" + '"' + " 2>&1" + '"'; + string appPath = Application.StartupPath.ToString()+ "\\"; + string strCmdLine = "cmd /c " + '"' + '"' + appPath + "hbcli.exe" + '"' + " -i " + '"' + inputFile + '"' + " -t0 >" + '"'+ appPath + "dvdinfo.dat" + '"' + " 2>&1" + '"'; Process hbproc = Process.Start("CMD.exe", strCmdLine); hbproc.WaitForExit(); hbproc.Dispose(); @@ -96,7 +95,6 @@ namespace Handbrake StreamReader sr = new StreamReader(appPath + "dvdinfo.dat"); thisDvd = Parsing.DVD.Parse(sr); - sr.Close(); Console.ReadLine(); -- 2.11.0