diff options
author | sr55 <[email protected]> | 2016-02-02 19:41:36 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2016-02-02 19:41:36 +0000 |
commit | c9009243ac3f176c5b6a0e9564b794c487676aa8 (patch) | |
tree | 941db65e143ef2539e1a529045195fa276c4086f /win/CS/HandBrakeWPF | |
parent | 4a69d9887ff849673c21d2807afafb4c9f8fcb7d (diff) |
WinGui: Couple of UI Tweaks.
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r-- | win/CS/HandBrakeWPF/Converters/Options/LogLevelConverter.cs | 95 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/HandBrakeWPF.csproj | 1 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs | 11 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Properties/ResourcesUI.resx | 5 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/AudioView.xaml | 2 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/MainView.xaml | 2 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/OptionsView.xaml | 6 |
7 files changed, 116 insertions, 6 deletions
diff --git a/win/CS/HandBrakeWPF/Converters/Options/LogLevelConverter.cs b/win/CS/HandBrakeWPF/Converters/Options/LogLevelConverter.cs new file mode 100644 index 000000000..36fafefd2 --- /dev/null +++ b/win/CS/HandBrakeWPF/Converters/Options/LogLevelConverter.cs @@ -0,0 +1,95 @@ +// -------------------------------------------------------------------------------------------------------------------- +// <copyright file="LogLevelConverter.cs" company="HandBrake Project (http://handbrake.fr)"> +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// </copyright> +// <summary> +// Defines the LogLevelConverter type. +// </summary> +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrakeWPF.Converters.Options +{ + using System; + using System.Collections.Generic; + using System.ComponentModel; + using System.Globalization; + using System.Windows.Data; + + /// <summary> + /// The log level converter. + /// </summary> + public class LogLevelConverter : IValueConverter + { + /// <summary> + /// The convert. + /// </summary> + /// <param name="value"> + /// The value. + /// </param> + /// <param name="targetType"> + /// The target type. + /// </param> + /// <param name="parameter"> + /// The parameter. + /// </param> + /// <param name="culture"> + /// The culture. + /// </param> + /// <returns> + /// The <see cref="object"/>. + /// </returns> + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value.GetType() == typeof(BindingList<int>)) + { + return new List<string> { "Minimised", "Standard", "Extended" }; + } + else if (value is int) + { + switch ((int)value) + { + case 0: + return "Minimised"; + case 2: + return "Extended"; + default: + return "Standard"; + } + } + + return null; + } + + /// <summary> + /// The convert back. + /// </summary> + /// <param name="value"> + /// The value. + /// </param> + /// <param name="targetType"> + /// The target type. + /// </param> + /// <param name="parameter"> + /// The parameter. + /// </param> + /// <param name="culture"> + /// The culture. + /// </param> + /// <returns> + /// The <see cref="object"/>. + /// </returns> + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + switch ((string)value) + { + case "Minimised": + return 0; + case "Extended": + return 2; + default: + case "Standard": + return 1; + } + } + } +} diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj index 4d09ded8f..85328d652 100644 --- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj +++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj @@ -144,6 +144,7 @@ <Compile Include="Converters\Audio\AudioBehaviourConverter.cs" />
<Compile Include="Converters\EnumToDescConverter.cs" />
<Compile Include="Converters\Filters\DenoisePresetConverter.cs" />
+ <Compile Include="Converters\Options\LogLevelConverter.cs" />
<Compile Include="Converters\Queue\PictureSettingsDescConveter.cs" />
<Compile Include="Converters\Subtitles\SubtitleBurnInBehaviourConverter.cs" />
<Compile Include="Converters\Subtitles\SubtitleBehaviourConverter.cs" />
diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs index 768212338..0ecbb9446 100644 --- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs @@ -817,6 +817,15 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
+ /// Looks up a localized string similar to Open Source.
+ /// </summary>
+ public static string MainView_SourceOpen {
+ get {
+ return ResourceManager.GetString("MainView_SourceOpen", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Start Encode.
/// </summary>
public static string MainView_StartEncode {
@@ -1078,7 +1087,7 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
- /// Looks up a localized string similar to Enable DXVA Hardware Accelerated Decoding (Experimental)".
+ /// Looks up a localized string similar to Enable DXVA Hardware Accelerated Decoding.
/// </summary>
public static string Options_DXVA {
get {
diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx index 79ef0cf6b..98acf368e 100644 --- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx +++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx @@ -736,7 +736,7 @@ <value>Disable LibDVDNav. (libdvdread will be used instead)</value>
</data>
<data name="Options_DXVA" xml:space="preserve">
- <value>Enable DXVA Hardware Accelerated Decoding (Experimental)"</value>
+ <value>Enable DXVA Hardware Accelerated Decoding</value>
</data>
<data name="Options_Format" xml:space="preserve">
<value>Format:</value>
@@ -846,4 +846,7 @@ <data name="FiltersView_Rotate" xml:space="preserve">
<value>Rotate:</value>
</data>
+ <data name="MainView_SourceOpen" xml:space="preserve">
+ <value>Open Source</value>
+ </data>
</root>
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Views/AudioView.xaml b/win/CS/HandBrakeWPF/Views/AudioView.xaml index 1fddda1be..a0fa960f5 100644 --- a/win/CS/HandBrakeWPF/Views/AudioView.xaml +++ b/win/CS/HandBrakeWPF/Views/AudioView.xaml @@ -389,7 +389,7 @@ <TextBlock Margin="15,0,5,0" Text="{x:Static Properties:ResourcesUI.AudioView_OtherwiseFallbackEncoder}" />
- <ComboBox VerticalAlignment="Center" Width="105" Height="22" Margin="10,0,5,0">
+ <ComboBox VerticalAlignment="Center" Width="105" Height="22" Margin="5,0,5,0">
<ComboBox.SelectedItem>
<MultiBinding Converter="{StaticResource audioEncoderConverter}">
<Binding Path="Task.AllowedPassthruOptions.AudioEncoderFallback" />
diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml index 7788275eb..dc5256ed6 100644 --- a/win/CS/HandBrakeWPF/Views/MainView.xaml +++ b/win/CS/HandBrakeWPF/Views/MainView.xaml @@ -157,7 +157,7 @@ />
<Label Margin="8,0,0,0"
VerticalAlignment="Center"
- Content="{x:Static Properties:ResourcesUI.MainView_Source}"
+ Content="{x:Static Properties:ResourcesUI.MainView_SourceOpen}"
/>
</StackPanel>
</Button>
diff --git a/win/CS/HandBrakeWPF/Views/OptionsView.xaml b/win/CS/HandBrakeWPF/Views/OptionsView.xaml index 9766618d3..61942c7f5 100644 --- a/win/CS/HandBrakeWPF/Views/OptionsView.xaml +++ b/win/CS/HandBrakeWPF/Views/OptionsView.xaml @@ -32,6 +32,8 @@ <Options:OptionsTabConverter x:Key="tabConverter" />
<Options:OptionsTabNameConverter x:Key="tabNameConverter" />
<Converters:EnumComboConverter x:Key="enumComboConverter" />
+ <Options:LogLevelConverter x:Key="LogLevelConverter" />
+
<Converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
@@ -298,14 +300,14 @@ <StackPanel Orientation="Vertical" Margin="20,0,0,0">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{x:Static Properties:ResourcesUI.Options_LogLevel}" Width="250" VerticalAlignment="Center" />
- <ComboBox Name="logVerbosityLevel" ItemsSource="{Binding LogVerbosityOptions}" SelectedItem="{Binding SelectedVerbosity}" Width="120" />
+ <ComboBox Name="logVerbosityLevel" ItemsSource="{Binding LogVerbosityOptions, Converter={StaticResource LogLevelConverter}}" SelectedItem="{Binding SelectedVerbosity, Converter={StaticResource LogLevelConverter}}" Width="120" />
</StackPanel>
<CheckBox Content="{x:Static Properties:ResourcesUI.Options_CopyLogToEncDir}" Margin="0,5,0,0" IsChecked="{Binding CopyLogToEncodeDirectory}" />
<CheckBox Content="{x:Static Properties:ResourcesUI.Options_CopyLogToDir}" Margin="0,5,0,0" IsChecked="{Binding CopyLogToSepcficedLocation}" />
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<TextBlock Text="{x:Static Properties:ResourcesUI.Options_LogPath}" VerticalAlignment="Center" />
- <TextBox Width="120" Text="{Binding LogDirectory}" />
+ <TextBox Width="380" Text="{Binding LogDirectory}" />
<Button Content="Browse" Margin="5,0,0,0" cal:Message.Attach="[Event Click] = [Action BrowseLogPath]" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|