summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsr55 <[email protected]>2009-11-30 20:42:13 +0000
committersr55 <[email protected]>2009-11-30 20:42:13 +0000
commitcb43d12f2dab060d0c01974277037e5086729380 (patch)
tree96f851c176c8667cf1abd9541c92eaf5ffccabcc
parent650c2c079b3252fb1da7a0eed03cb17a3601f952 (diff)
WinGui:
- ActivityWindow Make sure the correct log is selected (Last action: scan or encode) - Make closing the window more responsive. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2993 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--win/C#/frmActivityWindow.cs22
-rw-r--r--win/C#/frmMain.cs22
2 files changed, 33 insertions, 11 deletions
diff --git a/win/C#/frmActivityWindow.cs b/win/C#/frmActivityWindow.cs
index af7b62107..6b1ffee98 100644
--- a/win/C#/frmActivityWindow.cs
+++ b/win/C#/frmActivityWindow.cs
@@ -27,13 +27,17 @@ namespace Handbrake
private Thread monitor;
private Boolean kilLThread;
- public frmActivityWindow()
+ public frmActivityWindow(string mode)
{
+ if (mode == "scan")
+ SetScanMode();
+ else
+ SetEncodeMode();
+
InitializeComponent();
}
private void NewActivityWindow_Load(object sender, EventArgs e)
{
- SetScanMode();
monitor = new Thread(LogMonitor);
_position = 0;
kilLThread = false;
@@ -77,7 +81,15 @@ namespace Handbrake
break;
}
- Thread.Sleep(750);
+ try
+ {
+ Thread.Sleep(1000);
+ }
+ catch (ThreadInterruptedException)
+ {
+ // Do Nothnig.
+ }
+
}
}
private StringBuilder ReadFile(string file)
@@ -148,6 +160,9 @@ namespace Handbrake
else
rtf_actLog.AppendText(text.ToString());
}
+ } catch(ThreadInterruptedException)
+ {
+ // Do Nothing
}
catch (Exception exc)
{
@@ -301,6 +316,7 @@ namespace Handbrake
protected override void OnClosing(CancelEventArgs e)
{
kilLThread = true;
+ monitor.Interrupt();
monitor.Join();
e.Cancel = true;
this.Dispose();
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs
index 0de757e46..7be3a9ced 100644
--- a/win/C#/frmMain.cs
+++ b/win/C#/frmMain.cs
@@ -353,9 +353,7 @@ namespace Handbrake
}
private void mnu_encodeLog_Click(object sender, EventArgs e)
{
- String file = lastAction == "scan" ? "last_scan_log.txt" : "last_encode_log.txt";
-
- frmActivityWindow dvdInfoWindow = new frmActivityWindow();
+ frmActivityWindow dvdInfoWindow = new frmActivityWindow(lastAction);
dvdInfoWindow.Show();
}
private void mnu_options_Click(object sender, EventArgs e)
@@ -801,12 +799,20 @@ namespace Handbrake
private void btn_ActivityWindow_Click(object sender, EventArgs e)
{
if (ActivityWindow == null || !ActivityWindow.IsHandleCreated)
- ActivityWindow = new frmActivityWindow();
+ ActivityWindow = new frmActivityWindow(lastAction);
- if (encodeQueue.isEncoding)
- ActivityWindow.SetEncodeMode();
- else
- ActivityWindow.SetScanMode();
+ switch (lastAction)
+ {
+ case "scan":
+ ActivityWindow.SetScanMode();
+ break;
+ case "encode":
+ ActivityWindow.SetEncodeMode();
+ break;
+ default:
+ ActivityWindow.SetEncodeMode();
+ break;
+ }
ActivityWindow.Show();
ActivityWindow.Activate();