summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2013-06-02 17:02:42 +0000
committersr55 <[email protected]>2013-06-02 17:02:42 +0000
commit392005a7d2341fa497f929b7549b749c51c249d6 (patch)
treef007591e4fc2839a547bdef5049854a972a5c818 /win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
parent1d0553ef556d8979e0c4897cd77a5d6ceaec8221 (diff)
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
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs53
1 files changed, 52 insertions, 1 deletions
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.
/// </summary>
private int lastEncodePercentage;
+
+ /// <summary>
+ /// The is preset panel showing.
+ /// </summary>
+ private bool isPresetPanelShowing;
+
#endregion
/// <summary>
@@ -692,7 +699,7 @@ namespace HandBrakeWPF.ViewModels
if (this.UserSettingService.GetUserSetting<bool>(UserSettingConstants.AutoNaming))
{
- if (this.userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNameFormat) != null )
+ if (this.userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNameFormat) != null)
{
this.Destination = AutoNameHelper.AutoName(this.CurrentTask, this.SourceName);
}
@@ -890,6 +897,31 @@ namespace HandBrakeWPF.ViewModels
}
}
+ /// <summary>
+ /// Gets or sets a value indicating whether is preset panel showing.
+ /// </summary>
+ 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<bool>(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<SourceMenuItem>(this.GenerateSourceMenu());
+ // Show or Hide the Preset Panel.
+ this.IsPresetPanelShowing = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowPresetPanel);
+
// Log Cleaning
if (userSettingService.GetUserSetting<bool>(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);
+ }
+
+ /// <summary>
+ /// The preset select.
+ /// </summary>
+ /// <param name="tag">
+ /// The tag.
+ /// </param>
+ public void PresetSelect(object tag)
+ {
+ Preset preset = tag as Preset;
+ if (preset != null)
+ {
+ this.SelectedPreset = preset;
+ }
}
/// <summary>