From cd2eb1c2b13d15dd58842d8eabea978075979554 Mon Sep 17 00:00:00 2001 From: Scott Date: Mon, 14 Dec 2015 19:59:27 +0000 Subject: WinGui: Ability to Force Preset updates change tidy up --- win/CS/HandBrakeWPF/Properties/Resources.Designer.cs | 10 ++++++++++ win/CS/HandBrakeWPF/Properties/Resources.resx | 4 ++++ win/CS/HandBrakeWPF/Services/Presets/PresetService.cs | 8 +++++--- win/CS/HandBrakeWPF/defaultsettings.xml | 2 +- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs index 752fd547e..c0b0c61d8 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs @@ -1249,6 +1249,16 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to HandBrake is unable to upgrade your presets file to a new version format. + ///Your preset file will be archived and new one created. You will need to re-create your own presets.. + /// + public static string Presets_PresetForceReset { + get { + return ResourceManager.GetString("Presets_PresetForceReset", resourceCulture); + } + } + /// /// Looks up a localized string similar to The Built-in presets have been reset.. /// diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx index 765b9636b..a63772ad6 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.resx +++ b/win/CS/HandBrakeWPF/Properties/Resources.resx @@ -789,4 +789,8 @@ Are you sure you want to import the chapter names? An error occured when trying to stop the scan. Please restart HandBrake. + + HandBrake is unable to upgrade your presets file to a new version format. +Your preset file will be archived and new one created. You will need to re-create your own presets. + \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs index de1aefbf8..6e6935f00 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs @@ -43,7 +43,7 @@ namespace HandBrakeWPF.Services.Presets { #region Private Variables - public const int ForcePresetReset = 0; + public const int ForcePresetReset = 2; public static string UserPresetCatgoryName = "User Presets"; private readonly string presetFile = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\presets.json"; private readonly ObservableCollection presets = new ObservableCollection(); @@ -544,11 +544,13 @@ namespace HandBrakeWPF.Services.Presets } // Force Upgrade of presets - if (this.userSettingService.GetUserSetting(UserSettingConstants.ForcePresetReset) > ForcePresetReset) + if (this.userSettingService.GetUserSetting(UserSettingConstants.ForcePresetReset) < ForcePresetReset) { + this.userSettingService.SetUserSetting(UserSettingConstants.ForcePresetReset, ForcePresetReset); + string fileName = this.ArchivePresetFile(this.presetFile); this.errorService.ShowMessageBox( - Resources.PresetService_PresetsOutOfDate + Resources.Presets_PresetForceReset + Environment.NewLine + Environment.NewLine + Resources.PresetService_ArchiveFile + fileName, Resources.PresetService_UnableToLoad, MessageBoxButton.OK, diff --git a/win/CS/HandBrakeWPF/defaultsettings.xml b/win/CS/HandBrakeWPF/defaultsettings.xml index 762734009..fc7856d72 100644 --- a/win/CS/HandBrakeWPF/defaultsettings.xml +++ b/win/CS/HandBrakeWPF/defaultsettings.xml @@ -477,7 +477,7 @@ ForcePresetReset - 0 + 2 \ No newline at end of file -- cgit v1.2.3