OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 4 Jul 2009 14:24:59 +0000 (14:24 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 4 Jul 2009 14:24:59 +0000 (14:24 +0000)
- Update checker code cleaned up and multi-threaded. (Thanks to darkassassin )  Made some minor changes to this code to fit it in. http://forum.handbrake.fr/viewtopic.php?f=4&t=11353
- Queue window no longer takes focus on each new addition to the queue. ( Quite annoying otherwise )

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

win/C#/Controls/x264Panel.Designer.cs
win/C#/Controls/x264Panel.resx
win/C#/Functions/AppcastReader.cs
win/C#/Functions/Main.cs
win/C#/Functions/UpdateCheckInformation.cs [new file with mode: 0644]
win/C#/HandBrakeCS.csproj
win/C#/frmMain.Designer.cs
win/C#/frmMain.cs
win/C#/frmMain.resx
win/C#/frmQueue.cs
win/C#/frmUpdater.cs

index 379b3dc..2c7d6cf 100644 (file)
@@ -698,6 +698,7 @@ namespace Handbrake.Controls
             // x264Panel\r
             // \r
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;\r
+            this.BackColor = System.Drawing.Color.Transparent;\r
             this.Controls.Add(this.slider_psytrellis);\r
             this.Controls.Add(this.lbl_psytrellis);\r
             this.Controls.Add(this.lbl_psyrd);\r
index 8dca4f1..dbd32d1 100644 (file)
   <metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
     <value>17, 17</value>\r
   </metadata>\r
-  <metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
-    <value>17, 17</value>\r
-  </metadata>\r
   <data name="slider_psyrd.ToolTip" xml:space="preserve">\r
     <value>Psychovisual Rate Distortion Optimization sure is a mouthful, isn't it? Basically, it means x264 tries to retain detail, for better quality to the human eye, \r
 as opposed to trying to maximize quality the way a computer understands it, through signal-to-noise ratios that have trouble telling apart fine detail and noise.</value>\r
index 9442585..861bd0b 100644 (file)
@@ -7,6 +7,7 @@
 using System;\r
 using System.Xml;\r
 using System.Text.RegularExpressions;\r
+using System.IO;\r
 \r
 namespace Handbrake.Functions\r
 {\r
@@ -15,15 +16,15 @@ namespace Handbrake.Functions
         /// <summary>\r
         /// Get the build information from the required appcasts. Run before accessing the public vars.\r
         /// </summary>\r
-        public void getInfo()\r
+        public void getInfo(string input)\r
         {\r
             // Get the correct Appcast and set input.\r
-            XmlNode nodeItem = Properties.Settings.Default.hb_build.ToString().EndsWith("1") ? readRss(new XmlTextReader(Properties.Settings.Default.appcast_unstable)) : readRss(new XmlTextReader(Properties.Settings.Default.appcast));\r
-            string input = nodeItem.InnerXml;\r
+            XmlNode nodeItem = readRss(new XmlTextReader(new StringReader(input)));\r
+            string result = nodeItem.InnerXml;\r
 \r
             // Regular Expressions\r
-            Match ver = Regex.Match(input, @"sparkle:version=""([0-9]*)\""");\r
-            Match verShort = Regex.Match(input, @"sparkle:shortVersionString=""([0-9].[0-9].[0-9]*)\""");\r
+            Match ver = Regex.Match(result, @"sparkle:version=""([0-9]*)\""");\r
+            Match verShort = Regex.Match(result, @"sparkle:shortVersionString=""([0-9].[0-9].[0-9]*)\""");\r
 \r
             build = ver.ToString().Replace("sparkle:version=", "").Replace("\"", "");\r
             version = verShort.ToString().Replace("sparkle:shortVersionString=", "").Replace("\"", "");\r
index 04d4d16..1b223ba 100644 (file)
@@ -13,6 +13,7 @@ using System.Collections.Generic;
 using System.Xml.Serialization;\r
 using System.Threading;\r
 using Handbrake.EncodeQueue;\r
+using System.Net;\r
 \r
 namespace Handbrake.Functions\r
 {\r
@@ -189,40 +190,6 @@ namespace Handbrake.Functions
         }\r
 \r
         /// <summary>\r
-        /// Checks for updates and returns true if an update is available.\r
-        /// </summary>\r
-        /// <param name="debug">Turns on debug mode. Don't use on program startup</param>\r
-        /// <returns>Boolean True = Update available</returns>\r
-        public static Boolean updateCheck(Boolean debug)\r
-        {\r
-            try\r
-            {\r
-                AppcastReader rssRead = new AppcastReader();\r
-                rssRead.getInfo(); // Initializes the class.\r
-                string build = rssRead.build;\r
-\r
-                int latest = int.Parse(build);\r
-                int current = Properties.Settings.Default.hb_build;\r
-                int skip = Properties.Settings.Default.skipversion;\r
-\r
-                if (latest == skip)\r
-                    return false;\r
-\r
-                Properties.Settings.Default.lastUpdateCheckDate = DateTime.Now;\r
-                Properties.Settings.Default.Save();\r
-\r
-                Boolean update = (latest > current);\r
-                return update;\r
-            }\r
-            catch (Exception exc)\r
-            {\r
-                if (debug)\r
-                    MessageBox.Show("Unable to check for updates, Please try again later. \n" + exc, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
-                return false;\r
-            }\r
-        }\r
-\r
-        /// <summary>\r
         /// Get's HandBrakes version data from the CLI.\r
         /// </summary>\r
         /// <returns>Arraylist of Version Data. 0 = hb_version 1 = hb_build</returns>\r
@@ -370,5 +337,92 @@ namespace Handbrake.Functions
             }\r
         }\r
 \r
+        /// <summary>\r
+        /// Begins checking for an update to HandBrake.\r
+        /// </summary>\r
+        /// <param name="callback">The method that will be called when the check is finished.</param>\r
+        /// <param name="debug">Whether or not to execute this in debug mode.</param>\r
+        public static void BeginCheckForUpdates(AsyncCallback callback, bool debug)\r
+        {\r
+            ThreadPool.QueueUserWorkItem(new WaitCallback(delegate\r
+            {\r
+                try\r
+                {\r
+                    // Is this a stable or unstable build?\r
+                    string url = Properties.Settings.Default.hb_build.ToString().EndsWith("1") ? Properties.Settings.Default.appcast_unstable : Properties.Settings.Default.appcast;\r
+\r
+                    // Initialize variables\r
+                    WebRequest request = WebRequest.Create(url);\r
+                    WebResponse response = request.GetResponse();\r
+                    AppcastReader reader = new AppcastReader();\r
+\r
+                    // Get the data, convert it to a string, and parse it into the AppcastReader\r
+                    reader.getInfo(new StreamReader(response.GetResponseStream()).ReadToEnd());\r
+\r
+                    // Further parse the information\r
+                    string build = reader.build;\r
+\r
+                    int latest = int.Parse(build);\r
+                    int current = Properties.Settings.Default.hb_build;\r
+                    int skip = Properties.Settings.Default.skipversion;\r
+\r
+                    // If the user wanted to skip this version, don't report the update\r
+                    if (latest == skip)\r
+                    {\r
+                        UpdateCheckInformation info = new UpdateCheckInformation() { NewVersionAvailable = false, BuildInformation = null };\r
+                        callback(new UpdateCheckResult(debug, info));\r
+                        return;\r
+                    }\r
+\r
+                    // Set when the last update was\r
+                    Properties.Settings.Default.lastUpdateCheckDate = DateTime.Now;\r
+                    Properties.Settings.Default.Save();\r
+\r
+                    UpdateCheckInformation info2 = new UpdateCheckInformation() { NewVersionAvailable = latest > current, BuildInformation = reader };\r
+                    callback(new UpdateCheckResult(debug, info2));\r
+                }\r
+                catch (Exception exc)\r
+                {\r
+                    callback(new UpdateCheckResult(debug, new UpdateCheckInformation() { Error = exc }));\r
+                }\r
+            }));\r
+        }\r
+\r
+        /// <summary>\r
+        /// \r
+        /// </summary>\r
+        /// <param name="result"></param>\r
+        /// <returns></returns>\r
+        public static UpdateCheckInformation EndCheckForUpdates(IAsyncResult result)\r
+        {\r
+            UpdateCheckResult checkResult = (UpdateCheckResult)result;\r
+            return checkResult.Result;\r
+        }\r
+\r
+        /// <summary>\r
+        /// Used in EndUpdateCheck() for update checking and the IAsyncResult design pattern.\r
+        /// </summary>\r
+        private class UpdateCheckResult : IAsyncResult\r
+        {\r
+            public UpdateCheckResult(object asyncState, UpdateCheckInformation info)\r
+            {\r
+                AsyncState = asyncState;\r
+                Result = info;\r
+            }\r
+\r
+            /// <summary>\r
+            /// Gets whether the check was executed in debug mode.\r
+            /// </summary>\r
+            public object AsyncState { get; private set; }\r
+\r
+            /// <summary>\r
+            /// Gets the result of the update check.\r
+            /// </summary>\r
+            public UpdateCheckInformation Result { get; private set; }\r
+\r
+            public WaitHandle AsyncWaitHandle { get { throw new NotImplementedException(); } }\r
+            public bool CompletedSynchronously { get { throw new NotImplementedException(); } }\r
+            public bool IsCompleted { get { throw new NotImplementedException(); } }\r
+        }\r
     }\r
 }\r
diff --git a/win/C#/Functions/UpdateCheckInformation.cs b/win/C#/Functions/UpdateCheckInformation.cs
new file mode 100644 (file)
index 0000000..2538178
--- /dev/null
@@ -0,0 +1,23 @@
+using System;\r
+\r
+namespace Handbrake.Functions\r
+{\r
+    /// <summary>\r
+    /// Provides information about an update check.\r
+    /// </summary>\r
+    public struct UpdateCheckInformation\r
+    {\r
+        public bool NewVersionAvailable { get; set; }\r
+        public bool ErrorOccured { get { return Error != null; } }\r
+\r
+        /// <summary>\r
+        /// Gets information about the new build, if any. This will be null if there is no new verison.\r
+        /// </summary>\r
+        public AppcastReader BuildInformation { get; set; }\r
+\r
+        /// <summary>\r
+        /// Gets the error that occurred, if any. This will be null if no error occured.\r
+        /// </summary>\r
+        public Exception Error { get; set; }\r
+    }\r
+}\r
index 824d970..76666f2 100644 (file)
     <Compile Include="Functions\PresetLoader.cs" />\r
     <Compile Include="Functions\QueryGenerator.cs" />\r
     <Compile Include="Functions\Main.cs" />\r
+    <Compile Include="Functions\UpdateCheckInformation.cs" />\r
     <Compile Include="Functions\Win32.cs" />\r
     <Compile Include="Presets\preset.cs" />\r
     <Compile Include="Presets\PresetsHandler.cs" />\r
index 8375119..d7b522e 100644 (file)
@@ -158,6 +158,7 @@ namespace Handbrake
             this.lbl_source = new System.Windows.Forms.Label();\r
             this.label4 = new System.Windows.Forms.Label();\r
             this.groupBox_output = new System.Windows.Forms.Label();\r
+            this.lbl_updateCheck = new System.Windows.Forms.ToolStripStatusLabel();\r
             this.PictureSettings = new Handbrake.Controls.PictureSettings();\r
             this.Filters = new Handbrake.Controls.Filters();\r
             this.AudioSettings = new Handbrake.Controls.AudioPanel();\r
@@ -793,6 +794,7 @@ namespace Handbrake
             // Label47\r
             // \r
             this.Label47.AutoSize = true;\r
+            this.Label47.BackColor = System.Drawing.Color.Transparent;\r
             this.Label47.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.Label47.ForeColor = System.Drawing.Color.Black;\r
             this.Label47.Location = new System.Drawing.Point(13, 39);\r
@@ -859,17 +861,19 @@ namespace Handbrake
             // radio_cq\r
             // \r
             this.radio_cq.AutoSize = true;\r
+            this.radio_cq.BackColor = System.Drawing.Color.Transparent;\r
             this.radio_cq.Location = new System.Drawing.Point(336, 97);\r
             this.radio_cq.Name = "radio_cq";\r
             this.radio_cq.Size = new System.Drawing.Size(125, 17);\r
             this.radio_cq.TabIndex = 18;\r
             this.radio_cq.Text = "Constant Quality:";\r
-            this.radio_cq.UseVisualStyleBackColor = true;\r
+            this.radio_cq.UseVisualStyleBackColor = false;\r
             this.radio_cq.CheckedChanged += new System.EventHandler(this.radio_cq_CheckedChanged);\r
             // \r
             // radio_avgBitrate\r
             // \r
             this.radio_avgBitrate.AutoSize = true;\r
+            this.radio_avgBitrate.BackColor = System.Drawing.Color.Transparent;\r
             this.radio_avgBitrate.Checked = true;\r
             this.radio_avgBitrate.Location = new System.Drawing.Point(336, 64);\r
             this.radio_avgBitrate.Name = "radio_avgBitrate";\r
@@ -877,18 +881,19 @@ namespace Handbrake
             this.radio_avgBitrate.TabIndex = 17;\r
             this.radio_avgBitrate.TabStop = true;\r
             this.radio_avgBitrate.Text = "Avg Bitrate (kbps):";\r
-            this.radio_avgBitrate.UseVisualStyleBackColor = true;\r
+            this.radio_avgBitrate.UseVisualStyleBackColor = false;\r
             this.radio_avgBitrate.CheckedChanged += new System.EventHandler(this.radio_avgBitrate_CheckedChanged);\r
             // \r
             // radio_targetFilesize\r
             // \r
             this.radio_targetFilesize.AutoSize = true;\r
+            this.radio_targetFilesize.BackColor = System.Drawing.Color.Transparent;\r
             this.radio_targetFilesize.Location = new System.Drawing.Point(336, 37);\r
             this.radio_targetFilesize.Name = "radio_targetFilesize";\r
             this.radio_targetFilesize.Size = new System.Drawing.Size(126, 17);\r
             this.radio_targetFilesize.TabIndex = 16;\r
             this.radio_targetFilesize.Text = "Target Size (MB):";\r
-            this.radio_targetFilesize.UseVisualStyleBackColor = true;\r
+            this.radio_targetFilesize.UseVisualStyleBackColor = false;\r
             this.radio_targetFilesize.CheckedChanged += new System.EventHandler(this.radio_targetFilesize_CheckedChanged);\r
             // \r
             // label25\r
@@ -1370,10 +1375,12 @@ namespace Handbrake
             // StatusStrip\r
             // \r
             this.StatusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\r
-            this.lbl_encode});\r
+            this.lbl_encode,\r
+            this.lbl_updateCheck});\r
             this.StatusStrip.Location = new System.Drawing.Point(0, 599);\r
             this.StatusStrip.Name = "StatusStrip";\r
             this.StatusStrip.Size = new System.Drawing.Size(1000, 22);\r
+            this.StatusStrip.SizingGrip = false;\r
             this.StatusStrip.TabIndex = 7;\r
             this.StatusStrip.Text = "statusStrip1";\r
             // \r
@@ -1434,6 +1441,16 @@ namespace Handbrake
             this.groupBox_output.TabIndex = 47;\r
             this.groupBox_output.Text = "Output Settings: (Preset: None)";\r
             // \r
+            // lbl_updateCheck\r
+            // \r
+            this.lbl_updateCheck.BackColor = System.Drawing.Color.Transparent;\r
+            this.lbl_updateCheck.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;\r
+            this.lbl_updateCheck.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.lbl_updateCheck.Name = "lbl_updateCheck";\r
+            this.lbl_updateCheck.Size = new System.Drawing.Size(139, 17);\r
+            this.lbl_updateCheck.Text = "Checking for Updates ...";\r
+            this.lbl_updateCheck.Visible = false;\r
+            // \r
             // PictureSettings\r
             // \r
             this.PictureSettings.BackColor = System.Drawing.Color.Transparent;\r
@@ -1468,6 +1485,7 @@ namespace Handbrake
             // \r
             // x264Panel\r
             // \r
+            this.x264Panel.BackColor = System.Drawing.Color.Transparent;\r
             this.x264Panel.Location = new System.Drawing.Point(0, 0);\r
             this.x264Panel.Name = "x264Panel";\r
             this.x264Panel.Size = new System.Drawing.Size(720, 306);\r
@@ -1509,7 +1527,9 @@ namespace Handbrake
             this.Controls.Add(this.frmMainMenu);\r
             this.Controls.Add(this.StatusStrip);\r
             this.DoubleBuffered = true;\r
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;\r
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));\r
+            this.MaximizeBox = false;\r
             this.Name = "frmMain";\r
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;\r
             this.Text = "HandBrake";\r
@@ -1668,6 +1688,7 @@ namespace Handbrake
         internal Label lbl_source;\r
         private Label label4;\r
         internal Label groupBox_output;\r
+        private ToolStripStatusLabel lbl_updateCheck;\r
 \r
  \r
     }\r
index cf919ab..5da52c6 100644 (file)
@@ -36,7 +36,6 @@ namespace Handbrake
 \r
         // Delegates **********************************************************\r
         private delegate void UpdateWindowHandler();\r
-        private delegate void UpdateStatusChanger();\r
 \r
         // Applicaiton Startup ************************************************\r
 \r
@@ -72,8 +71,7 @@ namespace Handbrake
                     lblStatus.Text = "Checking for updates ...";\r
                     Application.DoEvents();\r
 \r
-                    Thread updateCheckThread = new Thread(startupUpdateCheck);\r
-                    updateCheckThread.Start();\r
+                    Main.BeginCheckForUpdates(new AsyncCallback(UpdateCheckDone), false);\r
                 }\r
             }\r
 \r
@@ -131,29 +129,34 @@ namespace Handbrake
             queueRecovery();\r
         }\r
 \r
-        // Startup Functions   \r
-        private void startupUpdateCheck()\r
+        private void UpdateCheckDone(IAsyncResult result)\r
         {\r
+            if (InvokeRequired)\r
+            {\r
+                Invoke(new MethodInvoker(() => UpdateCheckDone(result)));\r
+                return;\r
+            }\r
+\r
+            UpdateCheckInformation info;\r
+\r
             try\r
             {\r
-                if (InvokeRequired)\r
-                {\r
-                    BeginInvoke(new UpdateStatusChanger(startupUpdateCheck));\r
-                    return;\r
-                }\r
+                info = Main.EndCheckForUpdates(result);\r
 \r
-                Boolean update = Main.updateCheck(false);\r
-                if (update)\r
+                if (info.NewVersionAvailable)\r
                 {\r
-                    frmUpdater updateWindow = new frmUpdater();\r
-                    updateWindow.Show();\r
+                    frmUpdater updateWindow = new frmUpdater(info.BuildInformation);\r
+                    updateWindow.ShowDialog();\r
                 }\r
             }\r
-            catch (Exception exc)\r
+            catch (Exception ex)\r
             {\r
-                MessageBox.Show(splash, "Unable to perform update check. If this problem persists, you can turn of update checking in the program options. \nError Information: \n\n" + exc, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
+                if ((bool)result.AsyncState)\r
+                    MessageBox.Show("Unable to check for updates, Please try again later. \n" + ex, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
             }\r
         }\r
+\r
+        // Startup Functions   \r
         private void queueRecovery()\r
         {\r
             if (Main.check_queue_recovery())\r
@@ -393,19 +396,46 @@ namespace Handbrake
         }\r
         private void mnu_UpdateCheck_Click(object sender, EventArgs e)\r
         {\r
-            Boolean update = Main.updateCheck(true);\r
-            if (update)\r
+            Main.BeginCheckForUpdates(new AsyncCallback(updateCheckDoneMenu), false);\r
+        }\r
+        private void updateCheckDoneMenu(IAsyncResult result)\r
+        {\r
+            // Make sure it's running on the calling thread\r
+            if (InvokeRequired)\r
             {\r
-                frmUpdater updateWindow = new frmUpdater();\r
-                updateWindow.Show();\r
+                Invoke(new MethodInvoker(() => updateCheckDoneMenu(result)));\r
+                return;\r
+            }\r
+\r
+            UpdateCheckInformation info;\r
+\r
+            try\r
+            {\r
+                // Get the information about the new build, if any, and close the window\r
+                info = Main.EndCheckForUpdates(result);\r
+                lbl_updateCheck.Visible = true;\r
+                if (info.NewVersionAvailable && info.BuildInformation != null)\r
+                {\r
+                    frmUpdater updateWindow = new frmUpdater(info.BuildInformation);\r
+                    updateWindow.ShowDialog();\r
+                }\r
+                else\r
+                    MessageBox.Show("There are no new updates at this time.", "Update Check", MessageBoxButtons.OK, MessageBoxIcon.Information);\r
+                lbl_updateCheck.Visible = false;\r
+                return;\r
+            }\r
+            catch (Exception ex)\r
+            {\r
+                if ((bool)result.AsyncState)\r
+                    MessageBox.Show("Unable to check for updates, Please try again later. \n" + ex, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
             }\r
-            else\r
-                MessageBox.Show("There are no new updates at this time.", "Update Check", MessageBoxButtons.OK, MessageBoxIcon.Information);\r
         }\r
         private void mnu_about_Click(object sender, EventArgs e)\r
         {\r
-            Form About = new frmAbout();\r
-            About.ShowDialog();\r
+            using (frmAbout About = new frmAbout())\r
+            {\r
+                About.ShowDialog();\r
+            }\r
         }\r
         #endregion\r
 \r
index 400badb..ffd42be 100644 (file)
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
   </resheader>\r
   <metadata name="notifyIconMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
-    <value>977, 15</value>\r
+    <value>17, 54</value>\r
   </metadata>\r
   <metadata name="notifyIconMenu.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
     <value>False</value>\r
@@ -157,10 +157,10 @@ Note: Do not change any of the chapter numbers!</value>
     <value>106, 15</value>\r
   </metadata>\r
   <metadata name="AudioMenuRowHeightHack.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
-    <value>123, 52</value>\r
+    <value>392, 54</value>\r
   </metadata>\r
   <metadata name="presets_menu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
-    <value>1224, 15</value>\r
+    <value>265, 54</value>\r
   </metadata>\r
   <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
     <value>767, 15</value>\r
@@ -566,10 +566,10 @@ Note: Do not change any of the chapter numbers!</value>
 </value>\r
   </data>\r
   <metadata name="StatusStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
-    <value>1113, 15</value>\r
+    <value>155, 54</value>\r
   </metadata>\r
   <metadata name="hbproc.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
-    <value>308, 52</value>\r
+    <value>595, 54</value>\r
   </metadata>\r
   <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
     <value>98</value>\r
index 13c0e1f..c7b280e 100644 (file)
@@ -22,21 +22,21 @@ namespace Handbrake
             InitializeComponent();\r
 \r
             this.queue = q;\r
-            queue.OnEncodeStart += new EventHandler(queue_OnEncodeStart);\r
-            queue.OnQueueFinished += new EventHandler(queue_OnQueueFinished);\r
-            queue.OnPaused += new EventHandler(queue_OnPaused);\r
+            queue.OnEncodeStart += new EventHandler(queueOnEncodeStart);\r
+            queue.OnQueueFinished += new EventHandler(queueOnQueueFinished);\r
+            queue.OnPaused += new EventHandler(queueOnPaused);\r
         }\r
-        void queue_OnPaused(object sender, EventArgs e)\r
+        void queueOnPaused(object sender, EventArgs e)\r
         {\r
             setUIEncodeFinished();\r
             updateUIElements();\r
         }\r
-        void queue_OnQueueFinished(object sender, EventArgs e)\r
+        void queueOnQueueFinished(object sender, EventArgs e)\r
         {\r
             setUIEncodeFinished();\r
             resetQueue(); // Reset the Queue Window\r
         }\r
-        void queue_OnEncodeStart(object sender, EventArgs e)\r
+        void queueOnEncodeStart(object sender, EventArgs e)\r
         {\r
             setUIEncodeStarted(); // make sure the UI is set correctly\r
             setCurrentEncodeInformation();\r
@@ -56,7 +56,7 @@ namespace Handbrake
         /// </summary>\r
         public new void Show()\r
         {\r
-            Show(true);\r
+           Show(true);\r
         }\r
 \r
         /// <summary>\r
@@ -67,7 +67,8 @@ namespace Handbrake
         {\r
             if (doSetQueue) setQueue();\r
             base.Show();\r
-            Activate();\r
+\r
+            //Activate();\r
         }\r
 \r
         // Start and Stop Controls\r
index 97a5c9a..789a620 100644 (file)
@@ -12,12 +12,12 @@ namespace Handbrake
 {\r
     public partial class frmUpdater : Form\r
     {\r
-        AppcastReader appcast = new AppcastReader();\r
-        public frmUpdater()\r
+        AppcastReader appcast;\r
+        public frmUpdater(AppcastReader reader)\r
         {\r
             InitializeComponent();\r
 \r
-            appcast.getInfo(); // Initializes the appcast\r
+            appcast = reader;\r
             getRss();\r
             setVersions();\r
         }\r
@@ -37,7 +37,7 @@ namespace Handbrake
         private void btn_installUpdate_Click(object sender, EventArgs e)\r
         {\r
             frmDownload download = new frmDownload(appcast.downloadFile);\r
-            download.Show();\r
+            download.ShowDialog();\r
             this.Close();\r
         }\r
 \r