--- /dev/null
+// --------------------------------------------------------------------------------------------------------------------
+// <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;
+ }
+ }
+ }
+}
<Compile Include="Converters\Audio\AudioBehaviourConverter.cs" />\r
<Compile Include="Converters\EnumToDescConverter.cs" />\r
<Compile Include="Converters\Filters\DenoisePresetConverter.cs" />\r
+ <Compile Include="Converters\Options\LogLevelConverter.cs" />\r
<Compile Include="Converters\Queue\PictureSettingsDescConveter.cs" />\r
<Compile Include="Converters\Subtitles\SubtitleBurnInBehaviourConverter.cs" />\r
<Compile Include="Converters\Subtitles\SubtitleBehaviourConverter.cs" />\r
}\r
}\r
\r
+ /// <summary>\r
+ /// Looks up a localized string similar to Open Source.\r
+ /// </summary>\r
+ public static string MainView_SourceOpen {\r
+ get {\r
+ return ResourceManager.GetString("MainView_SourceOpen", resourceCulture);\r
+ }\r
+ }\r
+ \r
/// <summary>\r
/// Looks up a localized string similar to Start Encode.\r
/// </summary>\r
}\r
\r
/// <summary>\r
- /// Looks up a localized string similar to Enable DXVA Hardware Accelerated Decoding (Experimental)".\r
+ /// Looks up a localized string similar to Enable DXVA Hardware Accelerated Decoding.\r
/// </summary>\r
public static string Options_DXVA {\r
get {\r
<value>Disable LibDVDNav. (libdvdread will be used instead)</value>\r
</data>\r
<data name="Options_DXVA" xml:space="preserve">\r
- <value>Enable DXVA Hardware Accelerated Decoding (Experimental)"</value>\r
+ <value>Enable DXVA Hardware Accelerated Decoding</value>\r
</data>\r
<data name="Options_Format" xml:space="preserve">\r
<value>Format:</value>\r
<data name="FiltersView_Rotate" xml:space="preserve">\r
<value>Rotate:</value>\r
</data>\r
+ <data name="MainView_SourceOpen" xml:space="preserve">\r
+ <value>Open Source</value>\r
+ </data>\r
</root>
\ No newline at end of file
\r
<TextBlock Margin="15,0,5,0" Text="{x:Static Properties:ResourcesUI.AudioView_OtherwiseFallbackEncoder}" />\r
\r
- <ComboBox VerticalAlignment="Center" Width="105" Height="22" Margin="10,0,5,0">\r
+ <ComboBox VerticalAlignment="Center" Width="105" Height="22" Margin="5,0,5,0">\r
<ComboBox.SelectedItem>\r
<MultiBinding Converter="{StaticResource audioEncoderConverter}">\r
<Binding Path="Task.AllowedPassthruOptions.AudioEncoderFallback" />\r
/>\r
<Label Margin="8,0,0,0"\r
VerticalAlignment="Center"\r
- Content="{x:Static Properties:ResourcesUI.MainView_Source}"\r
+ Content="{x:Static Properties:ResourcesUI.MainView_SourceOpen}"\r
/>\r
</StackPanel>\r
</Button>\r
<Options:OptionsTabConverter x:Key="tabConverter" />\r
<Options:OptionsTabNameConverter x:Key="tabNameConverter" />\r
<Converters:EnumComboConverter x:Key="enumComboConverter" />\r
+ <Options:LogLevelConverter x:Key="LogLevelConverter" />\r
+ \r
\r
<Converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />\r
\r
<StackPanel Orientation="Vertical" Margin="20,0,0,0">\r
<StackPanel Orientation="Horizontal">\r
<TextBlock Text="{x:Static Properties:ResourcesUI.Options_LogLevel}" Width="250" VerticalAlignment="Center" />\r
- <ComboBox Name="logVerbosityLevel" ItemsSource="{Binding LogVerbosityOptions}" SelectedItem="{Binding SelectedVerbosity}" Width="120" />\r
+ <ComboBox Name="logVerbosityLevel" ItemsSource="{Binding LogVerbosityOptions, Converter={StaticResource LogLevelConverter}}" SelectedItem="{Binding SelectedVerbosity, Converter={StaticResource LogLevelConverter}}" Width="120" />\r
</StackPanel>\r
\r
<CheckBox Content="{x:Static Properties:ResourcesUI.Options_CopyLogToEncDir}" Margin="0,5,0,0" IsChecked="{Binding CopyLogToEncodeDirectory}" />\r
<CheckBox Content="{x:Static Properties:ResourcesUI.Options_CopyLogToDir}" Margin="0,5,0,0" IsChecked="{Binding CopyLogToSepcficedLocation}" />\r
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">\r
<TextBlock Text="{x:Static Properties:ResourcesUI.Options_LogPath}" VerticalAlignment="Center" />\r
- <TextBox Width="120" Text="{Binding LogDirectory}" />\r
+ <TextBox Width="380" Text="{Binding LogDirectory}" />\r
<Button Content="Browse" Margin="5,0,0,0" cal:Message.Attach="[Event Click] = [Action BrowseLogPath]" />\r
</StackPanel>\r
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">\r