From c9009243ac3f176c5b6a0e9564b794c487676aa8 Mon Sep 17 00:00:00 2001 From: sr55 Date: Tue, 2 Feb 2016 19:41:36 +0000 Subject: WinGui: Couple of UI Tweaks. --- .../Converters/Options/LogLevelConverter.cs | 95 ++++++++++++++++++++++ win/CS/HandBrakeWPF/HandBrakeWPF.csproj | 1 + .../Properties/ResourcesUI.Designer.cs | 11 ++- win/CS/HandBrakeWPF/Properties/ResourcesUI.resx | 5 +- win/CS/HandBrakeWPF/Views/AudioView.xaml | 2 +- win/CS/HandBrakeWPF/Views/MainView.xaml | 2 +- win/CS/HandBrakeWPF/Views/OptionsView.xaml | 6 +- 7 files changed, 116 insertions(+), 6 deletions(-) create mode 100644 win/CS/HandBrakeWPF/Converters/Options/LogLevelConverter.cs (limited to 'win') 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 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Defines the LogLevelConverter type. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrakeWPF.Converters.Options +{ + using System; + using System.Collections.Generic; + using System.ComponentModel; + using System.Globalization; + using System.Windows.Data; + + /// + /// The log level converter. + /// + public class LogLevelConverter : IValueConverter + { + /// + /// The convert. + /// + /// + /// The value. + /// + /// + /// The target type. + /// + /// + /// The parameter. + /// + /// + /// The culture. + /// + /// + /// The . + /// + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value.GetType() == typeof(BindingList)) + { + return new List { "Minimised", "Standard", "Extended" }; + } + else if (value is int) + { + switch ((int)value) + { + case 0: + return "Minimised"; + case 2: + return "Extended"; + default: + return "Standard"; + } + } + + return null; + } + + /// + /// The convert back. + /// + /// + /// The value. + /// + /// + /// The target type. + /// + /// + /// The parameter. + /// + /// + /// The culture. + /// + /// + /// The . + /// + 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 @@ + 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 @@ -816,6 +816,15 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to Open Source. + /// + public static string MainView_SourceOpen { + get { + return ResourceManager.GetString("MainView_SourceOpen", resourceCulture); + } + } + /// /// Looks up a localized string similar to Start Encode. /// @@ -1078,7 +1087,7 @@ namespace HandBrakeWPF.Properties { } /// - /// 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. /// 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 @@ Disable LibDVDNav. (libdvdread will be used instead) - Enable DXVA Hardware Accelerated Decoding (Experimental)" + Enable DXVA Hardware Accelerated Decoding Format: @@ -846,4 +846,7 @@ Rotate: + + Open Source + \ 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 @@ - + 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 @@ />