OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 13 Sep 2009 21:21:57 +0000 (21:21 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 13 Sep 2009 21:21:57 +0000 (21:21 +0000)
- Fix: Don't check version data if the CLI file hasn't actually changed since the last launch.

git-svn-id: svn://localhost/HandBrake/trunk@2818 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

index 022a025..dd618cb 100644 (file)
@@ -197,6 +197,15 @@ namespace Handbrake.Functions
 \r
             // 0 = SVN Build / Version\r
             // 1 = Build Date\r
+\r
+            DateTime lastModified = File.GetLastWriteTime("HandBrakeCLI.exe");\r
+\r
+\r
+            if (Properties.Settings.Default.cliLastModified == lastModified && Properties.Settings.Default.hb_build != 0)\r
+                return;\r
+\r
+            Properties.Settings.Default.cliLastModified = lastModified;\r
+            \r
             Process cliProcess = new Process();\r
             ProcessStartInfo handBrakeCLI = new ProcessStartInfo("HandBrakeCLI.exe", " -u")\r
                                                 {\r
@@ -237,6 +246,7 @@ namespace Handbrake.Functions
                             cli.Kill();\r
                     }\r
                 }\r
+                Properties.Settings.Default.Save();\r
             }\r
             catch (Exception e)\r
             {\r
index be86c49..e330984 100644 (file)
@@ -465,5 +465,16 @@ namespace Handbrake.Properties {
                 this["growlEncode"] = value;\r
             }\r
         }\r
+        \r
+        [global::System.Configuration.UserScopedSettingAttribute()]\r
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\r
+        public global::System.DateTime cliLastModified {\r
+            get {\r
+                return ((global::System.DateTime)(this["cliLastModified"]));\r
+            }\r
+            set {\r
+                this["cliLastModified"] = value;\r
+            }\r
+        }\r
     }\r
 }\r
index b52c8c7..7d65686 100644 (file)
     <Setting Name="growlEncode" Type="System.Boolean" Scope="User">\r
       <Value Profile="(Default)">False</Value>\r
     </Setting>\r
+    <Setting Name="cliLastModified" Type="System.DateTime" Scope="User">\r
+      <Value Profile="(Default)" />\r
+    </Setting>\r
   </Settings>\r
 </SettingsFile>
\ No newline at end of file
index d213f50..bf7dfd9 100644 (file)
             <setting name="growlEncode" serializeAs="String">\r
                 <value>False</value>\r
             </setting>\r
+            <setting name="cliLastModified" serializeAs="String">\r
+                <value />\r
+            </setting>\r
         </Handbrake.Properties.Settings>\r
     </userSettings>\r
 <startup><supportedRuntime version="v2.0.50727"/></startup></configuration>\r