summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
Diffstat (limited to 'win')
-rw-r--r--win/CS/HandBrakeWPF/Properties/Resources.Designer.cs18
-rw-r--r--win/CS/HandBrakeWPF/Properties/Resources.resx6
-rw-r--r--win/CS/HandBrakeWPF/UserSettingConstants.cs5
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs53
-rw-r--r--win/CS/HandBrakeWPF/Views/ChaptersView.xaml4
-rw-r--r--win/CS/HandBrakeWPF/Views/MainView.xaml48
-rw-r--r--win/CS/HandBrakeWPF/Views/ShellView.xaml5
-rw-r--r--win/CS/HandBrakeWPF/defaultsettings.xml8
8 files changed, 138 insertions, 9 deletions
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
@@ -348,6 +348,24 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to The Built-in presets have been reset..
+ /// </summary>
+ public static string Presets_ResetComplete {
+ get {
+ return ResourceManager.GetString("Presets_ResetComplete", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Reset Complete.
+ /// </summary>
+ public static string Presets_ResetHeader {
+ get {
+ return ResourceManager.GetString("Presets_ResetHeader", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to WARNING: You do not have automatic file naming turned on. Please enable this in options..
/// </summary>
public static string QueueSelection_AutoNameWarning {
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 &gt; Options &gt;
<data name="QueueSelection_AutoTrackSelectionWarning" xml:space="preserve">
<value>WARNING: You do not currently have automatic audio and subtitle track selection setup. You can setup the default track selection behaviour in options.</value>
</data>
+ <data name="Presets_ResetComplete" xml:space="preserve">
+ <value>The Built-in presets have been reset.</value>
+ </data>
+ <data name="Presets_ResetHeader" xml:space="preserve">
+ <value>Reset Complete</value>
+ </data>
</root> \ 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
/// </summary>
public const string RemovePunctuation = "RemovePunctuation";
+ /// <summary>
+ /// The Show Preset Panel
+ /// </summary>
+ 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.
/// </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>
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" >
<Grid>
<Grid.RowDefinitions>
@@ -26,7 +28,7 @@
</Grid>
<DataGrid Grid.Row="2" Margin="10" ItemsSource="{Binding Task.ChapterNames}"
- VerticalAlignment="Stretch" HorizontalAlignment="Stretch" AutoGenerateColumns="False"
+ VerticalAlignment="Stretch" AutoGenerateColumns="False"
CanUserSortColumns="False" CanUserReorderColumns="False" CanUserResizeColumns="False" CanUserResizeRows="False"
CanUserAddRows="False" CanUserDeleteRows="False">
<DataGrid.CellStyle>
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 @@
</MenuItem>
</MenuItem>
+
+ <MenuItem Header="Presets" x:Name="presetMenu">
+ <MenuItem Header="Presets" ItemsSource="{Binding Presets}">
+ <MenuItem.ItemContainerStyle>
+ <Style TargetType="MenuItem">
+ <Setter Property="Tag" Value="{Binding}" />
+ <Setter Property="Micro:Action.TargetWithoutContext" Value="{Binding DataContext, ElementName=presetMenu}"/>
+ <Setter Property="Micro:Message.Attach" Value="[Event Click] = [Action PresetSelect($this.Tag)]"/>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding IsDefault}" Value="True">
+ <Setter Property="FontStyle" Value="Italic" />
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </MenuItem.ItemContainerStyle>
+ </MenuItem>
+ <Separator />
+ <MenuItem Header="Import" Micro:Message.Attach="[Event Click] = [Action PresetImport]" />
+ <MenuItem Header="Export" Micro:Message.Attach="[Event Click] = [Action PresetExport]" />
+ <Separator />
+ <MenuItem Header="Set Current as Default" Micro:Message.Attach="[Event Click] = [Action PresetSetDefault]" />
+ <MenuItem Header="Reset Built-In Presets" Micro:Message.Attach="[Event Click] = [Action PresetReset]" />
+ <Separator />
+ <MenuItem IsCheckable="True" x:Name="showPresetPanelMenuItem" IsChecked="{Binding IsPresetPanelShowing}">
+ <MenuItem.Style>
+ <Style TargetType="MenuItem">
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding IsChecked, ElementName=showPresetPanelMenuItem}" Value="True">
+ <Setter Property="Header" Value="Hide Preset Panel"/>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding IsChecked, ElementName=showPresetPanelMenuItem}" Value="False">
+ <Setter Property="Header" Value="Show Preset Panel"/>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </MenuItem.Style>
+ </MenuItem>
+ </MenuItem>
+
<MenuItem Header="Help">
<MenuItem Header="HandBrake User Guide (HTTP)" Micro:Message.Attach="[Event Click] = [Action LaunchHelp]">
<MenuItem.Icon>
@@ -323,8 +362,8 @@
<!-- Main Body -->
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="270" />
+ <ColumnDefinition Width="*" MinWidth="700"/>
+ <ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@@ -379,7 +418,7 @@
Converter={StaticResource boolToVisConverter},
ConverterParameter=false}"
/>
-
+
<Label Margin="8,0,0,0" Content="through" />
<ComboBox Name="EndPoint"
MinWidth="60"
@@ -396,7 +435,7 @@
Converter={StaticResource boolToVisConverter},
ConverterParameter=false}"
/>
-
+
<Label Margin="8,0,0,0" Content="Duration" />
<Label Margin="8,0,0,0" Content="{Binding Duration}" />
</StackPanel>
@@ -515,6 +554,7 @@
Header="Presets"
Margin="0,0,0,5"
Background="White"
+ Visibility="{Binding IsPresetPanelShowing, Converter={StaticResource boolToVisConverter}}"
>
<Grid>
<Grid.RowDefinitions>
diff --git a/win/CS/HandBrakeWPF/Views/ShellView.xaml b/win/CS/HandBrakeWPF/Views/ShellView.xaml
index bfc65c035..d719b16fd 100644
--- a/win/CS/HandBrakeWPF/Views/ShellView.xaml
+++ b/win/CS/HandBrakeWPF/Views/ShellView.xaml
@@ -4,12 +4,11 @@
xmlns:Data="clr-namespace:System.Windows.Data;assembly=PresentationFramework"
xmlns:Converters="clr-namespace:HandBrakeWPF.Converters" Title="{Data:Binding Path=WindowTitle}"
Width="1015"
- Height="680"
- MinWidth="1015"
+ Height="670"
+ MinWidth="750"
MinHeight="670"
AllowDrop="True"
Background="#FFF0F0F0"
- FontSize="11"
SnapsToDevicePixels="True"
UseLayoutRounding="True"
WindowStartupLocation="CenterScreen"
diff --git a/win/CS/HandBrakeWPF/defaultsettings.xml b/win/CS/HandBrakeWPF/defaultsettings.xml
index f7c04f4fb..7ba21e103 100644
--- a/win/CS/HandBrakeWPF/defaultsettings.xml
+++ b/win/CS/HandBrakeWPF/defaultsettings.xml
@@ -456,4 +456,12 @@
<anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:boolean" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">false</anyType>
</value>
</item>
+ <item>
+ <key>
+ <string>ShowPresetPanel</string>
+ </key>
+ <value>
+ <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:boolean" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">true</anyType>
+ </value>
+ </item>
</dictionary> \ No newline at end of file