diff options
author | sr55 <[email protected]> | 2008-05-17 20:20:25 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2008-05-17 20:20:25 +0000 |
commit | 20308dcd550d6bf33ae04c938a5c03da9d96cbac (patch) | |
tree | c983c900faefa74b3e2afa22c165d5347767d683 /win/C#/frmActivityWindow.cs | |
parent | 1f91f92300597e490ce88672b1b45afeba5d0953 (diff) |
WinGui:
- Changes -a auto to -a 1 (The CLI was throwing an error message with auto)
- Misc other changes and code cleanup.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1463 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/frmActivityWindow.cs')
-rw-r--r-- | win/C#/frmActivityWindow.cs | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/win/C#/frmActivityWindow.cs b/win/C#/frmActivityWindow.cs index 7c4d302c0..73abbbe77 100644 --- a/win/C#/frmActivityWindow.cs +++ b/win/C#/frmActivityWindow.cs @@ -38,15 +38,19 @@ namespace Handbrake string logFile = Path.Combine(Path.GetTempPath(), read_file);
if (File.Exists(logFile))
{
- monitorFile = new Thread(autoUpdate);
- monitorFile.Start();
+ if (read_file == "dvdinfo.dat") // No need to refresh the window if we are viwing dvdinfo.dat
+ updateTextFromThread();
+ else // however, we should refresh when reading the encode log file.
+ {
+ 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);
- }
}
+ // Update the Activity window every 5 seconds with the latest log data.
private void autoUpdate(object state)
{
while (true)
@@ -59,17 +63,21 @@ namespace Handbrake private delegate void UpdateUIHandler();
private void updateTextFromThread()
{
- if (this.InvokeRequired)
+ try
{
- this.BeginInvoke(new UpdateUIHandler(updateTextFromThread));
- return;
+ if (this.InvokeRequired)
+ {
+ this.BeginInvoke(new UpdateUIHandler(updateTextFromThread));
+ return;
+ }
+ rtf_actLog.Text = readFile();
+ this.rtf_actLog.SelectionStart = this.rtf_actLog.Text.Length - 1;
+ this.rtf_actLog.ScrollToCaret();
+ }
+ catch (Exception exc)
+ {
+ MessageBox.Show(exc.ToString());
}
- rtf_actLog.Text = readFile();
- this.rtf_actLog.SelectionStart = this.rtf_actLog.Text.Length - 1;
- this.rtf_actLog.ScrollToCaret();
-
- //if (rtf_actLog.Text.Contains("HandBrake has exited."))
- //monitorFile.Abort();
}
private string readFile()
|