summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsr55 <[email protected]>2010-08-21 19:48:04 +0000
committersr55 <[email protected]>2010-08-21 19:48:04 +0000
commit08de2cf8a50bcfe3c6eafe73a8c1bbb64f97b567 (patch)
treea059a10b68cbd726908c45d72e63bf124859d810
parent4237415c6eb4415d86ee8c76c777a43e7ed7ad8e (diff)
WinGui:
- Strip out some version checking code that's no longer required. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3490 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--win/C#/Functions/Main.cs47
-rw-r--r--win/C#/frmMain.cs1
2 files changed, 12 insertions, 36 deletions
diff --git a/win/C#/Functions/Main.cs b/win/C#/Functions/Main.cs
index e6f8e0769..0ea9a8ead 100644
--- a/win/C#/Functions/Main.cs
+++ b/win/C#/Functions/Main.cs
@@ -278,7 +278,7 @@ namespace Handbrake.Functions
// 1 = Build Date
DateTime lastModified = File.GetLastWriteTime("HandBrakeCLI.exe");
- if (Properties.Settings.Default.hb_build != 0 && Properties.Settings.Default.cliLastModified == lastModified )
+ if (Properties.Settings.Default.hb_build != 0 && Properties.Settings.Default.cliLastModified == lastModified)
{
return;
}
@@ -305,16 +305,19 @@ namespace Handbrake.Functions
while (!cliProcess.HasExited)
{
line = stdOutput.ReadLine() ?? string.Empty;
- Match m = Regex.Match(line, @"HandBrake ([svnM0-9.]*) \([0-9]*\)");
+ Match m = Regex.Match(line, @"HandBrake ([svnM0-9.]*) \(([0-9]*)\)");
Match platform = Regex.Match(line, @"- ([A-Za-z0-9\s ]*) -");
if (m.Success)
{
- string data = line.Replace("(", string.Empty).Replace(")", string.Empty).Replace("HandBrake ", string.Empty);
- string[] arr = data.Split(' ');
+ string version = m.Groups[1].Success ? m.Groups[1].Value : string.Empty;
+ string build = m.Groups[2].Success ? m.Groups[2].Value : string.Empty;
- Properties.Settings.Default.hb_build = int.Parse(arr[1]);
- Properties.Settings.Default.hb_version = arr[0];
+ int buildValue;
+ int.TryParse(build, out buildValue);
+
+ Properties.Settings.Default.hb_build = buildValue;
+ Properties.Settings.Default.hb_version = version;
}
if (platform.Success)
@@ -336,6 +339,9 @@ namespace Handbrake.Functions
}
catch (Exception e)
{
+ Properties.Settings.Default.hb_build = 0;
+ Properties.Settings.Default.Save();
+
frmExceptionWindow exceptionWindow = new frmExceptionWindow();
exceptionWindow.Setup("Unable to retrieve version information from the CLI.", e.ToString());
exceptionWindow.ShowDialog();
@@ -343,35 +349,6 @@ namespace Handbrake.Functions
}
/// <summary>
- /// Check to make sure that the user has an up to date version of the CLI installed.
- /// </summary>
- public static void CheckForValidCliVersion()
- {
- // Make sure we have a recent version for svn builds
- string cli_version = Properties.Settings.Default.hb_version;
- Version gui_version = Assembly.GetExecutingAssembly().GetName().Version;
-
- if (cli_version.Contains("svn") || gui_version.Revision > 0)
- {
- int gui_build, cli_build;
- int.TryParse(gui_version.Revision.ToString(), out gui_build);
- int.TryParse(Properties.Settings.Default.hb_version.Replace("svn", string.Empty), out cli_build);
-
- if (gui_build > cli_build)
- {
- MessageBox.Show(
- "It appears you are trying to use a CLI executable that is too old for this version of the HandBrake GUI.\n" +
- "Please update the HandBrakeCLI.exe to a newer build.\n\n" +
- "HandBrake build Detected: " + cli_build,
- "Error",
- MessageBoxButtons.OK,
- MessageBoxIcon.Error);
- return;
- }
- }
- }
-
- /// <summary>
/// Check if the queue recovery file contains records.
/// If it does, it means the last queue did not complete before HandBrake closed.
/// So, return a boolean if true.
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs
index d95d085a9..57528eddc 100644
--- a/win/C#/frmMain.cs
+++ b/win/C#/frmMain.cs
@@ -95,7 +95,6 @@ namespace Handbrake
// Update the users config file with the CLI version data.
Main.SetCliVersionData();
- Main.CheckForValidCliVersion();
if (Settings.Default.hb_version.Contains("svn"))
{