From 776c2d3d93c08c6cc12d9fc42bc290c3e57772ff Mon Sep 17 00:00:00 2001 From: sr55 Date: Mon, 14 Jan 2019 21:18:29 +0000 Subject: [PATCH] WinGui: Make the toolbar customisation options more discoverable by making them preferences in the options screen. --- .../Properties/Resources.Designer.cs | 27 ++++++++++++++ win/CS/HandBrakeWPF/Properties/Resources.resx | 9 +++++ .../HandBrakeWPF/ViewModels/MainViewModel.cs | 15 ++++---- .../ViewModels/OptionsViewModel.cs | 35 +++++++++++++++++-- win/CS/HandBrakeWPF/Views/OptionsView.xaml | 7 ++++ 5 files changed, 84 insertions(+), 9 deletions(-) diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs index 4f3e11702..f63893372 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs @@ -2436,6 +2436,15 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to Application Toolbar. + /// + public static string Options_ApplicaitonToolbar { + get { + return ResourceManager.GetString("Options_ApplicaitonToolbar", resourceCulture); + } + } + /// /// Looks up a localized string similar to Arguments:. /// @@ -2843,6 +2852,24 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to Show 'Add All to Queue' on the toolbar. + /// + public static string Options_ShowToolbarAddAll { + get { + return ResourceManager.GetString("Options_ShowToolbarAddAll", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show 'Add Selection to Queue' on the toolbar. + /// + public static string Options_ShowToolbarAddSelection { + get { + return ResourceManager.GetString("Options_ShowToolbarAddSelection", resourceCulture); + } + } + /// /// Looks up a localized string similar to Change case to Title Case. /// diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx index b432b9eeb..f611f0020 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.resx +++ b/win/CS/HandBrakeWPF/Properties/Resources.resx @@ -1888,4 +1888,13 @@ This will not affect your current settings in the Subtitle tab. Play File + + Application Toolbar + + + Show 'Add All to Queue' on the toolbar + + + Show 'Add Selection to Queue' on the toolbar + \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 4c6f3ad4c..857ce9c42 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -2606,15 +2606,16 @@ namespace HandBrakeWPF.ViewModels case UserSettingConstants.WhenCompleteAction: this.QueueViewModel.WhenDone(this.userSettingService.GetUserSetting(UserSettingConstants.WhenCompleteAction), false); break; - } - - this.NotifyOfPropertyChange(() => this.ShowAddAllToQueue); - this.NotifyOfPropertyChange(() => this.ShowAddSelectionToQueue); - this.NotifyOfPropertyChange(() => this.ShowAddAllMenuName); - this.NotifyOfPropertyChange(() => this.ShowAddSelectionMenuName); + case UserSettingConstants.ShowAddAllToQueue: + case UserSettingConstants.ShowAddSelectionToQueue: + this.NotifyOfPropertyChange(() => this.ShowAddAllToQueue); + this.NotifyOfPropertyChange(() => this.ShowAddSelectionToQueue); + this.NotifyOfPropertyChange(() => this.ShowAddAllMenuName); + this.NotifyOfPropertyChange(() => this.ShowAddSelectionMenuName); + break; + } } - #endregion } } \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs index e18074681..cf63d1daf 100644 --- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs @@ -104,6 +104,10 @@ namespace HandBrakeWPF.ViewModels private InterfaceLanguage selectedLanguage; + private bool showAddSelectionToQueue; + + private bool showAddAllToQueue; + #endregion #region Constructors and Destructors @@ -491,6 +495,28 @@ namespace HandBrakeWPF.ViewModels } } + public bool ShowAddSelectionToQueue + { + get => this.showAddSelectionToQueue; + set + { + if (value == this.showAddSelectionToQueue) return; + this.showAddSelectionToQueue = value; + this.NotifyOfPropertyChange(() => this.ShowAddSelectionToQueue); + } + } + + public bool ShowAddAllToQueue + { + get => this.showAddAllToQueue; + set + { + if (value == this.showAddAllToQueue) return; + this.showAddAllToQueue = value; + this.NotifyOfPropertyChange(() => this.ShowAddAllToQueue); + } + } + #endregion #region Output Files @@ -1351,7 +1377,7 @@ namespace HandBrakeWPF.ViewModels this.CheckForUpdatesFrequency = 1; } - // On Encode Completeion Action + // On Encode Completion Action this.whenDoneOptions.Clear(); this.whenDoneOptions.Add("Do nothing"); this.whenDoneOptions.Add("Shutdown"); @@ -1379,7 +1405,10 @@ namespace HandBrakeWPF.ViewModels this.PlaySoundWhenDone = this.userSettingService.GetUserSetting(UserSettingConstants.PlaySoundWhenDone); this.PlaySoundWhenQueueDone = this.userSettingService.GetUserSetting(UserSettingConstants.PlaySoundWhenQueueDone); this.ShowExperimentalQueue = this.userSettingService.GetUserSetting(UserSettingConstants.ShowExperimentalQueue); - + + this.ShowAddAllToQueue = this.userSettingService.GetUserSetting(UserSettingConstants.ShowAddAllToQueue); + this.ShowAddSelectionToQueue = this.userSettingService.GetUserSetting(UserSettingConstants.ShowAddSelectionToQueue); + // ############################# // Output Settings // ############################# @@ -1545,6 +1574,8 @@ namespace HandBrakeWPF.ViewModels this.userSettingService.SetUserSetting(UserSettingConstants.PlaySoundWhenQueueDone, this.PlaySoundWhenQueueDone); this.userSettingService.SetUserSetting(UserSettingConstants.WhenDoneAudioFile, this.WhenDoneAudioFileFullPath); this.userSettingService.SetUserSetting(UserSettingConstants.UiLanguage, this.SelectedLanguage?.Culture); + this.userSettingService.SetUserSetting(UserSettingConstants.ShowAddAllToQueue, this.ShowAddAllToQueue); + this.userSettingService.SetUserSetting(UserSettingConstants.ShowAddSelectionToQueue, this.ShowAddSelectionToQueue); /* Experiments */ this.userSettingService.SetUserSetting(UserSettingConstants.ShowQueueInline, this.ShowQueueInline); diff --git a/win/CS/HandBrakeWPF/Views/OptionsView.xaml b/win/CS/HandBrakeWPF/Views/OptionsView.xaml index 2df373a0c..a4502e5ba 100644 --- a/win/CS/HandBrakeWPF/Views/OptionsView.xaml +++ b/win/CS/HandBrakeWPF/Views/OptionsView.xaml @@ -121,6 +121,13 @@ + + + + + + + -- 2.40.0