}\r
}\r
\r
+ /// <summary>\r
+ /// Looks up a localized string similar to Custom.\r
+ /// </summary>\r
+ public static string Preset_Custom {\r
+ get {\r
+ return ResourceManager.GetString("Preset_Custom", resourceCulture);\r
+ }\r
+ }\r
+ \r
/// <summary>\r
/// Looks up a localized string similar to Export to file.\r
/// </summary>\r
}\r
}\r
\r
+ /// <summary>\r
+ /// Looks up a localized string similar to Official.\r
+ /// </summary>\r
+ public static string Preset_Official {\r
+ get {\r
+ return ResourceManager.GetString("Preset_Official", resourceCulture);\r
+ }\r
+ }\r
+ \r
/// <summary>\r
/// Looks up a localized string similar to Change the behaviour of the subtitle track selection for this preset. \r
///This will not affect your current settings in the Subtitle tab..\r
}\r
}\r
\r
- /// <summary>\r
- /// Looks up a localized string similar to Import Queue.\r
- /// </summary>\r
- public static string QueueView_Import {\r
- get {\r
- return ResourceManager.GetString("QueueView_Import", resourceCulture);\r
- }\r
- }\r
- \r
/// <summary>\r
/// Looks up a localized string similar to Lock System.\r
/// </summary>\r
<data name="QueueView_Hibernate" xml:space="preserve">\r
<value>Hibernate</value>\r
</data>\r
- <data name="QueueView_Import" xml:space="preserve">\r
- <value>Import Queue</value>\r
- </data>\r
<data name="QueueView_LockSystem" xml:space="preserve">\r
<value>Lock System</value>\r
</data>\r
<data name="MainView_PresetRemove" xml:space="preserve">\r
<value>Delete Preset</value>\r
</data>\r
+ <data name="Preset_Custom" xml:space="preserve">\r
+ <value>Custom</value>\r
+ </data>\r
+ <data name="Preset_Official" xml:space="preserve">\r
+ <value>Official</value>\r
+ </data>\r
</root>
\ No newline at end of file
\r
using HandBrakeWPF.Model.Audio;\r
using HandBrakeWPF.Model.Subtitles;\r
+ using HandBrakeWPF.Properties;\r
using HandBrakeWPF.Services.Presets.Interfaces;\r
\r
using EncodeTask = HandBrakeWPF.Services.Encode.Model.EncodeTask;\r
/// </summary>\r
public bool IsExpanded { get; set; }\r
\r
+ public string DisplayValue\r
+ {\r
+ get\r
+ {\r
+ string globalCateogry = this.IsBuildIn ? ResourcesUI.Preset_Official : ResourcesUI.Preset_Custom;\r
+ return string.Format("{0} > {1} > {2}", globalCateogry, this.Category, this.Name);\r
+ }\r
+ }\r
+\r
public bool IsSelected\r
{\r
get\r
<MenuItem Command="{Binding QueueCommand}" CommandParameter="{x:Static menu:QueueCommandParams.ClearAll}" Header="{x:Static Properties:ResourcesUI.QueueView_ClearAll}" Visibility="{Binding IsQueueShowingInLine, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />\r
<MenuItem Command="{Binding QueueCommand}" CommandParameter="{x:Static menu:QueueCommandParams.ClearSelected}" Header="{x:Static Properties:ResourcesUI.QueueView_ClearSelected}" Visibility="{Binding IsQueueShowingInLine, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />\r
<Separator Visibility="{Binding IsQueueShowingInLine, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />\r
- <MenuItem Command="{Binding QueueCommand}" CommandParameter="{x:Static menu:QueueCommandParams.Import}" Header="{x:Static Properties:ResourcesUI.QueueView_Import}" Visibility="{Binding IsQueueShowingInLine, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />\r
<MenuItem Command="{Binding QueueCommand}" CommandParameter="{x:Static menu:QueueCommandParams.Export}" Header="{x:Static Properties:ResourcesUI.QueueView_Export}" Visibility="{Binding IsQueueShowingInLine, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />\r
</MenuItem>\r
\r
<StackPanel Grid.Row="1" Orientation="Vertical" Margin="10,5,10,5">\r
<Label Content="Presets" FontWeight="Bold" VerticalAlignment="Center" />\r
<StackPanel Orientation="Horizontal" Margin="8,0,0,0" Visibility="{Binding IsPresetPanelShowing, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}">\r
- <ComboBox ItemsSource="{Binding PresetsCategories}" SelectedItem="{Binding SelectedPresetCategory}" Width="150" DisplayMemberPath="Category" Margin="5,0,0,0" VerticalAlignment="Center" />\r
+\r
+ <Button x:Name="SelectPresetsButton" Margin="15,0,0,0" VerticalAlignment="Center" Click="SelectPreset_OnClick" Width="350">\r
+ <Button.Content>\r
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Stretch">\r
+ <TextBlock Margin="0,0,5,0" Padding="0"\r
+ VerticalAlignment="Center" Width="315"\r
+ Text="{Binding SelectedPreset.DisplayValue}" />\r
+\r
+ <Path Height="8" Margin="2,0,0,1" VerticalAlignment="Center" HorizontalAlignment="Center"\r
+ Data="M 0 0 L 4 4 L 0 8 Z"\r
+ Fill="{DynamicResource GlyphBrush}" x:Name="dropdownArrowSelectPreset" />\r
+ </StackPanel>\r
+ </Button.Content>\r
+\r
+ <Button.ContextMenu>\r
+ <ContextMenu x:Name="PresetSelectContextMenu" \r
+ PlacementRectangle="{Binding RelativeSource={RelativeSource Self}}" \r
+ ItemsSource="{Binding PresetsCategories, Converter={StaticResource presetsMenuConverter}}">\r
+ </ContextMenu>\r
+ </Button.ContextMenu>\r
+ </Button>\r
+ \r
+ <!--<ComboBox ItemsSource="{Binding PresetsCategories}" SelectedItem="{Binding SelectedPresetCategory}" Width="150" DisplayMemberPath="Category" Margin="5,0,0,0" VerticalAlignment="Center" />\r
<ComboBox ItemsSource="{Binding CategoryPresets}" SelectedItem="{Binding SelectedPreset}" Width="250" Margin="10,0,0,0" VerticalAlignment="Center">\r
<ComboBox.Resources>\r
<Style TargetType="ToolTip">\r
</StackPanel>\r
</DataTemplate>\r
</ComboBox.ItemTemplate>\r
- </ComboBox>\r
+ </ComboBox>-->\r
\r
<Button Content="Reload" cal:Message.Attach="[Event Click] = [Action PresetSelect]" Margin="15,0,0,0" VerticalAlignment="Center" />\r
<Button Content="Save Custom Preset" cal:Message.Attach="[Event Click] = [Action PresetAdd]" Margin="5,0,0,0" VerticalAlignment="Center" />\r
}\r
}\r
\r
+ private void SelectPreset_OnClick(object sender, RoutedEventArgs e)\r
+ {\r
+ var button = sender as FrameworkElement;\r
+ if (button != null && button.ContextMenu != null)\r
+ {\r
+ button.ContextMenu.PlacementTarget = button;\r
+ button.ContextMenu.Placement = System.Windows.Controls.Primitives.PlacementMode.Right;\r
+ button.ContextMenu.IsOpen = true;\r
+ }\r
+ }\r
+\r
private void ToolBarLoaded(object sender, RoutedEventArgs e)\r
{\r
ToolBar toolBar = sender as ToolBar;\r
<MenuItem cal:Message.Attach="[Event Click] = [Action Clear]" Header="{x:Static Properties:ResourcesUI.QueueView_ClearAll}" />
<MenuItem cal:Message.Attach="[Event Click] = [Action RemoveSelectedJobs]" Header="{x:Static Properties:ResourcesUI.QueueView_ClearSelected}" />
<Separator />
- <MenuItem cal:Message.Attach="[Event Click] = [Action Import]" Header="{x:Static Properties:ResourcesUI.QueueView_Import}" />
<MenuItem cal:Message.Attach="[Event Click] = [Action Export]" Header="{x:Static Properties:ResourcesUI.QueueView_Export}" />
</ContextMenu>
</ListBox.ContextMenu>
<MenuItem cal:Message.Attach="[Event Click] = [Action ClearCompleted]" Header="{x:Static Properties:ResourcesUI.QueueView_ClearCompleted}" />\r
<MenuItem cal:Message.Attach="[Event Click] = [Action Clear]" Header="{x:Static Properties:ResourcesUI.QueueView_ClearQueue}" />\r
<Separator />\r
- <!--<MenuItem cal:Message.Attach="[Event Click] = [Action Import]" Header="{x:Static Properties:ResourcesUI.QueueView_Import}" />-->\r
<MenuItem cal:Message.Attach="[Event Click] = [Action Export]" Header="{x:Static Properties:ResourcesUI.QueueView_Export}" />\r
\r
</MenuItem>\r
<MenuItem Header="{x:Static Properties:ResourcesUI.QueueView_OpenSourceDir}" x:Name="openSourceDir" Click="OpenSourceDir_OnClick" />\r
<MenuItem Header="{x:Static Properties:ResourcesUI.QueueView_OpenDestDir}" x:Name="openDestDir" Click="OpenDestDir_OnClick" />\r
<Separator />\r
- <!--<MenuItem cal:Message.Attach="[Event Click] = [Action Import]" Header="{x:Static Properties:ResourcesUI.QueueView_Import}" />-->\r
<MenuItem cal:Message.Attach="[Event Click] = [Action Export]" Header="{x:Static Properties:ResourcesUI.QueueView_Export}" />\r
</ContextMenu>\r
</ListBox.ContextMenu>\r