summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorsr55 <[email protected]>2008-04-23 21:41:21 +0000
committersr55 <[email protected]>2008-04-23 21:41:21 +0000
commitee6bd3bd354cd235d49f91a0616f197d61743dd5 (patch)
tree23511afecf8a48665e99aded46a0584c6ed83a81 /win
parent900b738c3154126a25b6d1da21b073c876105805 (diff)
WinGui:
- Added support for stable / unstable builds in the update checker. - Setup the rss reader to read the cli-stable and cli-unstable tags in the appcast. This is now used for the version information. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1432 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win')
-rw-r--r--win/C#/Functions/Common.cs2
-rw-r--r--win/C#/Functions/RssReader.cs66
2 files changed, 27 insertions, 41 deletions
diff --git a/win/C#/Functions/Common.cs b/win/C#/Functions/Common.cs
index 4394fe54b..b1408bb02 100644
--- a/win/C#/Functions/Common.cs
+++ b/win/C#/Functions/Common.cs
@@ -31,9 +31,7 @@ namespace Handbrake.Functions
int skip = Properties.Settings.Default.skipversion;
if (latest == skip)
- {
return false;
- }
else
{
Boolean update = (latest > current);
diff --git a/win/C#/Functions/RssReader.cs b/win/C#/Functions/RssReader.cs
index a5643a301..c2da4aad6 100644
--- a/win/C#/Functions/RssReader.cs
+++ b/win/C#/Functions/RssReader.cs
@@ -26,7 +26,7 @@ namespace Handbrake.Functions
XmlNode nodeItem;
string t;
- private string readRss()
+ private void readRss()
{
rssReader = new XmlTextReader(Properties.Settings.Default.appcast);
rssDoc = new XmlDocument();
@@ -35,30 +35,20 @@ namespace Handbrake.Functions
for (int i = 0; i < rssDoc.ChildNodes.Count; i++)
{
if (rssDoc.ChildNodes[i].Name == "rss")
- {
nodeRss = rssDoc.ChildNodes[i];
- }
}
for (int i = 0; i < nodeRss.ChildNodes.Count; i++)
{
if (nodeRss.ChildNodes[i].Name == "channel")
- {
nodeChannel = nodeRss.ChildNodes[i];
- }
}
- string latestTitle = "";
for (int i = 0; i < nodeChannel.ChildNodes.Count; i++)
{
-
if (nodeChannel.ChildNodes[i].Name == "item")
- {
nodeItem = nodeChannel.ChildNodes[i];
- latestTitle = nodeItem["title"].InnerText;
- }
}
- return latestTitle;
}
private string hb_versionInfo;
@@ -69,34 +59,32 @@ namespace Handbrake.Functions
public void getInfo()
{
readRss();
- for (int i = 0; i < nodeChannel.ChildNodes.Count; i++)
- {
- if (nodeChannel.ChildNodes[nodeChannel.ChildNodes.Count -1 ].Name == "item")
- {
- nodeItem = nodeChannel.ChildNodes[0];
- t = readRss();
- if (nodeItem["title"].InnerText == t)
- {
- // Get the Version Information
- hb_versionInfo = nodeItem["description"].InnerText;
-
- // Get the version
- string input = nodeItem.InnerXml;
- Match ver = Regex.Match(input, @"sparkle:shortVersionString=""([0-9].[0-9].[0-9]*)\""");
- hb_version = ver.ToString().Replace("sparkle:shortVersionString=", "").Replace("\"", "");
-
- // Get the build number
- input = nodeItem.InnerXml;
- ver = Regex.Match(input, @"sparkle:version=""([0-9]*)\""");
- hb_build = ver.ToString().Replace("sparkle:version=", "").Replace("\"", "");
-
- // Get the update file
- hb_file = nodeItem["windows"].InnerText;
-
- }
- }
- }
- }
+
+ // Get the Version Information
+ hb_versionInfo = nodeItem["description"].InnerText;
+
+ // Get the version
+ string input = nodeItem.InnerXml;
+ Match ver;
+ if (Properties.Settings.Default.hb_build.ToString().EndsWith("1"))
+ ver = Regex.Match(input, @"<cli-unstable>[0-9]* \""[0-9.]*\""");
+ else
+ ver = Regex.Match(input, @"<cli-stable>[0-9]* \""[0-9.]*\""");
+ string[] hb_ver_find = ver.ToString().Split(' ');
+ hb_version = hb_ver_find[1].Replace("\"", "");
+
+ // Get the build number
+ input = nodeItem.InnerXml;
+ Match build;
+ if (Properties.Settings.Default.hb_build.ToString().EndsWith("1"))
+ build = Regex.Match(input, @"<cli-unstable>[0-9]*");
+ else
+ build = Regex.Match(input, @"<cli-stable>[0-9]*");
+ hb_build = build.ToString().Replace("<cli-stable>", "").Replace("<cli-unstable>", "");
+
+ // Get the update file
+ hb_file = nodeItem["windows"].InnerText;
+ }
public string versionInfo()
{