diff options
author | sr55 <[email protected]> | 2009-07-23 20:10:29 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2009-07-23 20:10:29 +0000 |
commit | c27af07ac1576c950ba8f1967ee32b9a1fcf43f1 (patch) | |
tree | 4fe1e6dad0a75031eeddb19f2f58afe4d70698d7 /win/C#/frmActivityWindow.cs | |
parent | c20851de01a73ec1148207b858d7fe79ce7c98a5 (diff) |
WinGui:
- getCliProcess(): This is now massively faster at returning the process ID of HandBrakeCLI. This means that the GUI updates it's elements far faster instead of the noticeable few seconds pause when an encode starts. This also fixes an error message that would appear if the CLI process quit before the GUI was setup.
- Code re factoring in Main.cs. Reduced the amount of code needed for a few functions.
- Combined the Encode and Queue handler. This just makes things a bit easier when other parts of the GUI need the encode process info. The new CLI handling code is not in yet.
- Added the CLI build environment to the About window
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2726 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/frmActivityWindow.cs')
-rw-r--r-- | win/C#/frmActivityWindow.cs | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/win/C#/frmActivityWindow.cs b/win/C#/frmActivityWindow.cs index c308990e0..84f9bddd5 100644 --- a/win/C#/frmActivityWindow.cs +++ b/win/C#/frmActivityWindow.cs @@ -20,7 +20,7 @@ namespace Handbrake delegate void SetTextCallback(string text);
String read_file;
Thread monitor;
- QueueHandler encodeQueue;
+ EncodeAndQueueHandler encodeQueue;
int position; // Position in the arraylist reached by the current log output in the rtf box.
string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";
private frmMain mainWin;
@@ -28,16 +28,15 @@ namespace Handbrake /// <summary>
/// This window should be used to display the RAW output of the handbrake CLI which is produced during an encode.
/// </summary>
- public frmActivityWindow(string file, QueueHandler eh, frmMain mw)
+ public frmActivityWindow(string file, EncodeAndQueueHandler eh, frmMain mw)
{
InitializeComponent();
rtf_actLog.Text = string.Empty;
encodeQueue = eh;
- read_file = file;
position = 0;
mainWin = mw;
-
+
// When the window closes, we want to abort the monitor thread.
this.Disposed += new EventHandler(forceQuit);
@@ -45,15 +44,33 @@ namespace Handbrake displayLogHeader();
if (file == "last_scan_log.txt")
- txt_log.Text = "Scan Log";
- else if (file == "last_encode_log.txt")
- txt_log.Text = "Encode Log";
+ setLogView(true);
+ else
+ setLogView(false);
// Start a new thread which will montior and keep the log window up to date if required/
startLogThread(read_file);
}
/// <summary>
+ /// Set the file which the log window is viewing.
+ /// </summary>
+ /// <param name="scan"></param>
+ public void setLogView(Boolean scan)
+ {
+ if (scan)
+ {
+ txt_log.Text = "Scan Log";
+ read_file = "last_scan_log.txt";
+ }
+ else
+ {
+ read_file = "last_encode_log.txt";
+ txt_log.Text = "Encode Log";
+ }
+ }
+
+ /// <summary>
/// Displays the Log header
/// </summary>
private void displayLogHeader()
@@ -68,7 +85,7 @@ namespace Handbrake rtf_actLog.AppendText(String.Format("### Install Dir: {0} \n", Application.StartupPath));
rtf_actLog.AppendText(String.Format("### Data Dir: {0} \n", Application.UserAppDataPath));
rtf_actLog.AppendText("#########################################\n\n");
- if (encodeQueue.IsEncoding && encodeQueue.LastEncode.Query != String.Empty)
+ if (encodeQueue.isEncoding && encodeQueue.LastEncode.Query != String.Empty)
{
rtf_actLog.AppendText("### CLI Query: " + encodeQueue.LastEncode.Query + "\n\n");
rtf_actLog.AppendText("#########################################\n\n");
@@ -114,7 +131,7 @@ namespace Handbrake updateTextFromThread();
while (true)
{
- if (encodeQueue.IsEncoding || mainWin.isScanning)
+ if (encodeQueue.isEncoding || mainWin.isScanning)
updateTextFromThread();
else
{
@@ -304,7 +321,7 @@ namespace Handbrake #endregion
#region System Information
-
+
/// <summary>
/// Returns the total physical ram in a system
|