OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Thu, 10 Jul 2008 15:55:37 +0000 (15:55 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Thu, 10 Jul 2008 15:55:37 +0000 (15:55 +0000)
- Activity log window code changed significantly. Now, instead of refeshing the whole log every 5 seconds, it only adds the new lines of log output.
- Fixed bugs where the autoUpdate thread could keep running after the windows had been closed, causing exceptions to occur.
- Removed some debug code from frmMain

git-svn-id: svn://localhost/HandBrake/trunk@1562 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/C#/frmActivityWindow.Designer.cs
win/C#/frmActivityWindow.cs
win/C#/frmMain.Designer.cs
win/C#/frmMain.cs

index 7191e29..865bf3c 100644 (file)
@@ -50,10 +50,9 @@ namespace Handbrake
             this.rtf_actLog.Location = new System.Drawing.Point(0, 0);\r
             this.rtf_actLog.Name = "rtf_actLog";\r
             this.rtf_actLog.ReadOnly = true;\r
-            this.rtf_actLog.Size = new System.Drawing.Size(390, 390);\r
+            this.rtf_actLog.Size = new System.Drawing.Size(441, 512);\r
             this.rtf_actLog.TabIndex = 29;\r
             this.rtf_actLog.Text = "";\r
-        \r
             // \r
             // ToolTip\r
             // \r
@@ -65,7 +64,7 @@ namespace Handbrake
             this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;\r
             this.panel1.Location = new System.Drawing.Point(0, 0);\r
             this.panel1.Name = "panel1";\r
-            this.panel1.Size = new System.Drawing.Size(390, 390);\r
+            this.panel1.Size = new System.Drawing.Size(441, 512);\r
             this.panel1.TabIndex = 95;\r
             // \r
             // frmActivityWindow\r
@@ -73,7 +72,7 @@ namespace Handbrake
             this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 13F);\r
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
             this.BackColor = System.Drawing.SystemColors.ControlLight;\r
-            this.ClientSize = new System.Drawing.Size(390, 390);\r
+            this.ClientSize = new System.Drawing.Size(441, 512);\r
             this.Controls.Add(this.panel1);\r
             this.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));\r
index 6ec70d7..e23ff0a 100644 (file)
@@ -5,7 +5,7 @@
           It may be used under the terms of the GNU General Public License. */\r
 \r
 using System;\r
-using System.Collections.Generic;\r
+using System.Collections;\r
 using System.ComponentModel;\r
 using System.Data;\r
 using System.Drawing;\r
@@ -27,6 +27,8 @@ namespace Handbrake
         String read_file;\r
         frmMain mainWindow;\r
         frmQueue queueWindow;\r
+        int position = 0;  // Position in the arraylist reached by the current log output in the rtf box.\r
+        \r
 \r
         /// <summary>\r
         /// This window should be used to display the RAW output of the handbrake CLI which is produced during an encode.\r
@@ -38,34 +40,61 @@ namespace Handbrake
 \r
             mainWindow = fm;\r
             queueWindow = fq;\r
+            read_file = file;\r
 \r
+            // Reset some varibles\r
             this.rtf_actLog.Text = string.Empty;\r
-\r
-            read_file = file;\r
+            position = 0;\r
 \r
             string logFile = Path.Combine(Path.GetTempPath(), read_file);\r
             if (File.Exists(logFile))\r
             {\r
-                if (read_file == "dvdinfo.dat") // No need to refresh the window if we are viwing dvdinfo.dat\r
-                    updateTextFromThread();\r
-                else // however, we should refresh when reading the encode log file.\r
-                {\r
-                    monitorFile = new Thread(autoUpdate);\r
-                    monitorFile.Start();\r
-                }\r
+                // Add a header to the log file indicating that it's from the Windows GUI and display the windows version\r
+                rtf_actLog.AppendText("### Windows GUI \n");\r
+                rtf_actLog.AppendText(String.Format("### Running: {0} \n###\n", Environment.OSVersion.ToString()));\r
+\r
+                // Start a new thread to run the autoUpdate process\r
+                monitorFile = new Thread(autoUpdate);\r
+                monitorFile.Start();\r
             }\r
             else\r
                 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);\r
+\r
+            // Handle the event of the window being disposed. This is needed to make sure HandBrake exit's cleanly.\r
+            this.Disposed += new EventHandler(forceQuit);\r
+        }\r
+\r
+        // Ok, so, this function is called when someone closes frmMain but didn't close frmActivitWindow first.\r
+        // When you close frmMain, the activity window gets closed (disposed of) but, this doens't kill the threads that it started.\r
+        // When that thread tries to access the disposed rich text box, it causes an exception.\r
+        // Basically, this function is called when the window is disposed of, to kill the thread and close the window properly.\r
+        // This allows HandBrake to close cleanly.\r
+        private void forceQuit(object sender, EventArgs e)\r
+        {\r
+            if (monitorFile != null)\r
+                monitorFile.Abort();\r
+\r
+            this.Close();\r
         }\r
 \r
         // Update the Activity window every 5 seconds with the latest log data.\r
         private void autoUpdate(object state)\r
         {\r
+            Boolean lastUpdate = false;\r
             updateTextFromThread();\r
             while (true)\r
-            {\r
+            {   \r
                 if ((mainWindow.isEncoding() == true) || (queueWindow.isEncoding() == true))\r
                     updateTextFromThread();\r
+                else\r
+                {\r
+                    // The encode may just have stoped, so, refresh the log one more time before restarting it.\r
+                    if (lastUpdate == false)\r
+                        updateTextFromThread();\r
+\r
+                    lastUpdate = true;\r
+                    position = 0;\r
+                }\r
                 Thread.Sleep(5000);\r
             }\r
         }\r
@@ -80,27 +109,41 @@ namespace Handbrake
                     this.BeginInvoke(new UpdateUIHandler(updateTextFromThread));\r
                     return;\r
                 }\r
-                rtf_actLog.Text = readFile();\r
-                this.rtf_actLog.SelectionStart = this.rtf_actLog.Text.Length - 1;\r
-                this.rtf_actLog.ScrollToCaret();\r
+                // Initialize a pointer and get the log data arraylist\r
+                ArrayList data = readFile();\r
+\r
+                while (position < data.Count)\r
+                {\r
+                    rtf_actLog.AppendText(data[position].ToString());\r
+                    if (data[position].ToString().Contains("has exited"))\r
+                    {\r
+                        rtf_actLog.AppendText("\n ############ End of Encode ############## \n");\r
+                    }\r
+                    position++;\r
+                }\r
+\r
+               // this.rtf_actLog.SelectionStart = this.rtf_actLog.Text.Length - 1;\r
+               // this.rtf_actLog.ScrollToCaret();\r
             }\r
             catch (Exception exc)\r
             {\r
-                MessageBox.Show(exc.ToString());\r
+                MessageBox.Show("An error has occured in: updateTextFromThread(). \n You may have to restart HandBrake. \n  Error Information: \n\n" + exc.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
             }\r
         }\r
 \r
-        private string readFile()\r
+        private ArrayList readFile()\r
         {\r
-            string log = "";\r
+            // Ok, the task here is to, Get an arraylist of log data.\r
+            // And update some global varibles which are pointers to the last displayed log line.\r
+            ArrayList logData = new ArrayList();\r
+\r
             try\r
             {\r
-                // hb_encode_log.dat is the primary log file. Since .NET can't read this file whilst the CLI is outputing to it,\r
+                // hb_encode_log.dat is the primary log file. Since .NET can't read this file whilst the CLI is outputing to it (Not even in read only mode),\r
                 // we'll need to make a copy of it.\r
                 string logFile = Path.Combine(Path.GetTempPath(), read_file);\r
                 string logFile2 = Path.Combine(Path.GetTempPath(), "hb_encode_log_AppReadable.dat");\r
 \r
-\r
                 // Make sure the application readable log file does not already exist. FileCopy fill fail if it does.\r
                 if (File.Exists(logFile2))\r
                     File.Delete(logFile2);\r
@@ -108,25 +151,30 @@ namespace Handbrake
                 // Copy the log file.\r
                 File.Copy(logFile, logFile2);\r
 \r
-                // Begin processing the log file.\r
+                // Open the copied log file for reading\r
                 StreamReader sr = new StreamReader(logFile2);\r
                 string line = sr.ReadLine();\r
                 while (line != null)\r
                 {\r
-                    log = log + (line + System.Environment.NewLine);\r
+                    if (line.Trim() != "")\r
+                        logData.Add(line + System.Environment.NewLine);\r
+\r
                     line = sr.ReadLine();\r
                 }\r
                 sr.Close();\r
                 sr.Dispose();\r
+\r
+                return logData;\r
             }\r
             catch (Exception exc)\r
             {\r
-                MessageBox.Show("An Error has occured! \n\n" + exc.ToString(), "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
+                MessageBox.Show("Error in readFile() \n Unable to read the log file.\n You may have to restart HandBrake.\n  Error Information: \n\n" + exc.ToString(), "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
             }\r
-\r
-            return log;\r
+            return null;\r
         }\r
 \r
+\r
+        // Ok, We need to make sure the monitor thread is dead when we close the window.\r
         protected override void OnClosing(CancelEventArgs e)\r
         {\r
             if (monitorFile != null)\r
index aec3f8f..b2ca129 100644 (file)
@@ -86,15 +86,21 @@ namespace Handbrake
             this.lbl_src_res = new System.Windows.Forms.Label();\r
             this.lbl_duration = new System.Windows.Forms.Label();\r
             this.label_duration = new System.Windows.Forms.Label();\r
+            this.drop_format = new System.Windows.Forms.ComboBox();\r
             this.DVD_Open = new System.Windows.Forms.FolderBrowserDialog();\r
             this.File_Open = new System.Windows.Forms.OpenFileDialog();\r
             this.ISO_Open = new System.Windows.Forms.OpenFileDialog();\r
             this.FileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
+            this.mnu_open = new System.Windows.Forms.ToolStripMenuItem();\r
             this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();\r
             this.mnu_exit = new System.Windows.Forms.ToolStripMenuItem();\r
             this.mnu_open3 = new System.Windows.Forms.ToolStripMenuItem();\r
             this.ToolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
+            this.mnu_encode = new System.Windows.Forms.ToolStripMenuItem();\r
+            this.mnu_encodeLog = new System.Windows.Forms.ToolStripMenuItem();\r
+            this.mnu_viewDVDdata = new System.Windows.Forms.ToolStripMenuItem();\r
             this.ToolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();\r
+            this.mnu_options = new System.Windows.Forms.ToolStripMenuItem();\r
             this.PresetsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
             this.mnu_presetReset = new System.Windows.Forms.ToolStripMenuItem();\r
             this.mnu_delete_preset = new System.Windows.Forms.ToolStripMenuItem();\r
@@ -116,6 +122,7 @@ namespace Handbrake
             this.Label9 = new System.Windows.Forms.Label();\r
             this.Label10 = new System.Windows.Forms.Label();\r
             this.groupBox_output = new System.Windows.Forms.GroupBox();\r
+            this.label5 = new System.Windows.Forms.Label();\r
             this.Label47 = new System.Windows.Forms.Label();\r
             this.Label3 = new System.Windows.Forms.Label();\r
             this.TabPage2 = new System.Windows.Forms.TabPage();\r
@@ -244,29 +251,22 @@ namespace Handbrake
             this.groupBox2 = new System.Windows.Forms.GroupBox();\r
             this.treeView_presets = new System.Windows.Forms.TreeView();\r
             this.toolStrip1 = new System.Windows.Forms.ToolStrip();\r
-            this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator();\r
-            this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();\r
-            this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();\r
-            this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator();\r
-            this.lbl_encode = new System.Windows.Forms.ToolStripLabel();\r
-            this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components);\r
-            this.drop_format = new System.Windows.Forms.ComboBox();\r
-            this.label5 = new System.Windows.Forms.Label();\r
             this.btn_source = new System.Windows.Forms.ToolStripDropDownButton();\r
             this.btn_file_source = new System.Windows.Forms.ToolStripMenuItem();\r
             this.btn_dvd_source = new System.Windows.Forms.ToolStripMenuItem();\r
             this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();\r
             this.mnu_dvd_drive = new System.Windows.Forms.ToolStripMenuItem();\r
+            this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator();\r
             this.btn_start = new System.Windows.Forms.ToolStripButton();\r
             this.btn_add2Queue = new System.Windows.Forms.ToolStripButton();\r
             this.btn_showQueue = new System.Windows.Forms.ToolStripButton();\r
+            this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();\r
             this.btn_ActivityWindow = new System.Windows.Forms.ToolStripButton();\r
+            this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();\r
             this.btn_minimize = new System.Windows.Forms.ToolStripButton();\r
-            this.mnu_open = new System.Windows.Forms.ToolStripMenuItem();\r
-            this.mnu_encode = new System.Windows.Forms.ToolStripMenuItem();\r
-            this.mnu_encodeLog = new System.Windows.Forms.ToolStripMenuItem();\r
-            this.mnu_viewDVDdata = new System.Windows.Forms.ToolStripMenuItem();\r
-            this.mnu_options = new System.Windows.Forms.ToolStripMenuItem();\r
+            this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator();\r
+            this.lbl_encode = new System.Windows.Forms.ToolStripLabel();\r
+            this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components);\r
             Label38 = new System.Windows.Forms.Label();\r
             notifyIconMenu = new System.Windows.Forms.ContextMenuStrip(this.components);\r
             notifyIconMenu.SuspendLayout();\r
@@ -997,6 +997,24 @@ namespace Handbrake
             this.label_duration.Text = "Duration:";\r
             this.ToolTip.SetToolTip(this.label_duration, "Top / Bottom / Left / Right");\r
             // \r
+            // drop_format\r
+            // \r
+            this.drop_format.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;\r
+            this.drop_format.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.drop_format.FormattingEnabled = true;\r
+            this.drop_format.Items.AddRange(new object[] {\r
+            "MP4 File",\r
+            "M4V File",\r
+            "MKV File",\r
+            "AVI File",\r
+            "OGM File"});\r
+            this.drop_format.Location = new System.Drawing.Point(75, 19);\r
+            this.drop_format.Name = "drop_format";\r
+            this.drop_format.Size = new System.Drawing.Size(106, 21);\r
+            this.drop_format.TabIndex = 28;\r
+            this.ToolTip.SetToolTip(this.drop_format, "Select a video encoder");\r
+            this.drop_format.SelectedIndexChanged += new System.EventHandler(this.drop_format_SelectedIndexChanged);\r
+            // \r
             // DVD_Open\r
             // \r
             this.DVD_Open.Description = "Select the \"VIDEO_TS\" folder from your DVD Drive.";\r
@@ -1024,6 +1042,16 @@ namespace Handbrake
             this.FileToolStripMenuItem.Size = new System.Drawing.Size(38, 20);\r
             this.FileToolStripMenuItem.Text = "&File";\r
             // \r
+            // mnu_open\r
+            // \r
+            this.mnu_open.Image = ((System.Drawing.Image)(resources.GetObject("mnu_open.Image")));\r
+            this.mnu_open.ImageTransparentColor = System.Drawing.Color.Magenta;\r
+            this.mnu_open.Name = "mnu_open";\r
+            this.mnu_open.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));\r
+            this.mnu_open.Size = new System.Drawing.Size(210, 22);\r
+            this.mnu_open.Text = "&Import Preset";\r
+            this.mnu_open.Click += new System.EventHandler(this.mnu_open_Click);\r
+            // \r
             // toolStripSeparator2\r
             // \r
             this.toolStripSeparator2.Name = "toolStripSeparator2";\r
@@ -1053,11 +1081,44 @@ namespace Handbrake
             this.ToolsToolStripMenuItem.Size = new System.Drawing.Size(49, 20);\r
             this.ToolsToolStripMenuItem.Text = "&Tools";\r
             // \r
+            // mnu_encode\r
+            // \r
+            this.mnu_encode.Image = global::Handbrake.Properties.Resources.Queue_Small;\r
+            this.mnu_encode.Name = "mnu_encode";\r
+            this.mnu_encode.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Q)));\r
+            this.mnu_encode.Size = new System.Drawing.Size(251, 22);\r
+            this.mnu_encode.Text = "Show Queue";\r
+            this.mnu_encode.Click += new System.EventHandler(this.mnu_encode_Click);\r
+            // \r
+            // mnu_encodeLog\r
+            // \r
+            this.mnu_encodeLog.Image = global::Handbrake.Properties.Resources.ActivityWindow_small;\r
+            this.mnu_encodeLog.Name = "mnu_encodeLog";\r
+            this.mnu_encodeLog.Size = new System.Drawing.Size(251, 22);\r
+            this.mnu_encodeLog.Text = "Activity Window (Encode log)";\r
+            this.mnu_encodeLog.Click += new System.EventHandler(this.mnu_encodeLog_Click);\r
+            // \r
+            // mnu_viewDVDdata\r
+            // \r
+            this.mnu_viewDVDdata.Image = global::Handbrake.Properties.Resources.Movies_Small;\r
+            this.mnu_viewDVDdata.Name = "mnu_viewDVDdata";\r
+            this.mnu_viewDVDdata.Size = new System.Drawing.Size(251, 22);\r
+            this.mnu_viewDVDdata.Text = "Activity Window (Scan log)";\r
+            this.mnu_viewDVDdata.Click += new System.EventHandler(this.mnu_viewDVDdata_Click);\r
+            // \r
             // ToolStripSeparator5\r
             // \r
             this.ToolStripSeparator5.Name = "ToolStripSeparator5";\r
             this.ToolStripSeparator5.Size = new System.Drawing.Size(248, 6);\r
             // \r
+            // mnu_options\r
+            // \r
+            this.mnu_options.Image = global::Handbrake.Properties.Resources.Pref_Small;\r
+            this.mnu_options.Name = "mnu_options";\r
+            this.mnu_options.Size = new System.Drawing.Size(251, 22);\r
+            this.mnu_options.Text = "Options";\r
+            this.mnu_options.Click += new System.EventHandler(this.mnu_options_Click);\r
+            // \r
             // PresetsToolStripMenuItem\r
             // \r
             this.PresetsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\r
@@ -1259,6 +1320,17 @@ namespace Handbrake
             this.groupBox_output.TabStop = false;\r
             this.groupBox_output.Text = "Output Settings (Preset: None)";\r
             // \r
+            // label5\r
+            // \r
+            this.label5.AutoSize = true;\r
+            this.label5.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.label5.ForeColor = System.Drawing.Color.Black;\r
+            this.label5.Location = new System.Drawing.Point(17, 23);\r
+            this.label5.Name = "label5";\r
+            this.label5.Size = new System.Drawing.Size(52, 13);\r
+            this.label5.TabIndex = 27;\r
+            this.label5.Text = "Format:";\r
+            // \r
             // Label47\r
             // \r
             this.Label47.AutoSize = true;\r
@@ -1636,6 +1708,7 @@ namespace Handbrake
             this.drp_track1Audio.Name = "drp_track1Audio";\r
             this.drp_track1Audio.Size = new System.Drawing.Size(194, 20);\r
             this.drp_track1Audio.TabIndex = 3;\r
+\r
             // \r
             // Label32\r
             // \r
@@ -2859,72 +2932,6 @@ namespace Handbrake
             this.toolStrip1.TabIndex = 0;\r
             this.toolStrip1.Text = "toolStrip1";\r
             // \r
-            // toolStripSeparator10\r
-            // \r
-            this.toolStripSeparator10.Name = "toolStripSeparator10";\r
-            this.toolStripSeparator10.Size = new System.Drawing.Size(6, 39);\r
-            // \r
-            // toolStripSeparator4\r
-            // \r
-            this.toolStripSeparator4.Name = "toolStripSeparator4";\r
-            this.toolStripSeparator4.Size = new System.Drawing.Size(6, 39);\r
-            // \r
-            // toolStripSeparator8\r
-            // \r
-            this.toolStripSeparator8.Name = "toolStripSeparator8";\r
-            this.toolStripSeparator8.Size = new System.Drawing.Size(6, 39);\r
-            // \r
-            // toolStripSeparator9\r
-            // \r
-            this.toolStripSeparator9.Name = "toolStripSeparator9";\r
-            this.toolStripSeparator9.Size = new System.Drawing.Size(6, 39);\r
-            // \r
-            // lbl_encode\r
-            // \r
-            this.lbl_encode.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.lbl_encode.Name = "lbl_encode";\r
-            this.lbl_encode.Size = new System.Drawing.Size(148, 36);\r
-            this.lbl_encode.Text = "Encoding: Not Started";\r
-            // \r
-            // notifyIcon\r
-            // \r
-            this.notifyIcon.BalloonTipIcon = System.Windows.Forms.ToolTipIcon.Info;\r
-            this.notifyIcon.BalloonTipText = "HandBrake Status Here";\r
-            this.notifyIcon.BalloonTipTitle = "HandBrake";\r
-            this.notifyIcon.ContextMenuStrip = notifyIconMenu;\r
-            this.notifyIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon.Icon")));\r
-            this.notifyIcon.Text = "HandBrake";\r
-            this.notifyIcon.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon_MouseDoubleClick);\r
-            // \r
-            // drop_format\r
-            // \r
-            this.drop_format.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;\r
-            this.drop_format.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.drop_format.FormattingEnabled = true;\r
-            this.drop_format.Items.AddRange(new object[] {\r
-            "MP4 File",\r
-            "M4V File",\r
-            "MKV File",\r
-            "AVI File",\r
-            "OGM File"});\r
-            this.drop_format.Location = new System.Drawing.Point(75, 19);\r
-            this.drop_format.Name = "drop_format";\r
-            this.drop_format.Size = new System.Drawing.Size(106, 21);\r
-            this.drop_format.TabIndex = 28;\r
-            this.ToolTip.SetToolTip(this.drop_format, "Select a video encoder");\r
-            this.drop_format.SelectedIndexChanged += new System.EventHandler(this.drop_format_SelectedIndexChanged);\r
-            // \r
-            // label5\r
-            // \r
-            this.label5.AutoSize = true;\r
-            this.label5.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.label5.ForeColor = System.Drawing.Color.Black;\r
-            this.label5.Location = new System.Drawing.Point(17, 23);\r
-            this.label5.Name = "label5";\r
-            this.label5.Size = new System.Drawing.Size(52, 13);\r
-            this.label5.TabIndex = 27;\r
-            this.label5.Text = "Format:";\r
-            // \r
             // btn_source\r
             // \r
             this.btn_source.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\r
@@ -2971,6 +2978,11 @@ namespace Handbrake
             this.mnu_dvd_drive.Visible = false;\r
             this.mnu_dvd_drive.Click += new System.EventHandler(this.mnu_dvd_drive_Click);\r
             // \r
+            // toolStripSeparator10\r
+            // \r
+            this.toolStripSeparator10.Name = "toolStripSeparator10";\r
+            this.toolStripSeparator10.Size = new System.Drawing.Size(6, 39);\r
+            // \r
             // btn_start\r
             // \r
             this.btn_start.Image = global::Handbrake.Properties.Resources.Play;\r
@@ -3004,6 +3016,11 @@ namespace Handbrake
             this.btn_showQueue.Text = "Show Queue";\r
             this.btn_showQueue.Click += new System.EventHandler(this.btn_showQueue_Click);\r
             // \r
+            // toolStripSeparator4\r
+            // \r
+            this.toolStripSeparator4.Name = "toolStripSeparator4";\r
+            this.toolStripSeparator4.Size = new System.Drawing.Size(6, 39);\r
+            // \r
             // btn_ActivityWindow\r
             // \r
             this.btn_ActivityWindow.Image = global::Handbrake.Properties.Resources.ActivityWindow;\r
@@ -3016,6 +3033,11 @@ namespace Handbrake
                 "ently running encode.";\r
             this.btn_ActivityWindow.Click += new System.EventHandler(this.btn_ActivityWindow_Click);\r
             // \r
+            // toolStripSeparator8\r
+            // \r
+            this.toolStripSeparator8.Name = "toolStripSeparator8";\r
+            this.toolStripSeparator8.Size = new System.Drawing.Size(6, 39);\r
+            // \r
             // btn_minimize\r
             // \r
             this.btn_minimize.Image = ((System.Drawing.Image)(resources.GetObject("btn_minimize.Image")));\r
@@ -3025,48 +3047,27 @@ namespace Handbrake
             this.btn_minimize.Text = "Minimize To Taskbar";\r
             this.btn_minimize.Click += new System.EventHandler(this.btn_minimize_Click);\r
             // \r
-            // mnu_open\r
-            // \r
-            this.mnu_open.Image = ((System.Drawing.Image)(resources.GetObject("mnu_open.Image")));\r
-            this.mnu_open.ImageTransparentColor = System.Drawing.Color.Magenta;\r
-            this.mnu_open.Name = "mnu_open";\r
-            this.mnu_open.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));\r
-            this.mnu_open.Size = new System.Drawing.Size(210, 22);\r
-            this.mnu_open.Text = "&Import Preset";\r
-            this.mnu_open.Click += new System.EventHandler(this.mnu_open_Click);\r
-            // \r
-            // mnu_encode\r
-            // \r
-            this.mnu_encode.Image = global::Handbrake.Properties.Resources.Queue_Small;\r
-            this.mnu_encode.Name = "mnu_encode";\r
-            this.mnu_encode.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Q)));\r
-            this.mnu_encode.Size = new System.Drawing.Size(251, 22);\r
-            this.mnu_encode.Text = "Show Queue";\r
-            this.mnu_encode.Click += new System.EventHandler(this.mnu_encode_Click);\r
-            // \r
-            // mnu_encodeLog\r
+            // toolStripSeparator9\r
             // \r
-            this.mnu_encodeLog.Image = global::Handbrake.Properties.Resources.ActivityWindow_small;\r
-            this.mnu_encodeLog.Name = "mnu_encodeLog";\r
-            this.mnu_encodeLog.Size = new System.Drawing.Size(251, 22);\r
-            this.mnu_encodeLog.Text = "Activity Window (Encode log)";\r
-            this.mnu_encodeLog.Click += new System.EventHandler(this.mnu_encodeLog_Click);\r
+            this.toolStripSeparator9.Name = "toolStripSeparator9";\r
+            this.toolStripSeparator9.Size = new System.Drawing.Size(6, 39);\r
             // \r
-            // mnu_viewDVDdata\r
+            // lbl_encode\r
             // \r
-            this.mnu_viewDVDdata.Image = global::Handbrake.Properties.Resources.Movies_Small;\r
-            this.mnu_viewDVDdata.Name = "mnu_viewDVDdata";\r
-            this.mnu_viewDVDdata.Size = new System.Drawing.Size(251, 22);\r
-            this.mnu_viewDVDdata.Text = "Activity Window (Scan log)";\r
-            this.mnu_viewDVDdata.Click += new System.EventHandler(this.mnu_viewDVDdata_Click);\r
+            this.lbl_encode.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.lbl_encode.Name = "lbl_encode";\r
+            this.lbl_encode.Size = new System.Drawing.Size(148, 36);\r
+            this.lbl_encode.Text = "Encoding: Not Started";\r
             // \r
-            // mnu_options\r
+            // notifyIcon\r
             // \r
-            this.mnu_options.Image = global::Handbrake.Properties.Resources.Pref_Small;\r
-            this.mnu_options.Name = "mnu_options";\r
-            this.mnu_options.Size = new System.Drawing.Size(251, 22);\r
-            this.mnu_options.Text = "Options";\r
-            this.mnu_options.Click += new System.EventHandler(this.mnu_options_Click);\r
+            this.notifyIcon.BalloonTipIcon = System.Windows.Forms.ToolTipIcon.Info;\r
+            this.notifyIcon.BalloonTipText = "HandBrake Status Here";\r
+            this.notifyIcon.BalloonTipTitle = "HandBrake";\r
+            this.notifyIcon.ContextMenuStrip = notifyIconMenu;\r
+            this.notifyIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon.Icon")));\r
+            this.notifyIcon.Text = "HandBrake";\r
+            this.notifyIcon.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon_MouseDoubleClick);\r
             // \r
             // frmMain\r
             // \r
index 70b5649..2b05d50 100644 (file)
@@ -1970,7 +1970,6 @@ namespace Handbrake
                 hbProc = cliObj.runCli(this, (string)state);\r
 \r
                 hbProc.WaitForExit();\r
-                //MessageBox.Show(hbProc.ExitCode.ToString());\r
 \r
                 setEncodeLabelFinished();\r
                 hbProc = null;\r
@@ -2045,7 +2044,6 @@ namespace Handbrake
         #endregion\r
 \r
 \r
-\r
         // This is the END of the road ------------------------------------------------------------------------------\r
     }\r
 }
\ No newline at end of file