OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 31 Jul 2010 19:26:05 +0000 (19:26 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 31 Jul 2010 19:26:05 +0000 (19:26 +0000)
- Simply the versioning of the Windows GUI so it's less confusing.
- GUI now only displays the CLI Version. The GUI will however check that it's own executable build revision is not greater than the CLI and report an error if it is.

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

win/C#/Functions/Main.cs
win/C#/Properties/Settings.Designer.cs
win/C#/Properties/Settings.settings
win/C#/app.config
win/C#/frmAbout.Designer.cs
win/C#/frmAbout.cs
win/C#/frmMain.cs

index 4d82fb1..ebc3f38 100644 (file)
@@ -10,6 +10,7 @@ namespace Handbrake.Functions
     using System.Diagnostics;\r
     using System.IO;\r
     using System.Net;\r
+    using System.Reflection;\r
     using System.Text;\r
     using System.Text.RegularExpressions;\r
     using System.Threading;\r
@@ -345,18 +346,21 @@ namespace Handbrake.Functions
         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
+            string cli_version = Properties.Settings.Default.hb_version;\r
+            Version gui_version = Assembly.GetExecutingAssembly().GetName().Version;\r
+\r
+            if (cli_version.Contains("svn") || gui_version.Revision > 0)\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
+                int gui_build, cli_build;\r
+                int.TryParse(gui_version.Revision.ToString(), out gui_build);\r
+                int.TryParse(Properties.Settings.Default.hb_version.Replace("svn", string.Empty), out cli_build);\r
+\r
+                if (gui_build > cli_build)\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 build Detected: " + Properties.Settings.Default.hb_version,\r
+                        "HandBrake build Detected: " + cli_build,\r
                         "Error",\r
                         MessageBoxButtons.OK,\r
                         MessageBoxIcon.Error);\r
index b2f4892..1f49b4e 100644 (file)
@@ -1,7 +1,7 @@
 //------------------------------------------------------------------------------\r
 // <auto-generated>\r
 //     This code was generated by a tool.\r
-//     Runtime Version:4.0.30319.1\r
+//     Runtime Version:2.0.50727.4927\r
 //\r
 //     Changes to this file may cause incorrect behavior and will be lost if\r
 //     the code is regenerated.\r
@@ -12,7 +12,7 @@ namespace Handbrake.Properties {
     \r
     \r
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\r
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]\r
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]\r
     internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {\r
         \r
         private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\r
@@ -503,18 +503,6 @@ namespace Handbrake.Properties {
         \r
         [global::System.Configuration.UserScopedSettingAttribute()]\r
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\r
-        [global::System.Configuration.DefaultSettingValueAttribute("3378")]\r
-        public int hb_min_cli {\r
-            get {\r
-                return ((int)(this["hb_min_cli"]));\r
-            }\r
-            set {\r
-                this["hb_min_cli"] = value;\r
-            }\r
-        }\r
-        \r
-        [global::System.Configuration.UserScopedSettingAttribute()]\r
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\r
         [global::System.Configuration.DefaultSettingValueAttribute("True")]\r
         public bool UpdateRequired {\r
             get {\r
index c7e001d..2d8437a 100644 (file)
     <Setting Name="AutoNameRemoveUnderscore" Type="System.Boolean" Scope="User">\r
       <Value Profile="(Default)">False</Value>\r
     </Setting>\r
-    <Setting Name="hb_min_cli" Type="System.Int32" Scope="User">\r
-      <Value Profile="(Default)">3378</Value>\r
-    </Setting>\r
     <Setting Name="UpdateRequired" Type="System.Boolean" Scope="User">\r
       <Value Profile="(Default)">True</Value>\r
     </Setting>\r
index a51c09d..bf67ae2 100644 (file)
       <setting name="AutoNameRemoveUnderscore" serializeAs="String">\r
         <value>False</value>\r
       </setting>\r
-      <setting name="hb_min_cli" serializeAs="String">\r
-        <value>3378</value>\r
-      </setting>\r
       <setting name="UpdateRequired" serializeAs="String">\r
         <value>True</value>\r
       </setting>\r
index aab6dea..dac2e4d 100644 (file)
@@ -37,7 +37,6 @@ namespace Handbrake
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmAbout));\r
             this.Label3 = new System.Windows.Forms.Label();\r
             this.label1 = new System.Windows.Forms.Label();\r
-            this.lbl_HBBuild = new System.Windows.Forms.Label();\r
             this.PictureBox1 = new System.Windows.Forms.PictureBox();\r
             this.btn_close = new System.Windows.Forms.Button();\r
             this.richTextBox1 = new System.Windows.Forms.RichTextBox();\r
@@ -61,7 +60,7 @@ namespace Handbrake
             // label1\r
             // \r
             this.label1.AutoSize = true;\r
-            this.label1.Location = new System.Drawing.Point(125, 64);\r
+            this.label1.Location = new System.Drawing.Point(125, 47);\r
             this.label1.Margin = new System.Windows.Forms.Padding(3);\r
             this.label1.Name = "label1";\r
             this.label1.Size = new System.Drawing.Size(224, 13);\r
@@ -69,17 +68,6 @@ namespace Handbrake
             this.label1.Text = "Copyright  2003-2010 HandBrake Developers";\r
             this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;\r
             // \r
-            // lbl_HBBuild\r
-            // \r
-            this.lbl_HBBuild.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.lbl_HBBuild.Location = new System.Drawing.Point(125, 35);\r
-            this.lbl_HBBuild.Margin = new System.Windows.Forms.Padding(3, 1, 3, 3);\r
-            this.lbl_HBBuild.Name = "lbl_HBBuild";\r
-            this.lbl_HBBuild.Size = new System.Drawing.Size(224, 13);\r
-            this.lbl_HBBuild.TabIndex = 32;\r
-            this.lbl_HBBuild.Text = "{CLI Version}";\r
-            this.lbl_HBBuild.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;\r
-            // \r
             // PictureBox1\r
             // \r
             this.PictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;\r
@@ -147,7 +135,6 @@ namespace Handbrake
             this.Controls.Add(this.btn_close);\r
             this.Controls.Add(this.label1);\r
             this.Controls.Add(this.PictureBox1);\r
-            this.Controls.Add(this.lbl_HBBuild);\r
             this.Controls.Add(this.Label3);\r
             this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;\r
@@ -169,7 +156,6 @@ namespace Handbrake
 \r
         internal System.Windows.Forms.Label Label3;\r
         internal System.Windows.Forms.Label label1;\r
-        internal System.Windows.Forms.Label lbl_HBBuild;\r
         internal System.Windows.Forms.PictureBox PictureBox1;\r
         private System.Windows.Forms.Button btn_close;\r
         private System.Windows.Forms.RichTextBox richTextBox1;\r
index 9db62f8..70fc922 100644 (file)
@@ -6,7 +6,6 @@
 namespace Handbrake\r
 {\r
     using System;\r
-    using System.Reflection;\r
     using System.Windows.Forms;\r
 \r
     /// <summary>\r
@@ -20,12 +19,9 @@ namespace Handbrake
         public frmAbout()\r
         {\r
             InitializeComponent();\r
-            lbl_HBBuild.Text = "CLI Build: " + Properties.Settings.Default.hb_version + " (" + Properties.Settings.Default.hb_build +\r
-                               ") - " + Properties.Settings.Default.hb_platform;\r
 \r
-            Version gui = Assembly.GetExecutingAssembly().GetName().Version;\r
-            Version appServices = HandBrake.ApplicationServices.Init.AssemblyVersion();\r
-            lbl_GUIBuild.Text = gui.ToString(4) + " (Services: "  + appServices.ToString(4) + ")";\r
+            string nightly = Properties.Settings.Default.hb_version.Contains("svn") ? " (SVN / Nightly Build)" : string.Empty;\r
+            lbl_GUIBuild.Text = Properties.Settings.Default.hb_version + " (" + Properties.Settings.Default.hb_build + ") " + nightly;\r
         }\r
 \r
         /// <summary>\r
index ef6efdf..732a50c 100644 (file)
@@ -100,8 +100,7 @@ namespace Handbrake
 \r
             if (Settings.Default.hb_version.Contains("svn"))\r
             {\r
-                Version v = Assembly.GetExecutingAssembly().GetName().Version;\r
-                this.Text += " " + v.ToString(4);\r
+                this.Text += " " + Settings.Default.hb_version;\r
             }\r
 \r
             // Check for new versions, if update checking is enabled\r