From 392005a7d2341fa497f929b7549b749c51c249d6 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 2 Jun 2013 17:02:42 +0000 Subject: WinGui: Some usability improvements around presets. Also trying out a "Hide Presets Panel" option similar to that of the macgui. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5544 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../HandBrakeWPF/Properties/Resources.Designer.cs | 18 ++++++++ win/CS/HandBrakeWPF/Properties/Resources.resx | 6 +++ win/CS/HandBrakeWPF/UserSettingConstants.cs | 5 ++ win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 53 +++++++++++++++++++++- win/CS/HandBrakeWPF/Views/ChaptersView.xaml | 4 +- win/CS/HandBrakeWPF/Views/MainView.xaml | 48 ++++++++++++++++++-- win/CS/HandBrakeWPF/Views/ShellView.xaml | 5 +- win/CS/HandBrakeWPF/defaultsettings.xml | 8 ++++ 8 files changed, 138 insertions(+), 9 deletions(-) (limited to 'win/CS') diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs index bef7d7030..337952dfe 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs @@ -347,6 +347,24 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to The Built-in presets have been reset.. + /// + public static string Presets_ResetComplete { + get { + return ResourceManager.GetString("Presets_ResetComplete", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reset Complete. + /// + public static string Presets_ResetHeader { + get { + return ResourceManager.GetString("Presets_ResetHeader", resourceCulture); + } + } + /// /// Looks up a localized string similar to WARNING: You do not have automatic file naming turned on. Please enable this in options.. /// diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx index 180d0abc5..48f8ca27e 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.resx +++ b/win/CS/HandBrakeWPF/Properties/Resources.resx @@ -337,4 +337,10 @@ If you do not use this tab, it can be hidden from: Tools Menu > Options > WARNING: You do not currently have automatic audio and subtitle track selection setup. You can setup the default track selection behaviour in options. + + The Built-in presets have been reset. + + + Reset Complete + \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/UserSettingConstants.cs b/win/CS/HandBrakeWPF/UserSettingConstants.cs index 4ab98cdfd..b01134b91 100644 --- a/win/CS/HandBrakeWPF/UserSettingConstants.cs +++ b/win/CS/HandBrakeWPF/UserSettingConstants.cs @@ -231,6 +231,11 @@ namespace HandBrakeWPF /// public const string RemovePunctuation = "RemovePunctuation"; + /// + /// The Show Preset Panel + /// + public const string ShowPresetPanel = "ShowPresetPanel"; + #endregion } } \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index fd896f197..c7fcbd0ae 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -33,6 +33,7 @@ namespace HandBrakeWPF.ViewModels using HandBrakeWPF.Commands; using HandBrakeWPF.Helpers; using HandBrakeWPF.Model; + using HandBrakeWPF.Properties; using HandBrakeWPF.Services.Interfaces; using HandBrakeWPF.ViewModels.Interfaces; using HandBrakeWPF.Views; @@ -169,6 +170,12 @@ namespace HandBrakeWPF.ViewModels /// The last percentage complete value. /// private int lastEncodePercentage; + + /// + /// The is preset panel showing. + /// + private bool isPresetPanelShowing; + #endregion /// @@ -692,7 +699,7 @@ namespace HandBrakeWPF.ViewModels if (this.UserSettingService.GetUserSetting(UserSettingConstants.AutoNaming)) { - if (this.userSettingService.GetUserSetting(UserSettingConstants.AutoNameFormat) != null ) + if (this.userSettingService.GetUserSetting(UserSettingConstants.AutoNameFormat) != null) { this.Destination = AutoNameHelper.AutoName(this.CurrentTask, this.SourceName); } @@ -890,6 +897,31 @@ namespace HandBrakeWPF.ViewModels } } + /// + /// Gets or sets a value indicating whether is preset panel showing. + /// + public bool IsPresetPanelShowing + { + get + { + return this.isPresetPanelShowing; + } + set + { + if (!object.Equals(this.isPresetPanelShowing, value)) + { + this.isPresetPanelShowing = value; + this.NotifyOfPropertyChange(() => this.IsPresetPanelShowing); + + // Save the setting if it has changed. + if (this.userSettingService.GetUserSetting(UserSettingConstants.ShowPresetPanel) != value) + { + this.userSettingService.SetUserSetting(UserSettingConstants.ShowPresetPanel, value); + } + } + } + } + #endregion #region Load and Shutdown Handling @@ -919,6 +951,9 @@ namespace HandBrakeWPF.ViewModels // Populate the Source menu with drives. this.SourceMenu = new BindingList(this.GenerateSourceMenu()); + // Show or Hide the Preset Panel. + this.IsPresetPanelShowing = this.userSettingService.GetUserSetting(UserSettingConstants.ShowPresetPanel); + // Log Cleaning if (userSettingService.GetUserSetting(UserSettingConstants.ClearOldLogs)) { @@ -1561,6 +1596,22 @@ namespace HandBrakeWPF.ViewModels this.presetService.UpdateBuiltInPresets(); this.NotifyOfPropertyChange("Presets"); this.SelectedPreset = this.presetService.DefaultPreset; + this.errorService.ShowMessageBox(Resources.Presets_ResetComplete, Resources.Presets_ResetHeader, MessageBoxButton.OK, MessageBoxImage.Information); + } + + /// + /// The preset select. + /// + /// + /// The tag. + /// + public void PresetSelect(object tag) + { + Preset preset = tag as Preset; + if (preset != null) + { + this.SelectedPreset = preset; + } } /// diff --git a/win/CS/HandBrakeWPF/Views/ChaptersView.xaml b/win/CS/HandBrakeWPF/Views/ChaptersView.xaml index 0895579f5..583e2c41d 100644 --- a/win/CS/HandBrakeWPF/Views/ChaptersView.xaml +++ b/win/CS/HandBrakeWPF/Views/ChaptersView.xaml @@ -3,6 +3,8 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:cal="http://www.caliburnproject.org" + d:DesignHeight="170" + d:DesignWidth="616" mc:Ignorable="d" > @@ -26,7 +28,7 @@ diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml index 8d7575f54..fd95a5b53 100644 --- a/win/CS/HandBrakeWPF/Views/MainView.xaml +++ b/win/CS/HandBrakeWPF/Views/MainView.xaml @@ -121,6 +121,45 @@ + + + + + + + + + + + + + + + + + + + + + @@ -323,8 +362,8 @@ - - + + @@ -379,7 +418,7 @@ Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" /> - +