From cdf5d4daa96040ece9ca4c7c2b69b15d47ec1269 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 10 Sep 2017 19:36:58 +0100 Subject: [PATCH] WinGui: Restore Rename / Remove preset options on the More dropdown button. Make selected preset italic with "(default)" when default #833 --- .../Properties/ResourcesUI.Designer.cs | 9 ++++++ .../HandBrakeWPF/Properties/ResourcesUI.resx | 3 ++ .../HandBrakeWPF/ViewModels/MainViewModel.cs | 4 ++- win/CS/HandBrakeWPF/Views/MainView.xaml | 29 ++++++++++++++++++- 4 files changed, 43 insertions(+), 2 deletions(-) diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs index c132ff043..29bf21352 100644 --- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs @@ -834,6 +834,15 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to Delete Preset. + /// + public static string MainView_PresetRemove { + get { + return ResourceManager.GetString("MainView_PresetRemove", resourceCulture); + } + } + /// /// Looks up a localized string similar to Presets. /// diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx index 11b3727b1..0fa80b85b 100644 --- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx +++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx @@ -977,4 +977,7 @@ This will not affect your current settings in the Subtitle tab. No Tracks + + Delete Preset + \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index b65250e69..de4476367 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -1896,7 +1896,8 @@ namespace HandBrakeWPF.ViewModels this.windowManager.ShowDialog(presetViewModel); Preset preset = presetViewModel.Preset; - this.SelectedPreset = preset; // Reselect the preset + this.NotifyOfPropertyChange(() => this.CategoryPresets); + this.SelectedPreset = preset; // Reselect the preset } /// @@ -1931,6 +1932,7 @@ namespace HandBrakeWPF.ViewModels this.presetService.Remove(this.selectedPreset); this.NotifyOfPropertyChange(() => this.CategoryPresets); + this.SelectedPreset = this.CategoryPresets.FirstOrDefault(); } else { diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml index 60365e104..d9aed5c98 100644 --- a/win/CS/HandBrakeWPF/Views/MainView.xaml +++ b/win/CS/HandBrakeWPF/Views/MainView.xaml @@ -72,6 +72,10 @@ + + + + @@ -328,7 +332,28 @@