OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 29 Apr 2008 16:29:33 +0000 (16:29 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 29 Apr 2008 16:29:33 +0000 (16:29 +0000)
- Update checker now reads either unstable or stable appcast based on the last digit of the build number.

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

win/C#/Functions/RssReader.cs
win/C#/Properties/Settings.Designer.cs
win/C#/Properties/Settings.settings
win/C#/app.config
win/C#/frmMain.Designer.cs
win/C#/frmMain.cs
win/C#/frmMain.resx

index c2da4aa..ec461a4 100644 (file)
@@ -28,7 +28,10 @@ namespace Handbrake.Functions
 \r
         private void readRss()\r
         {\r
-            rssReader = new XmlTextReader(Properties.Settings.Default.appcast);\r
+            if (Properties.Settings.Default.hb_build.ToString().EndsWith("1"))\r
+                rssReader = new XmlTextReader(Properties.Settings.Default.appcast_unstable);\r
+            else\r
+                rssReader = new XmlTextReader(Properties.Settings.Default.appcast);\r
             rssDoc = new XmlDocument();\r
             rssDoc.Load(rssReader);\r
 \r
@@ -64,23 +67,13 @@ namespace Handbrake.Functions
             hb_versionInfo = nodeItem["description"].InnerText;\r
 \r
             // Get the version\r
-            string input = nodeItem.InnerXml;\r
             Match ver;\r
-            if (Properties.Settings.Default.hb_build.ToString().EndsWith("1"))\r
-                ver = Regex.Match(input, @"<cli-unstable>[0-9]* \""[0-9.]*\""");\r
-            else \r
-                ver = Regex.Match(input, @"<cli-stable>[0-9]* \""[0-9.]*\""");\r
-            string[] hb_ver_find = ver.ToString().Split(' ');\r
-            hb_version = hb_ver_find[1].Replace("\"", "");\r
-\r
-            // Get the build number\r
-            input = nodeItem.InnerXml;\r
-            Match build;\r
-            if (Properties.Settings.Default.hb_build.ToString().EndsWith("1"))\r
-                build = Regex.Match(input, @"<cli-unstable>[0-9]*");\r
-            else \r
-                build = Regex.Match(input, @"<cli-stable>[0-9]*");\r
-            hb_build = build.ToString().Replace("<cli-stable>", "").Replace("<cli-unstable>", "");\r
+            string input = nodeItem.InnerXml;\r
+            ver = Regex.Match(input, @"sparkle:shortVersionString=""([0-9].[0-9].[0-9]*)\""");\r
+            hb_version = ver.ToString().Replace("sparkle:shortVersionString=", "").Replace("\"", "");\r
+\r
+            ver = Regex.Match(input, @"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
index 530f45a..e5f9dd9 100644 (file)
@@ -178,5 +178,17 @@ namespace Handbrake.Properties {
                 this["appcast"] = value;\r
             }\r
         }\r
+        \r
+        [global::System.Configuration.UserScopedSettingAttribute()]\r
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\r
+        [global::System.Configuration.DefaultSettingValueAttribute("http://handbrake.fr/appcast_unstable.xml")]\r
+        public string appcast_unstable {\r
+            get {\r
+                return ((string)(this["appcast_unstable"]));\r
+            }\r
+            set {\r
+                this["appcast_unstable"] = value;\r
+            }\r
+        }\r
     }\r
 }\r
index c6aa3a3..ab759a1 100644 (file)
@@ -41,5 +41,8 @@
     <Setting Name="appcast" Type="System.String" Scope="User">\r
       <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
+    </Setting>\r
   </Settings>\r
 </SettingsFile>
\ No newline at end of file
index 32e36ee..61a016d 100644 (file)
@@ -46,6 +46,9 @@
             <setting name="appcast" serializeAs="String">\r
                 <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
+            </setting>\r
         </Handbrake.Properties.Settings>\r
     </userSettings>\r
 </configuration>
\ No newline at end of file
index e2e6df1..2ce4203 100644 (file)
@@ -37,7 +37,7 @@ namespace Handbrake
             this.components = new System.ComponentModel.Container();\r
             System.Windows.Forms.Label Label38;\r
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));\r
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();\r
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();\r
             this.DVD_Save = new System.Windows.Forms.SaveFileDialog();\r
             this.File_Save = new System.Windows.Forms.SaveFileDialog();\r
             this.ToolTip = new System.Windows.Forms.ToolTip(this.components);\r
@@ -621,9 +621,9 @@ namespace Handbrake
             // \r
             // number\r
             // \r
-            dataGridViewCellStyle3.Format = "N0";\r
-            dataGridViewCellStyle3.NullValue = null;\r
-            this.number.DefaultCellStyle = dataGridViewCellStyle3;\r
+            dataGridViewCellStyle1.Format = "N0";\r
+            dataGridViewCellStyle1.NullValue = null;\r
+            this.number.DefaultCellStyle = dataGridViewCellStyle1;\r
             this.number.HeaderText = "Chapter Number";\r
             this.number.MaxInputLength = 3;\r
             this.number.Name = "number";\r
index 1dd9b2b..e4f79a6 100644 (file)
@@ -648,25 +648,32 @@ namespace Handbrake
             if ((text_destination.Text.Contains(".mp4")) || (text_destination.Text.Contains(".m4v")))\r
             {\r
                 check_largeFile.Enabled = true;\r
-                check_iPodAtom.Enabled = true;\r
                 check_optimiseMP4.Enabled = true;\r
-                check_largeFile.Visible = true;\r
-                check_iPodAtom.Visible = true;\r
-                check_optimiseMP4.Visible = true;\r
             }\r
             else\r
             {\r
+                check_largeFile.Enabled = false;\r
+                check_optimiseMP4.Enabled = false;\r
                 check_largeFile.Checked = false;\r
-                check_iPodAtom.Checked = false;\r
                 check_optimiseMP4.Checked = false;\r
-                check_largeFile.Visible = false;\r
-                check_iPodAtom.Visible = false;\r
-                check_optimiseMP4.Visible = false;\r
             }\r
 \r
 \r
             //Turn off some options which are H.264 only when the user selects a non h.264 encoder\r
-            if (!drp_videoEncoder.Text.Contains("H.264"))\r
+            if (drp_videoEncoder.Text.Contains("H.264"))\r
+            {\r
+                if (check_2PassEncode.CheckState == CheckState.Checked)\r
+                    check_turbo.Enabled = true;\r
+\r
+                h264Tab.Enabled = true;\r
+                if ((text_destination.Text.Contains(".mp4")) || (text_destination.Text.Contains(".m4v")))\r
+                    check_iPodAtom.Enabled = true;\r
+                else\r
+                    check_iPodAtom.Enabled = false;\r
+                if (!drp_anamorphic.Items.Contains("Loose"))\r
+                    drp_anamorphic.Items.Add("Loose");\r
+            }\r
+            else\r
             {\r
                 check_turbo.CheckState = CheckState.Unchecked;\r
                 check_turbo.Enabled = false;\r
@@ -674,21 +681,9 @@ namespace Handbrake
                 rtf_x264Query.Text = "";\r
                 check_iPodAtom.Enabled = false;\r
                 check_iPodAtom.Checked = false;\r
-                check_optimiseMP4.Enabled = false;\r
                 if (drp_anamorphic.Items.Count == 3)\r
                     drp_anamorphic.Items.RemoveAt(2);\r
             }\r
-            else\r
-            {\r
-                if (check_2PassEncode.CheckState == CheckState.Checked)\r
-                    check_turbo.Enabled = true;\r
-\r
-                h264Tab.Enabled = true;\r
-                check_iPodAtom.Enabled = true;\r
-                check_optimiseMP4.Enabled = true;\r
-                if (!drp_anamorphic.Items.Contains("Loose"))\r
-                    drp_anamorphic.Items.Add("Loose");\r
-            }\r
 \r
         }\r
 \r
@@ -1978,6 +1973,8 @@ namespace Handbrake
 \r
         #endregion\r
 \r
\r
+\r
 \r
         // This is the END of the road ------------------------------------------------------------------------------\r
     }\r
index e9b8e49..e91100b 100644 (file)
@@ -149,12 +149,6 @@ Make sure you have selected a "Title" from the "Source" box above otherwise
 the list will not be populated with the correct amount of chapters.\r
 Note: Do not change any of the chapter numbers!</value>\r
   </data>\r
-  <metadata name="number.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
-    <value>True</value>\r
-  </metadata>\r
-  <metadata name="name.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
-    <value>True</value>\r
-  </metadata>\r
   <metadata name="DVD_Open.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
     <value>223, 15</value>\r
   </metadata>\r