diff options
author | sr55 <[email protected]> | 2008-05-15 23:54:19 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2008-05-15 23:54:19 +0000 |
commit | 1f91f92300597e490ce88672b1b45afeba5d0953 (patch) | |
tree | 8cf91b4c3b7523c58a0d4f3652c8dc02d7afc6f7 /win/C#/frmActivityWindow.cs | |
parent | b893b5ed7bdb357d57255492e6d73799d2229ab7 (diff) |
WinGui:
- Fixed: http://forum.handbrake.fr/posting.php?mode=reply&f=12&t=6088
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1462 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/frmActivityWindow.cs')
-rw-r--r-- | win/C#/frmActivityWindow.cs | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/win/C#/frmActivityWindow.cs b/win/C#/frmActivityWindow.cs index de67bc8ed..7c4d302c0 100644 --- a/win/C#/frmActivityWindow.cs +++ b/win/C#/frmActivityWindow.cs @@ -34,9 +34,17 @@ namespace Handbrake this.rtf_actLog.Text = string.Empty;
read_file = file;
- monitorFile = new Thread(autoUpdate);
- monitorFile.Start();
+ string logFile = Path.Combine(Path.GetTempPath(), read_file);
+ if (File.Exists(logFile))
+ {
+ monitorFile = new Thread(autoUpdate);
+ monitorFile.Start();
+ }
+ else
+ {
+ MessageBox.Show("The log file could not be found. Maybe you cleared your system's tempory folder or maybe you just havn't run an encode yet.", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ }
}
private void autoUpdate(object state)
@@ -47,7 +55,7 @@ namespace Handbrake Thread.Sleep(5000);
}
}
-
+
private delegate void UpdateUIHandler();
private void updateTextFromThread()
{
@@ -57,11 +65,11 @@ namespace Handbrake return;
}
rtf_actLog.Text = readFile();
- this.rtf_actLog.SelectionStart = this.rtf_actLog.Text.Length -1;
+ this.rtf_actLog.SelectionStart = this.rtf_actLog.Text.Length - 1;
this.rtf_actLog.ScrollToCaret();
//if (rtf_actLog.Text.Contains("HandBrake has exited."))
- //monitorFile.Abort();
+ //monitorFile.Abort();
}
private string readFile()
@@ -74,6 +82,7 @@ namespace Handbrake string logFile = Path.Combine(Path.GetTempPath(), read_file);
string logFile2 = Path.Combine(Path.GetTempPath(), "hb_encode_log_AppReadable.dat");
+
// Make sure the application readable log file does not already exist. FileCopy fill fail if it does.
if (File.Exists(logFile2))
File.Delete(logFile2);
@@ -90,6 +99,7 @@ namespace Handbrake line = sr.ReadLine();
}
sr.Close();
+
}
catch (Exception exc)
{
@@ -101,7 +111,8 @@ namespace Handbrake protected override void OnClosing(CancelEventArgs e)
{
- monitorFile.Abort();
+ if (monitorFile != null)
+ monitorFile.Abort();
e.Cancel = true;
this.Hide();
base.OnClosing(e);
|