From 8843a96cc365af7c5466d503eb016e6c0d3637c9 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 6 Feb 2021 20:37:10 +0000 Subject: WinGui: Add code to prevent double default presets. Fixes #3386 --- win/CS/HandBrakeWPF/Services/Presets/PresetService.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'win/CS') diff --git a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs index 8d19c3282..2d280aad3 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs @@ -423,6 +423,8 @@ namespace HandBrakeWPF.Services.Presets // Clear the current built in Presets and now parse the temporary Presets file. this.ClearBuiltIn(); + bool hasUserDefault = this.flatPresetDict.Values.FirstOrDefault(f => f.IsDefault) != null; + IList presetCategories = HandBrakePresetService.GetBuiltInPresets(); foreach (var category in presetCategories) @@ -435,6 +437,11 @@ namespace HandBrakeWPF.Services.Presets preset.Task.AllowedPassthruOptions = new AllowedPassthru(true); // We don't want to override the built-in preset preset.IsPresetDisabled = this.IsPresetDisabled(preset) || hbpreset.PresetDisabled; + if (hbpreset.Default && hasUserDefault) + { + preset.IsDefault = false; + } + this.Add(preset, true); } } -- cgit v1.2.3