diff options
author | sr55 <[email protected]> | 2008-05-07 21:56:43 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2008-05-07 21:56:43 +0000 |
commit | 7b26952e91f56c839fc2bd2f668d59f9ae0a55c1 (patch) | |
tree | 37566d8dd0f471bd9fa1b04f48e2598083654f9a /win/C#/frmActivityWindow.cs | |
parent | c99236b3cd8fff2b67e93fb8a8c3a8f76dca223a (diff) |
WinGui:
- Activity window no longer prevents main window UI interaction.
- Fixed bug which would keep HandBrake in memory after the program was closed. It was still running but not visible.
- Removed old files
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1455 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/frmActivityWindow.cs')
-rw-r--r-- | win/C#/frmActivityWindow.cs | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/win/C#/frmActivityWindow.cs b/win/C#/frmActivityWindow.cs index ebee0ea42..de67bc8ed 100644 --- a/win/C#/frmActivityWindow.cs +++ b/win/C#/frmActivityWindow.cs @@ -13,6 +13,9 @@ using System.Text; using System.Windows.Forms;
using System.IO;
using System.Threading;
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+
namespace Handbrake
@@ -29,17 +32,11 @@ namespace Handbrake {
InitializeComponent();
this.rtf_actLog.Text = string.Empty;
- monitorFile = new Thread(autoUpdate);
- read_file = file;
- }
-
- private void frmActivityWindow_Load(object sender, EventArgs e)
- {
- this.rtf_actLog.Text = string.Empty;
- rtf_actLog.Text = readFile();
-
+ read_file = file;
+ monitorFile = new Thread(autoUpdate);
monitorFile.Start();
+
}
private void autoUpdate(object state)
@@ -47,7 +44,7 @@ namespace Handbrake while (true)
{
updateTextFromThread();
- Thread.Sleep(3000);
+ Thread.Sleep(5000);
}
}
@@ -63,8 +60,8 @@ namespace Handbrake this.rtf_actLog.SelectionStart = this.rtf_actLog.Text.Length -1;
this.rtf_actLog.ScrollToCaret();
- if (rtf_actLog.Text.Contains("HandBrake has exited."))
- monitorFile.Abort();
+ //if (rtf_actLog.Text.Contains("HandBrake has exited."))
+ //monitorFile.Abort();
}
private string readFile()
@@ -101,5 +98,13 @@ namespace Handbrake return log;
}
+
+ protected override void OnClosing(CancelEventArgs e)
+ {
+ monitorFile.Abort();
+ e.Cancel = true;
+ this.Hide();
+ base.OnClosing(e);
+ }
}
}
\ No newline at end of file |