From 5446a69b0dd658ecfe1a954c9839a2e12e077adf Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 15 Sep 2018 20:04:44 +0100 Subject: [PATCH] WinGui: Add Experimental Features preferences to toggle ideas we are experimenting with. Re-enabled in-line queue experiment --- .../Converters/Queue/InlineQueueConverter.cs | 46 +++++++++++++++++++ win/CS/HandBrakeWPF/HandBrakeWPF.csproj | 1 + .../Properties/ResourcesUI.Designer.cs | 20 +++++++- .../HandBrakeWPF/Properties/ResourcesUI.resx | 8 +++- .../HandBrakeWPF/ViewModels/MainViewModel.cs | 1 - win/CS/HandBrakeWPF/Views/MainView.xaml | 31 +++++++------ win/CS/HandBrakeWPF/Views/OptionsView.xaml | 11 ++++- 7 files changed, 99 insertions(+), 19 deletions(-) create mode 100644 win/CS/HandBrakeWPF/Converters/Queue/InlineQueueConverter.cs diff --git a/win/CS/HandBrakeWPF/Converters/Queue/InlineQueueConverter.cs b/win/CS/HandBrakeWPF/Converters/Queue/InlineQueueConverter.cs new file mode 100644 index 000000000..36088cf1c --- /dev/null +++ b/win/CS/HandBrakeWPF/Converters/Queue/InlineQueueConverter.cs @@ -0,0 +1,46 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// A Converter to handle the UI re-arrangement for in-line queue. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrakeWPF.Converters.Queue +{ + using System; + using System.Globalization; + using System.Windows; + using System.Windows.Data; + + public class InlineQueueConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + // Parameter = True is Flipped logic. + if (parameter is string && "true".Equals(parameter)) + { + if (value is bool && (bool)value) + { + return new GridLength(1, GridUnitType.Star); + } + + return GridLength.Auto; + } + + // Parameter = False + if (value is bool && (bool)value) + { + return GridLength.Auto; + } + + return new GridLength(1, GridUnitType.Star); + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + return new GridLength(1, GridUnitType.Star); + } + } +} diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj index 393e3ad68..7b9e55dac 100644 --- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj +++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj @@ -136,6 +136,7 @@ + diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs index 30e22c278..90cc311ab 100644 --- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs @@ -1374,6 +1374,24 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to Experimental Features. + /// + public static string Options_Experimental { + get { + return ResourceManager.GetString("Options_Experimental", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Experimental features are ideas we are working on. These may or may not make it into a final release and may not work!. + /// + public static string Options_ExperimentalFeatures { + get { + return ResourceManager.GetString("Options_ExperimentalFeatures", resourceCulture); + } + } + /// /// Looks up a localized string similar to File Format:. /// @@ -1600,7 +1618,7 @@ namespace HandBrakeWPF.Properties { } /// - /// Looks up a localized string similar to Show Queue in place of the tab controls when toggled on.. + /// Looks up a localized string similar to Show Queue in line with the main UI.. /// public static string Options_ShowQueueInline { get { diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx index 804475873..9a136949b 100644 --- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx +++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx @@ -823,7 +823,7 @@ Constant quality fractional granularity: - Show Queue in place of the tab controls when toggled on. + Show Queue in line with the main UI. Pause queue if disk space is low before starting a job. @@ -1046,4 +1046,10 @@ This will not affect your current settings in the Subtitle tab. Are you sure you wish to stop thie encode? + + Experimental Features + + + Experimental features are ideas we are working on. These may or may not make it into a final release and may not work! + \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index e31a8bb98..917fadd69 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -1396,7 +1396,6 @@ namespace HandBrakeWPF.ViewModels public void OpenQueueWindow() { bool showQueueInline = this.userSettingService.GetUserSetting(UserSettingConstants.ShowQueueInline); - showQueueInline = false; // Disabled until it's evaluated. if (showQueueInline) { diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml index 1e701dd8c..d9cea5db9 100644 --- a/win/CS/HandBrakeWPF/Views/MainView.xaml +++ b/win/CS/HandBrakeWPF/Views/MainView.xaml @@ -10,6 +10,7 @@ xmlns:commands="clr-namespace:HandBrakeWPF.Commands" xmlns:helpers="clr-namespace:HandBrakeWPF.Helpers" xmlns:loc="clr-namespace:HandBrakeWPF.Services.Presets.Model" + xmlns:queue="clr-namespace:HandBrakeWPF.Converters.Queue" AllowDrop="True" FontSize="11" cal:Message.Attach="[Event Loaded] = [Action Load]" @@ -20,6 +21,7 @@ +