diff options
author | sr55 <[email protected]> | 2010-04-25 13:55:28 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2010-04-25 13:55:28 +0000 |
commit | da0ec0271411e2927bbb9590c47dc4dbfd656303 (patch) | |
tree | 90068a3c0848d278b92046447e8329ea22efce15 | |
parent | a2d5e1faded703c38a45dd72e87ba61e564f54e0 (diff) |
WinGui:
- Fix an issue with the CLI version check logic. It was checking cached version data before checking the actual CLI data.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3265 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | win/C#/Functions/Main.cs | 26 | ||||
-rw-r--r-- | win/C#/Program.cs | 19 | ||||
-rw-r--r-- | win/C#/frmMain.cs | 3 |
3 files changed, 28 insertions, 20 deletions
diff --git a/win/C#/Functions/Main.cs b/win/C#/Functions/Main.cs index 4bce2a7fa..e9e36d1a2 100644 --- a/win/C#/Functions/Main.cs +++ b/win/C#/Functions/Main.cs @@ -290,6 +290,32 @@ 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 version = Properties.Settings.Default.hb_version;
+ if (version.Contains("svn"))
+ {
+ version = version.Replace("svn", string.Empty).Trim();
+ int build;
+ int.TryParse(version, out build);
+ if (build < Properties.Settings.Default.hb_min_cli)
+ {
+ 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 Detected: " + Properties.Settings.Default.hb_version,
+ "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#/Program.cs b/win/C#/Program.cs index 9c454648e..ea82e3e34 100644 --- a/win/C#/Program.cs +++ b/win/C#/Program.cs @@ -45,25 +45,6 @@ namespace Handbrake return;
}
- // Make sure we have a recent version for svn builds
- string version = Properties.Settings.Default.hb_version;
- if (version.Contains("svn"))
- {
- version = version.Replace("svn", string.Empty).Trim();
- int build;
- int.TryParse(version, out build);
- if (build < Properties.Settings.Default.hb_min_cli)
- {
- 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. ",
- "Error",
- MessageBoxButtons.OK,
- MessageBoxIcon.Error);
- return;
- }
- }
-
// Check were not running on a screen that's going to cause some funnies to happen.
Screen scr = Screen.PrimaryScreen;
if ((scr.Bounds.Width < 1024) || (scr.Bounds.Height < 620))
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 763f2d360..f3dd454bb 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -61,9 +61,10 @@ namespace Handbrake InitializeComponent();
// Update the users config file with the CLI version data.
- lblStatus.Text = "Setting Version Data ...";
+ lblStatus.Text = "Updating and Checking CLI Version Data ...";
Application.DoEvents();
Main.SetCliVersionData();
+ Main.CheckForValidCliVersion();
// Show the form, but leave disabled until preloading is complete then show the main form
this.Enabled = false;
|