]> granicus.if.org Git - handbrake/commitdiff
WinGui: Ability to Force Preset updates change tidy up
authorScott <sr55.hb@outlook.com>
Mon, 14 Dec 2015 19:59:27 +0000 (19:59 +0000)
committerScott <sr55.hb@outlook.com>
Mon, 14 Dec 2015 20:12:29 +0000 (20:12 +0000)
win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
win/CS/HandBrakeWPF/Properties/Resources.resx
win/CS/HandBrakeWPF/Services/Presets/PresetService.cs
win/CS/HandBrakeWPF/defaultsettings.xml

index 752fd547e71850d3912aca61133c20627fa53ff6..c0b0c61d8e6b4aa3660e49c0d695c37b2b09ce80 100644 (file)
@@ -1249,6 +1249,16 @@ namespace HandBrakeWPF.Properties {
             }\r
         }\r
         \r
+        /// <summary>\r
+        ///   Looks up a localized string similar to HandBrake is unable to upgrade your presets file to a new version format.\r
+        ///Your preset file will be archived and new one created. You will need to re-create your own presets..\r
+        /// </summary>\r
+        public static string Presets_PresetForceReset {\r
+            get {\r
+                return ResourceManager.GetString("Presets_PresetForceReset", resourceCulture);\r
+            }\r
+        }\r
+        \r
         /// <summary>\r
         ///   Looks up a localized string similar to The Built-in presets have been reset..\r
         /// </summary>\r
index 765b9636b1507f14e488c328a60850106b6352cf..a63772ad6776afc10403a253ee87ebc2829926b6 100644 (file)
@@ -789,4 +789,8 @@ Are you sure you want to import the chapter names?</value>
   <data name="ScanService_ScanStopFailed" xml:space="preserve">\r
     <value>An error occured when trying to stop the scan. Please restart HandBrake.</value>\r
   </data>\r
+  <data name="Presets_PresetForceReset" xml:space="preserve">\r
+    <value>HandBrake is unable to upgrade your presets file to a new version format.\r
+Your preset file will be archived and new one created. You will need to re-create your own presets.</value>\r
+  </data>\r
 </root>
\ No newline at end of file
index de1aefbf88a6b15a9ac73d4b7e4f5458b82f3839..6e6935f00f6167c6861c46cb71d86a17e253a718 100644 (file)
@@ -43,7 +43,7 @@ namespace HandBrakeWPF.Services.Presets
     {\r
         #region Private Variables\r
 \r
-        public const int ForcePresetReset = 0;\r
+        public const int ForcePresetReset = 2;\r
         public static string UserPresetCatgoryName = "User Presets";\r
         private readonly string presetFile = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\presets.json";\r
         private readonly ObservableCollection<Preset> presets = new ObservableCollection<Preset>();\r
@@ -544,11 +544,13 @@ namespace HandBrakeWPF.Services.Presets
                 }\r
 \r
                 // Force Upgrade of presets\r
-                if (this.userSettingService.GetUserSetting<int>(UserSettingConstants.ForcePresetReset) > ForcePresetReset)\r
+                if (this.userSettingService.GetUserSetting<int>(UserSettingConstants.ForcePresetReset) < ForcePresetReset)\r
                 {\r
+                    this.userSettingService.SetUserSetting(UserSettingConstants.ForcePresetReset, ForcePresetReset);\r
+\r
                     string fileName = this.ArchivePresetFile(this.presetFile);\r
                     this.errorService.ShowMessageBox(\r
-                        Resources.PresetService_PresetsOutOfDate\r
+                        Resources.Presets_PresetForceReset\r
                         + Environment.NewLine + Environment.NewLine + Resources.PresetService_ArchiveFile + fileName,\r
                         Resources.PresetService_UnableToLoad,\r
                         MessageBoxButton.OK,\r
index 762734009ffafbef40cee9a047ffb4f1e6014dee..fc7856d721ff5519de7ad98bb7d956b191d0cd34 100644 (file)
       <string>ForcePresetReset</string>\r
     </key>\r
     <value>\r
-      <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:int" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">0</anyType>\r
+      <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:int" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">2</anyType>\r
     </value>\r
   </item>\r
 </dictionary>
\ No newline at end of file