using System.Text;\r
using System.Threading;\r
using System.Windows.Forms;\r
- using Functions;\r
\r
- using HandBrake.ApplicationServices.Services;\r
+ using HandBrake.ApplicationServices.Services.Interfaces;\r
\r
using Model;\r
using Timer = System.Threading.Timer;\r
/// <summary>\r
/// The Encode Object\r
/// </summary>\r
- private Encode encode;\r
+ private IQueue encode;\r
\r
/// <summary>\r
/// The Scan Object\r
/// </summary>\r
- private ScanService scan;\r
+ private IScan scan;\r
\r
/// <summary>\r
/// The Type of log that the window is currently dealing with\r
/// <param name="scan">\r
/// The scan.\r
/// </param>\r
- public frmActivityWindow(Encode encode, ScanService scan)\r
+ public frmActivityWindow(IQueue encode, IScan scan)\r
{\r
InitializeComponent();\r
\r
appendText.AppendFormat("Waiting for the log to be generated ...\n");\r
position = 0;\r
ClearWindowText();\r
- PrintLogHeader();\r
return appendText;\r
}\r
\r
appendText.AppendFormat("Waiting for the log to be generated ...\n");\r
position = 0;\r
ClearWindowText();\r
- PrintLogHeader();\r
return appendText;\r
}\r
\r
}\r
\r
/// <summary>\r
- /// Display the log header\r
- /// </summary>\r
- private void PrintLogHeader()\r
- {\r
- try\r
- {\r
- if (IsHandleCreated)\r
- {\r
- if (rtf_actLog.InvokeRequired)\r
- {\r
- IAsyncResult invoked = BeginInvoke(new SetTextClearCallback(PrintLogHeader));\r
- EndInvoke(invoked);\r
- }\r
- else\r
- {\r
- lock (rtf_actLog)\r
- {\r
- // Print the log header. This function will be re-implimented later. Do not delete.\r
- StringBuilder header = new StringBuilder();\r
-\r
- header.Append(String.Format("### Windows GUI {1} {0} \n", Properties.Settings.Default.hb_build, Properties.Settings.Default.hb_version));\r
- header.Append(String.Format("### Running: {0} \n###\n", Environment.OSVersion));\r
- header.Append(String.Format("### CPU: {0} \n", SystemInfo.GetCpuCount));\r
- header.Append(String.Format("### Ram: {0} MB \n", SystemInfo.TotalPhysicalMemory));\r
- header.Append(String.Format("### Screen: {0}x{1} \n", SystemInfo.ScreenBounds.Bounds.Width, SystemInfo.ScreenBounds.Bounds.Height));\r
- header.Append(String.Format("### Temp Dir: {0} \n", Path.GetTempPath()));\r
- header.Append(String.Format("### Install Dir: {0} \n", Application.StartupPath));\r
- header.Append(String.Format("### Data Dir: {0} \n", Application.UserAppDataPath));\r
- header.Append("#########################################\n\n");\r
-\r
- rtf_actLog.AppendText(header.ToString());\r
- }\r
- }\r
- }\r
- }\r
- catch (Exception)\r
- {\r
- return;\r
- }\r
- }\r
-\r
- /// <summary>\r
/// Reset Everything\r
/// </summary>\r
private void Reset()\r
windowTimer.Dispose();\r
position = 0;\r
ClearWindowText();\r
- PrintLogHeader();\r
windowTimer = new Timer(new TimerCallback(LogMonitor), null, 1000, 1000);\r
}\r
\r