summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorsr55 <[email protected]>2017-09-10 19:36:58 +0100
committersr55 <[email protected]>2017-09-10 19:36:58 +0100
commitcdf5d4daa96040ece9ca4c7c2b69b15d47ec1269 (patch)
tree9df5642fc3b68f8a119aecfde921800d7ce6bcf8 /win
parentf62627151cf0bcadecfcde9f27b99d0c922a24e1 (diff)
WinGui: Restore Rename / Remove preset options on the More dropdown button. Make selected preset italic with "(default)" when default #833
Diffstat (limited to 'win')
-rw-r--r--win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs9
-rw-r--r--win/CS/HandBrakeWPF/Properties/ResourcesUI.resx3
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs4
-rw-r--r--win/CS/HandBrakeWPF/Views/MainView.xaml29
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
@@ -835,6 +835,15 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to Delete Preset.
+ /// </summary>
+ public static string MainView_PresetRemove {
+ get {
+ return ResourceManager.GetString("MainView_PresetRemove", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Presets.
/// </summary>
public static string MainView_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.</value>
<data name="SummaryView_NoTracks" xml:space="preserve">
<value>No Tracks</value>
</data>
+ <data name="MainView_PresetRemove" xml:space="preserve">
+ <value>Delete Preset</value>
+ </data>
</root> \ 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
}
/// <summary>
@@ -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 @@
<MenuItem Header="_Presets" ItemsSource="{Binding PresetsCategories, Converter={StaticResource presetsMenuConverter}}" />
<Separator />
+ <MenuItem Header="{x:Static Properties:ResourcesUI.MainView_UpdateSelectedPreset}" cal:Message.Attach="[Event Click] = [Action PresetUpdate]" />
+ <MenuItem Header="{x:Static Properties:ResourcesUI.MainView_PresetManage}" cal:Message.Attach="[Event Click] = [Action PresetManage]" />
+ <MenuItem Header="{x:Static Properties:ResourcesUI.MainView_PresetRemove}" cal:Message.Attach="[Event Click] = [Action PresetRemove]" />
+ <Separator />
<MenuItem Header="_Import from file" cal:Message.Attach="[Event Click] = [Action PresetImport]" />
<MenuItem Header="_Export to file" cal:Message.Attach="[Event Click] = [Action PresetExport]" />
<Separator />
@@ -328,7 +332,28 @@
<Label Content="Presets" FontWeight="Bold" VerticalAlignment="Center" />
<StackPanel Orientation="Horizontal" Margin="8,0,0,0">
<ComboBox ItemsSource="{Binding PresetsCategories}" SelectedItem="{Binding SelectedPresetCategory}" Width="150" DisplayMemberPath="Category" Margin="5,0,0,0" VerticalAlignment="Center" />
- <ComboBox ItemsSource="{Binding CategoryPresets}" SelectedItem="{Binding SelectedPreset}" DisplayMemberPath="Name" Width="250" Margin="10,0,0,0" VerticalAlignment="Center" />
+ <ComboBox ItemsSource="{Binding CategoryPresets}" SelectedItem="{Binding SelectedPreset}" Width="250" Margin="10,0,0,0" VerticalAlignment="Center">
+
+ <ComboBox.ItemTemplate>
+ <DataTemplate>
+ <StackPanel Orientation="Horizontal">
+ <StackPanel.Resources>
+ <Style TargetType="TextBlock">
+ <Setter Property="FontStyle" Value="Normal" />
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding Path=IsDefault}" Value="True">
+ <Setter Property="FontStyle" Value="Italic" />
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+
+ </StackPanel.Resources>
+ <TextBlock Text="{Binding Name}" />
+ <TextBlock Text="(Default)" Visibility="{Binding IsDefault, Converter={StaticResource boolToVisConverter}}" Margin="5,0,0,0" />
+ </StackPanel>
+ </DataTemplate>
+ </ComboBox.ItemTemplate>
+ </ComboBox>
<Button Content="Reload" cal:Message.Attach="[Event Click] = [Action PresetSelect]" Margin="15,0,0,0" VerticalAlignment="Center" />
<Button Content="Save Custom Preset" cal:Message.Attach="[Event Click] = [Action PresetAdd]" Margin="5,0,0,0" VerticalAlignment="Center" />
@@ -351,6 +376,8 @@
<MenuItem Header="{x:Static Properties:ResourcesUI.MainView_SetDefault}" cal:Message.Attach="[Event Click] = [Action PresetSetDefault]" />
<Separator />
<MenuItem Header="{x:Static Properties:ResourcesUI.MainView_UpdateSelectedPreset}" cal:Message.Attach="[Event Click] = [Action PresetUpdate]" />
+ <MenuItem Header="{x:Static Properties:ResourcesUI.MainView_PresetManage}" cal:Message.Attach="[Event Click] = [Action PresetManage]" />
+ <MenuItem Header="{x:Static Properties:ResourcesUI.MainView_PresetRemove}" cal:Message.Attach="[Event Click] = [Action PresetRemove]" />
<Separator />
<MenuItem Header="{x:Static Properties:ResourcesUI.Preset_Import}" cal:Message.Attach="[Event Click] = [Action PresetImport]" />
<MenuItem Header="{x:Static Properties:ResourcesUI.Preset_Export}" cal:Message.Attach="[Event Click] = [Action PresetExport]" />