OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 25 Apr 2010 13:55:28 +0000 (13:55 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 25 Apr 2010 13:55:28 +0000 (13:55 +0000)
- 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://localhost/HandBrake/trunk@3265 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/C#/Functions/Main.cs
win/C#/Program.cs
win/C#/frmMain.cs

index 4bce2a7..e9e36d1 100644 (file)
@@ -290,6 +290,32 @@ namespace Handbrake.Functions
         }\r
 \r
         /// <summary>\r
+        /// Check to make sure that the user has an up to date version of the CLI installed.\r
+        /// </summary>\r
+        public static void CheckForValidCliVersion()\r
+        {\r
+            // Make sure we have a recent version for svn builds\r
+            string version = Properties.Settings.Default.hb_version;\r
+            if (version.Contains("svn"))\r
+            {\r
+                version = version.Replace("svn", string.Empty).Trim();\r
+                int build;\r
+                int.TryParse(version, out build);\r
+                if (build < Properties.Settings.Default.hb_min_cli)\r
+                {\r
+                    MessageBox.Show(\r
+                        "It appears you are trying to use a CLI executable that is too old for this version of the HandBrake GUI.\n" +\r
+                        "Please update the HandBrakeCLI.exe to a newer build.\n\n" +\r
+                        "HandBrake Detected: " + Properties.Settings.Default.hb_version,\r
+                        "Error",\r
+                        MessageBoxButtons.OK,\r
+                        MessageBoxIcon.Error);\r
+                    return;\r
+                }\r
+            }\r
+        }\r
+\r
+        /// <summary>\r
         /// Check if the queue recovery file contains records.\r
         /// If it does, it means the last queue did not complete before HandBrake closed.\r
         /// So, return a boolean if true. \r
index 9c45464..ea82e3e 100644 (file)
@@ -45,25 +45,6 @@ namespace Handbrake
                 return;\r
             }\r
 \r
-            // Make sure we have a recent version for svn builds\r
-            string version = Properties.Settings.Default.hb_version;\r
-            if (version.Contains("svn"))\r
-            {\r
-                version = version.Replace("svn", string.Empty).Trim();\r
-                int build;\r
-                int.TryParse(version, out build);\r
-                if (build < Properties.Settings.Default.hb_min_cli)\r
-                {\r
-                    MessageBox.Show(\r
-                        "It appears you are trying to use a CLI executable that is too old for this version of the HandBrake GUI.\n" + \r
-                        "Please update the HandBrakeCLI.exe to a newer build. ",\r
-                        "Error",\r
-                        MessageBoxButtons.OK,\r
-                        MessageBoxIcon.Error);\r
-                    return;\r
-                }\r
-            }\r
-\r
             // Check were not running on a screen that's going to cause some funnies to happen.\r
             Screen scr = Screen.PrimaryScreen;\r
             if ((scr.Bounds.Width < 1024) || (scr.Bounds.Height < 620))\r
index 763f2d3..f3dd454 100644 (file)
@@ -61,9 +61,10 @@ namespace Handbrake
             InitializeComponent();\r
 \r
             // Update the users config file with the CLI version data.\r
-            lblStatus.Text = "Setting Version Data ...";\r
+            lblStatus.Text = "Updating and Checking CLI Version Data ...";\r
             Application.DoEvents();\r
             Main.SetCliVersionData();\r
+            Main.CheckForValidCliVersion();\r
 \r
             // Show the form, but leave disabled until preloading is complete then show the main form\r
             this.Enabled = false;\r