OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 28 Sep 2008 18:19:47 +0000 (18:19 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 28 Sep 2008 18:19:47 +0000 (18:19 +0000)
- AppcastReader.cs re-factored. Reduces number of connections to the server.
- Few UI tweaks to the updater / downloader

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

12 files changed:
win/C#/Functions/AppcastReader.cs
win/C#/Functions/Common.cs
win/C#/HandBrakeCS.csproj
win/C#/Properties/Resources.resx
win/C#/Properties/Settings.Designer.cs
win/C#/Properties/Settings.settings
win/C#/app.config
win/C#/frmDownload.Designer.cs
win/C#/frmDownload.cs
win/C#/frmMain.cs
win/C#/frmUpdater.Designer.cs
win/C#/frmUpdater.cs

index 6e9d97e..dfe96eb 100644 (file)
@@ -6,30 +6,80 @@
 \r
 using System;\r
 using System.Collections.Generic;\r
-using System.ComponentModel;\r
-using System.Data;\r
-using System.Drawing;\r
-using System.Text;\r
-using System.Windows.Forms;\r
 using System.IO;\r
 using System.Xml;\r
 using System.Text.RegularExpressions;\r
 \r
 namespace Handbrake.Functions\r
 {\r
-    class AppcastReader\r
+    public class AppcastReader\r
     {\r
-        XmlTextReader rssReader;\r
         XmlDocument rssDoc;\r
         XmlNode nodeRss;\r
         XmlNode nodeChannel;\r
         XmlNode nodeItem;\r
-        private string hb_versionInfo;\r
+        private string hb_description;\r
         private string hb_version;\r
         private string hb_build;\r
         private string hb_file;\r
 \r
-        // Rss Reading Code.\r
+        /// <summary>\r
+        /// Get the build information from the required appcasts.\r
+        /// This must be run before calling any of the public return functions.\r
+        /// </summary>\r
+        public void getInfo()\r
+        {\r
+            Match ver;\r
+            int stable_build, unstable_build = 0;\r
+            string input, unstable_description = "", stable_description, unstable_version = "", stable_version;\r
+            string stable_file, unstable_file = "";\r
+\r
+            // Check the stable appcast and get the stable build number\r
+            readRss(new XmlTextReader(Properties.Settings.Default.appcast));\r
+            input = nodeItem.InnerXml;\r
+            ver = Regex.Match(input, @"sparkle:version=""([0-9]*)\""");\r
+            stable_build = int.Parse(ver.ToString().Replace("sparkle:version=", "").Replace("\"", ""));\r
+            ver = Regex.Match(input, @"sparkle:shortVersionString=""([0-9].[0-9].[0-9]*)\""");\r
+            stable_version = ver.ToString().Replace("sparkle:shortVersionString=", "").Replace("\"", "");\r
+            stable_description = nodeItem["description"].InnerText;\r
+            stable_file = nodeItem["windows"].InnerText;\r
+\r
+            // If this is a snapshot release, or the user wants to check for snapshot releases\r
+            if (Properties.Settings.Default.checkSnapshot == "Checked" || Properties.Settings.Default.hb_build.ToString().EndsWith("1"))\r
+            {\r
+                // Get the stable build\r
+                readRss(new XmlTextReader(Properties.Settings.Default.appcast_unstable));\r
+                input = nodeItem.InnerXml;\r
+                ver = Regex.Match(input, @"sparkle:version=""([0-9]*)\""");\r
+                unstable_build = int.Parse(ver.ToString().Replace("sparkle:version=", "").Replace("\"", ""));\r
+                ver = Regex.Match(input, @"sparkle:shortVersionString=""([0-9a-zA-Z.]*)\""");\r
+                unstable_version = ver.ToString().Replace("sparkle:shortVersionString=", "").Replace("\"", "");\r
+                unstable_description = nodeItem["description"].InnerText;\r
+                unstable_file = nodeItem["windows"].InnerText;\r
+            }\r
+\r
+\r
+            // Set the global version information\r
+            if (stable_build >= unstable_build)\r
+            {\r
+                hb_description = stable_description;\r
+                hb_version = stable_version;\r
+                hb_build = stable_build.ToString();\r
+                hb_file = stable_file;\r
+            }\r
+            else\r
+            {\r
+                hb_description = unstable_description;\r
+                hb_version = unstable_version;\r
+                hb_build = unstable_build.ToString();\r
+                hb_file = unstable_file;\r
+            }\r
+        }\r
+\r
+        /// <summary>\r
+        /// Read the RSS file.\r
+        /// </summary>\r
+        /// <param name="rssReader"></param>\r
         private void readRss(XmlTextReader rssReader)\r
         {\r
             rssDoc = new XmlDocument();\r
@@ -54,62 +104,13 @@ namespace Handbrake.Functions
             }\r
         }\r
 \r
-\r
-        // Get's the information required out the RSS file.\r
-        private void getInfo()\r
-        {\r
-            Match ver;\r
-            int unstable_build = 0;\r
-            string input;\r
-\r
-            // Check the stable appcast and get the build nuber\r
-            rssReader = new XmlTextReader(Properties.Settings.Default.appcast);\r
-            readRss(rssReader);\r
-            input = nodeItem.InnerXml;\r
-            ver = Regex.Match(input, @"sparkle:version=""([0-9]*)\""");\r
-            int stable_build = int.Parse(ver.ToString().Replace("sparkle:version=", "").Replace("\"", ""));\r
-\r
-            // If the pref to enable unstable appcast checking is enabled    OR\r
-            // this is a snapshot release, \r
-            // then check the unstable appcast.\r
-            if (Properties.Settings.Default.checkSnapshot == "Checked" || Properties.Settings.Default.hb_build.ToString().EndsWith("1"))\r
-            {\r
-                // Get the stable build\r
-                rssReader = new XmlTextReader(Properties.Settings.Default.appcast_unstable);\r
-                readRss(rssReader);\r
-                input = nodeItem.InnerXml;\r
-                ver = Regex.Match(input, @"sparkle:version=""([0-9]*)\""");\r
-                unstable_build = int.Parse(ver.ToString().Replace("sparkle:version=", "").Replace("\"", ""));\r
-            }\r
-\r
-            if (stable_build >= unstable_build)\r
-                rssReader = new XmlTextReader(Properties.Settings.Default.appcast);\r
-            else\r
-                rssReader = new XmlTextReader(Properties.Settings.Default.appcast_unstable);\r
-\r
-            // Get the Version Information\r
-            hb_versionInfo = nodeItem["description"].InnerText;\r
-\r
-            // Get the version\r
-            string inputNode = nodeItem.InnerXml;\r
-            ver = Regex.Match(inputNode, @"sparkle:shortVersionString=""([0-9].[0-9].[0-9]*)\""");\r
-            hb_version = ver.ToString().Replace("sparkle:shortVersionString=", "").Replace("\"", "");\r
-\r
-            ver = Regex.Match(inputNode, @"sparkle:version=""([0-9]*)\""");\r
-            hb_build = ver.ToString().Replace("sparkle:version=", "").Replace("\"", "");\r
-\r
-            // Get the update file\r
-            hb_file = nodeItem["windows"].InnerText;\r
-        }\r
-\r
         /// <summary>\r
         /// Get Information about an update to HandBrake\r
         /// </summary>\r
         /// <returns></returns>\r
         public string versionInfo()\r
         {\r
-            getInfo();\r
-            return hb_versionInfo;\r
+            return hb_description;\r
         }\r
 \r
         /// <summary>\r
@@ -118,7 +119,6 @@ namespace Handbrake.Functions
         /// <returns></returns>\r
         public string version()\r
         {\r
-            getInfo();\r
             return hb_version;\r
         }\r
 \r
@@ -128,7 +128,6 @@ namespace Handbrake.Functions
         /// <returns></returns>\r
         public string build()\r
         {\r
-            getInfo();\r
             return hb_build;\r
         }\r
 \r
@@ -138,7 +137,6 @@ namespace Handbrake.Functions
         /// <returns></returns>\r
         public string downloadFile()\r
         {\r
-            getInfo();\r
             return hb_file;\r
         }\r
     }\r
index 708a716..48c131e 100644 (file)
@@ -1172,6 +1172,7 @@ namespace Handbrake.Functions
             try\r
             {\r
                 Functions.AppcastReader rssRead = new Functions.AppcastReader();\r
+                rssRead.getInfo(); // Initializes the class.\r
                 string build = rssRead.build();\r
 \r
                 int latest = int.Parse(build);\r
index 801635c..ce04fa1 100644 (file)
@@ -34,6 +34,7 @@
     <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\r
     <UseApplicationTrust>false</UseApplicationTrust>\r
     <BootstrapperEnabled>true</BootstrapperEnabled>\r
+    <SignManifests>false</SignManifests>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
@@ -50,7 +51,7 @@
     </DocumentationFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
-    <DebugType>full</DebugType>\r
+    <DebugType>pdbonly</DebugType>\r
     <Optimize>true</Optimize>\r
     <OutputPath>bin\Release\</OutputPath>\r
     <DefineConstants>DEBUG;TRACE</DefineConstants>\r
@@ -63,6 +64,8 @@
     <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>\r
     <NoStdLib>false</NoStdLib>\r
     <DebugSymbols>true</DebugSymbols>\r
+    <FileAlignment>512</FileAlignment>\r
+    <PlatformTarget>AnyCPU</PlatformTarget>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">\r
     <PlatformTarget>x86</PlatformTarget>\r
index c2b7495..c4f88cf 100644 (file)
   <data name="General_Preferences" type="System.Resources.ResXFileRef, System.Windows.Forms">\r
     <value>..\Resources\General Preferences.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\r
   </data>\r
-  <data name="Queue" type="System.Resources.ResXFileRef, System.Windows.Forms">\r
-    <value>..\Resources\Queue.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\r
-  </data>\r
   <data name="Pref_Small" type="System.Resources.ResXFileRef, System.Windows.Forms">\r
     <value>..\Resources\Pref_Small.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\r
   </data>\r
   <data name="save" type="System.Resources.ResXFileRef, System.Windows.Forms">\r
     <value>..\Resources\save.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\r
   </data>\r
+  <data name="Queue" type="System.Resources.ResXFileRef, System.Windows.Forms">\r
+    <value>..\Resources\Queue.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\r
+  </data>\r
 </root>
\ No newline at end of file
index f1ce04b..63a2b07 100644 (file)
@@ -181,7 +181,7 @@ namespace Handbrake.Properties {
         \r
         [global::System.Configuration.UserScopedSettingAttribute()]\r
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\r
-        [global::System.Configuration.DefaultSettingValueAttribute("http://handbrake.fr/appcast_unstable.xml")]\r
+        [global::System.Configuration.DefaultSettingValueAttribute("http://handbrake.fr/appcast_test.xml")]\r
         public string appcast_unstable {\r
             get {\r
                 return ((string)(this["appcast_unstable"]));\r
index 6069416..a47faee 100644 (file)
@@ -42,7 +42,7 @@
       <Value Profile="(Default)">http://handbrake.fr/appcast.xml</Value>\r
     </Setting>\r
     <Setting Name="appcast_unstable" Type="System.String" Scope="User">\r
-      <Value Profile="(Default)">http://handbrake.fr/appcast_unstable.xml</Value>\r
+      <Value Profile="(Default)">http://handbrake.fr/appcast_test.xml</Value>\r
     </Setting>\r
     <Setting Name="drive_detection" Type="System.String" Scope="User">\r
       <Value Profile="(Default)">Checked</Value>\r
index ce66d92..479fe27 100644 (file)
@@ -47,7 +47,7 @@
                 <value>http://handbrake.fr/appcast.xml</value>\r
             </setting>\r
             <setting name="appcast_unstable" serializeAs="String">\r
-                <value>http://handbrake.fr/appcast_unstable.xml</value>\r
+                <value>http://handbrake.fr/appcast_test.xml</value>\r
             </setting>\r
             <setting name="drive_detection" serializeAs="String">\r
                 <value>Checked</value>\r
index 48ba083..5d0f452 100644 (file)
@@ -46,7 +46,7 @@ namespace Handbrake
             // \r
             this.lblProgress.AutoSize = true;\r
             this.lblProgress.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.lblProgress.Location = new System.Drawing.Point(90, 54);\r
+            this.lblProgress.Location = new System.Drawing.Point(93, 38);\r
             this.lblProgress.Name = "lblProgress";\r
             this.lblProgress.Size = new System.Drawing.Size(115, 13);\r
             this.lblProgress.TabIndex = 10;\r
@@ -54,7 +54,7 @@ namespace Handbrake
             // \r
             // progress_download\r
             // \r
-            this.progress_download.Location = new System.Drawing.Point(93, 28);\r
+            this.progress_download.Location = new System.Drawing.Point(93, 12);\r
             this.progress_download.Name = "progress_download";\r
             this.progress_download.Size = new System.Drawing.Size(318, 23);\r
             this.progress_download.Style = System.Windows.Forms.ProgressBarStyle.Continuous;\r
@@ -72,7 +72,6 @@ namespace Handbrake
             // \r
             // btn_cancel\r
             // \r
-            this.btn_cancel.BackColor = System.Drawing.Color.Silver;\r
             this.btn_cancel.FlatAppearance.BorderColor = System.Drawing.Color.Black;\r
             this.btn_cancel.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.btn_cancel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
@@ -81,21 +80,19 @@ namespace Handbrake
             this.btn_cancel.Size = new System.Drawing.Size(90, 22);\r
             this.btn_cancel.TabIndex = 56;\r
             this.btn_cancel.Text = "Cancel";\r
-            this.btn_cancel.UseVisualStyleBackColor = true;\r
+            this.btn_cancel.UseVisualStyleBackColor = false;\r
             this.btn_cancel.Click += new System.EventHandler(this.btn_cancel_Click);\r
             // \r
             // frmDownload\r
             // \r
             this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 13F);\r
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
-            this.BackColor = System.Drawing.Color.Silver;\r
             this.ClientSize = new System.Drawing.Size(426, 87);\r
             this.Controls.Add(this.btn_cancel);\r
             this.Controls.Add(this.PictureBox1);\r
             this.Controls.Add(this.lblProgress);\r
             this.Controls.Add(this.progress_download);\r
             this.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;\r
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));\r
             this.Name = "frmDownload";\r
             this.ShowIcon = false;\r
index 872ec87..8fe53ba 100644 (file)
@@ -6,10 +6,6 @@
 \r
 using System;\r
 using System.Collections.Generic;\r
-using System.ComponentModel;\r
-using System.Data;\r
-using System.Drawing;\r
-using System.Text;\r
 using System.Windows.Forms;\r
 using System.Net;\r
 using System.IO;\r
@@ -30,20 +26,21 @@ namespace Handbrake
         private delegate void DownloadCompleteCallback();\r
         private delegate void DownloadFailedCallback();\r
 \r
+        private string file;\r
 \r
-        public frmDownload()\r
+        public frmDownload(string filename)\r
         {\r
             InitializeComponent();\r
 \r
+            file = filename;\r
             downloadThread = new Thread(Download);\r
             downloadThread.Start();\r
         }\r
 \r
         private void Download()\r
         {\r
-            Functions.AppcastReader rssRead = new Functions.AppcastReader();\r
             string tempPath = Path.Combine(Path.GetTempPath(), "handbrake-setup.exe");\r
-            string hbUpdate = rssRead.downloadFile();\r
+            string hbUpdate = file;\r
             WebClient wcDownload = new WebClient();\r
 \r
             try\r
index 88f2685..18ba214 100644 (file)
@@ -21,14 +21,13 @@ namespace Handbrake
 {\r
     public partial class frmMain : Form\r
     {\r
-\r
         // Declarations *******************************************************\r
         Functions.Common hb_common_func = new Functions.Common();\r
         Functions.x264Panel x264PanelFunctions = new Functions.x264Panel();\r
         Functions.Encode cliObj = new Functions.Encode();\r
         Functions.Queue encodeQueue = new Functions.Queue();\r
-        Parsing.Title selectedTitle;\r
         Functions.Presets presetHandler = new Functions.Presets();\r
+        Parsing.Title selectedTitle;\r
         internal Process hbProc;\r
         private Parsing.DVD thisDVD;\r
         private frmQueue queueWindow = new frmQueue();\r
@@ -69,7 +68,6 @@ namespace Handbrake
                     Properties.Settings.Default.hb_version = "0";\r
                 }\r
             }\r
-            Thread.Sleep(100);\r
 \r
             // show the form, but leave disabled until preloading is complete then show the main form\r
             this.Enabled = false;\r
@@ -83,7 +81,6 @@ namespace Handbrake
                 Application.DoEvents();\r
                 Thread updateCheckThread = new Thread(startupUpdateCheck);\r
                 updateCheckThread.Start();\r
-                Thread.Sleep(100);\r
             }\r
 \r
             // Setup the GUI components\r
@@ -100,12 +97,10 @@ namespace Handbrake
             if (Properties.Settings.Default.tooltipEnable == "Checked")\r
                 ToolTip.Active = true;\r
             lbl_encode.Text = "";\r
-            Thread.Sleep(100);\r
 \r
             //Finished Loading\r
             lblStatus.Text = "Loading Complete!";\r
             Application.DoEvents();\r
-            Thread.Sleep(100);\r
 \r
             //Close the splash screen\r
             splash.Close();\r
index b8b2bf8..d51d500 100644 (file)
@@ -36,10 +36,6 @@ namespace Handbrake
         {\r
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmUpdater));\r
             this.label1 = new System.Windows.Forms.Label();\r
-            this.label2 = new System.Windows.Forms.Label();\r
-            this.lbl_newVersion = new System.Windows.Forms.Label();\r
-            this.label4 = new System.Windows.Forms.Label();\r
-            this.lbl_oldVersion = new System.Windows.Forms.Label();\r
             this.label6 = new System.Windows.Forms.Label();\r
             this.wBrowser = new System.Windows.Forms.WebBrowser();\r
             this.btn_skip = new System.Windows.Forms.Button();\r
@@ -47,6 +43,7 @@ namespace Handbrake
             this.btn_remindLater = new System.Windows.Forms.Button();\r
             this.label3 = new System.Windows.Forms.Label();\r
             this.PictureBox1 = new System.Windows.Forms.PictureBox();\r
+            this.lbl_update_text = new System.Windows.Forms.Label();\r
             ((System.ComponentModel.ISupportInitialize)(this.PictureBox1)).BeginInit();\r
             this.SuspendLayout();\r
             // \r
@@ -60,46 +57,6 @@ namespace Handbrake
             this.label1.TabIndex = 25;\r
             this.label1.Text = "A New Version of Handbrake is available!";\r
             // \r
-            // label2\r
-            // \r
-            this.label2.AutoSize = true;\r
-            this.label2.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.label2.Location = new System.Drawing.Point(91, 33);\r
-            this.label2.Name = "label2";\r
-            this.label2.Size = new System.Drawing.Size(69, 13);\r
-            this.label2.TabIndex = 26;\r
-            this.label2.Text = "Handbrake";\r
-            // \r
-            // lbl_newVersion\r
-            // \r
-            this.lbl_newVersion.AutoSize = true;\r
-            this.lbl_newVersion.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.lbl_newVersion.Location = new System.Drawing.Point(155, 33);\r
-            this.lbl_newVersion.Name = "lbl_newVersion";\r
-            this.lbl_newVersion.Size = new System.Drawing.Size(120, 13);\r
-            this.lbl_newVersion.TabIndex = 27;\r
-            this.lbl_newVersion.Text = "0.0.0 (0000000000)";\r
-            // \r
-            // label4\r
-            // \r
-            this.label4.AutoSize = true;\r
-            this.label4.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.label4.Location = new System.Drawing.Point(274, 33);\r
-            this.label4.Name = "label4";\r
-            this.label4.Size = new System.Drawing.Size(98, 13);\r
-            this.label4.TabIndex = 28;\r
-            this.label4.Text = "is now available";\r
-            // \r
-            // lbl_oldVersion\r
-            // \r
-            this.lbl_oldVersion.AutoSize = true;\r
-            this.lbl_oldVersion.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.lbl_oldVersion.Location = new System.Drawing.Point(370, 33);\r
-            this.lbl_oldVersion.Name = "lbl_oldVersion";\r
-            this.lbl_oldVersion.Size = new System.Drawing.Size(103, 13);\r
-            this.lbl_oldVersion.TabIndex = 29;\r
-            this.lbl_oldVersion.Text = "(you have 0.0.0)";\r
-            // \r
             // label6\r
             // \r
             this.label6.AutoSize = true;\r
@@ -112,10 +69,10 @@ namespace Handbrake
             // \r
             // wBrowser\r
             // \r
-            this.wBrowser.Location = new System.Drawing.Point(94, 82);\r
+            this.wBrowser.Location = new System.Drawing.Point(94, 88);\r
             this.wBrowser.MinimumSize = new System.Drawing.Size(20, 20);\r
             this.wBrowser.Name = "wBrowser";\r
-            this.wBrowser.Size = new System.Drawing.Size(471, 155);\r
+            this.wBrowser.Size = new System.Drawing.Size(503, 155);\r
             this.wBrowser.TabIndex = 31;\r
             // \r
             // btn_skip\r
@@ -125,7 +82,7 @@ namespace Handbrake
             this.btn_skip.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
             this.btn_skip.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.btn_skip.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
-            this.btn_skip.Location = new System.Drawing.Point(94, 244);\r
+            this.btn_skip.Location = new System.Drawing.Point(94, 250);\r
             this.btn_skip.Name = "btn_skip";\r
             this.btn_skip.Size = new System.Drawing.Size(133, 22);\r
             this.btn_skip.TabIndex = 54;\r
@@ -140,7 +97,7 @@ namespace Handbrake
             this.btn_installUpdate.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
             this.btn_installUpdate.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.btn_installUpdate.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
-            this.btn_installUpdate.Location = new System.Drawing.Point(432, 244);\r
+            this.btn_installUpdate.Location = new System.Drawing.Point(464, 250);\r
             this.btn_installUpdate.Name = "btn_installUpdate";\r
             this.btn_installUpdate.Size = new System.Drawing.Size(133, 22);\r
             this.btn_installUpdate.TabIndex = 55;\r
@@ -155,7 +112,7 @@ namespace Handbrake
             this.btn_remindLater.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
             this.btn_remindLater.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.btn_remindLater.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
-            this.btn_remindLater.Location = new System.Drawing.Point(293, 244);\r
+            this.btn_remindLater.Location = new System.Drawing.Point(325, 250);\r
             this.btn_remindLater.Name = "btn_remindLater";\r
             this.btn_remindLater.Size = new System.Drawing.Size(133, 22);\r
             this.btn_remindLater.TabIndex = 56;\r
@@ -167,7 +124,7 @@ namespace Handbrake
             // \r
             this.label3.AutoSize = true;\r
             this.label3.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.label3.Location = new System.Drawing.Point(91, 66);\r
+            this.label3.Location = new System.Drawing.Point(91, 72);\r
             this.label3.Name = "label3";\r
             this.label3.Size = new System.Drawing.Size(103, 13);\r
             this.label3.TabIndex = 57;\r
@@ -183,21 +140,28 @@ namespace Handbrake
             this.PictureBox1.TabIndex = 24;\r
             this.PictureBox1.TabStop = false;\r
             // \r
+            // lbl_update_text\r
+            // \r
+            this.lbl_update_text.AutoSize = true;\r
+            this.lbl_update_text.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.lbl_update_text.Location = new System.Drawing.Point(91, 31);\r
+            this.lbl_update_text.Name = "lbl_update_text";\r
+            this.lbl_update_text.Size = new System.Drawing.Size(489, 13);\r
+            this.lbl_update_text.TabIndex = 58;\r
+            this.lbl_update_text.Text = "HandBrake {0.0.0} (000000000) is now available. (You have: {0.0.0} (000000000))";\r
+            // \r
             // frmUpdater\r
             // \r
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
-            this.ClientSize = new System.Drawing.Size(577, 272);\r
+            this.ClientSize = new System.Drawing.Size(609, 288);\r
+            this.Controls.Add(this.lbl_update_text);\r
             this.Controls.Add(this.label3);\r
             this.Controls.Add(this.btn_remindLater);\r
             this.Controls.Add(this.btn_installUpdate);\r
             this.Controls.Add(this.btn_skip);\r
             this.Controls.Add(this.wBrowser);\r
             this.Controls.Add(this.label6);\r
-            this.Controls.Add(this.lbl_oldVersion);\r
-            this.Controls.Add(this.label4);\r
-            this.Controls.Add(this.lbl_newVersion);\r
-            this.Controls.Add(this.label2);\r
             this.Controls.Add(this.label1);\r
             this.Controls.Add(this.PictureBox1);\r
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));\r
@@ -214,15 +178,12 @@ namespace Handbrake
 \r
         internal System.Windows.Forms.PictureBox PictureBox1;\r
         private System.Windows.Forms.Label label1;\r
-        private System.Windows.Forms.Label label2;\r
-        private System.Windows.Forms.Label lbl_newVersion;\r
-        private System.Windows.Forms.Label label4;\r
-        private System.Windows.Forms.Label lbl_oldVersion;\r
         private System.Windows.Forms.Label label6;\r
         private System.Windows.Forms.WebBrowser wBrowser;\r
         internal System.Windows.Forms.Button btn_skip;\r
         internal System.Windows.Forms.Button btn_installUpdate;\r
         internal System.Windows.Forms.Button btn_remindLater;\r
         private System.Windows.Forms.Label label3;\r
+        private System.Windows.Forms.Label lbl_update_text;\r
     }\r
 }
\ No newline at end of file
index 6252bb9..271e17b 100644 (file)
@@ -14,29 +14,31 @@ namespace Handbrake
 {\r
     public partial class frmUpdater : Form\r
     {\r
-        Functions.AppcastReader rssRead = new Functions.AppcastReader();\r
+        Functions.AppcastReader appcast = new Functions.AppcastReader();\r
         public frmUpdater()\r
         {\r
             InitializeComponent();\r
 \r
+            appcast.getInfo(); // Initializes the appcast\r
             getRss();\r
             setVersions();\r
         }\r
 \r
         private void getRss()\r
         {\r
-            wBrowser.DocumentText = "<font face=\"verdana\" size=\"1\">" + rssRead.versionInfo() + "</font>";\r
+            wBrowser.DocumentText = "<font face=\"verdana\" size=\"1\">" + appcast.versionInfo() + "</font>";\r
         }\r
 \r
         private void setVersions()\r
         {\r
-            lbl_oldVersion.Text = "(you have: " + Properties.Settings.Default.hb_version + " / " + Properties.Settings.Default.hb_build + ").";\r
-            lbl_newVersion.Text = rssRead.version() + " (" + rssRead.build() + ")";\r
+            string old = "(You have: " + Properties.Settings.Default.hb_version.Trim() + " / " + Properties.Settings.Default.hb_build.ToString().Trim() + ")";\r
+            string newBuild = appcast.version().Trim() + " (" + appcast.build() + ")";\r
+            lbl_update_text.Text = "HandBrake " + newBuild + " is now available. " + old;\r
         }\r
 \r
         private void btn_installUpdate_Click(object sender, EventArgs e)\r
         {\r
-            frmDownload download = new frmDownload();\r
+            frmDownload download = new frmDownload(appcast.downloadFile());\r
             download.Show();\r
             this.Close();\r
         }\r
@@ -48,7 +50,7 @@ namespace Handbrake
 \r
         private void btn_skip_Click(object sender, EventArgs e)\r
         {\r
-            Properties.Settings.Default.skipversion = int.Parse(rssRead.build());\r
+            Properties.Settings.Default.skipversion = int.Parse(appcast.build());\r
             Properties.Settings.Default.Save();\r
 \r
             this.Close();\r