]> granicus.if.org Git - handbrake/commitdiff
WinGui: Add Experimental Features preferences to toggle ideas we are experimenting...
authorsr55 <sr55.hb@outlook.com>
Sat, 15 Sep 2018 19:04:44 +0000 (20:04 +0100)
committersr55 <sr55.hb@outlook.com>
Sat, 15 Sep 2018 19:04:44 +0000 (20:04 +0100)
win/CS/HandBrakeWPF/Converters/Queue/InlineQueueConverter.cs [new file with mode: 0644]
win/CS/HandBrakeWPF/HandBrakeWPF.csproj
win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs
win/CS/HandBrakeWPF/Properties/ResourcesUI.resx
win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
win/CS/HandBrakeWPF/Views/MainView.xaml
win/CS/HandBrakeWPF/Views/OptionsView.xaml

diff --git a/win/CS/HandBrakeWPF/Converters/Queue/InlineQueueConverter.cs b/win/CS/HandBrakeWPF/Converters/Queue/InlineQueueConverter.cs
new file mode 100644 (file)
index 0000000..36088cf
--- /dev/null
@@ -0,0 +1,46 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="InlineQueueConverter.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>
+//   A Converter to handle the UI re-arrangement for in-line queue.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+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);
+        }
+    }
+}
index 393e3ad68686229eb46a97cb5541ae172d4ad645..7b9e55dacb24a4936b36129f65ebaf88eaa9897a 100644 (file)
     <Compile Include="Converters\Options\LogLevelConverter.cs" />\r
     <Compile Include="Converters\OptionTabConverter.cs" />\r
     <Compile Include="Converters\PresetsMenuConverter.cs" />\r
+    <Compile Include="Converters\Queue\InlineQueueConverter.cs" />\r
     <Compile Include="Converters\Queue\PictureSettingsDescConveter.cs" />\r
     <Compile Include="Converters\Subtitles\CanBurnSubtitleConverter.cs" />\r
     <Compile Include="Converters\Subtitles\SubtitleBurnInBehaviourConverter.cs" />\r
index 30e22c278768f418817b484ec55987eb116ff6eb..90cc311ab18e0df819412b728331216552f40991 100644 (file)
@@ -1374,6 +1374,24 @@ namespace HandBrakeWPF.Properties {
             }\r
         }\r
         \r
+        /// <summary>\r
+        ///   Looks up a localized string similar to Experimental Features.\r
+        /// </summary>\r
+        public static string Options_Experimental {\r
+            get {\r
+                return ResourceManager.GetString("Options_Experimental", resourceCulture);\r
+            }\r
+        }\r
+        \r
+        /// <summary>\r
+        ///   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!.\r
+        /// </summary>\r
+        public static string Options_ExperimentalFeatures {\r
+            get {\r
+                return ResourceManager.GetString("Options_ExperimentalFeatures", resourceCulture);\r
+            }\r
+        }\r
+        \r
         /// <summary>\r
         ///   Looks up a localized string similar to File Format:.\r
         /// </summary>\r
@@ -1600,7 +1618,7 @@ namespace HandBrakeWPF.Properties {
         }\r
         \r
         /// <summary>\r
-        ///   Looks up a localized string similar to Show Queue in place of the tab controls when toggled on..\r
+        ///   Looks up a localized string similar to Show Queue in line with the main UI..\r
         /// </summary>\r
         public static string Options_ShowQueueInline {\r
             get {\r
index 80447587317cccca98b2f3335dfa9e04a80e2723..9a136949b0bb1ee40de7d9fd306df66836208ef2 100644 (file)
     <value>Constant quality fractional granularity:</value>\r
   </data>\r
   <data name="Options_ShowQueueInline" xml:space="preserve">\r
-    <value>Show Queue in place of the tab controls when toggled on.</value>\r
+    <value>Show Queue in line with the main UI.</value>\r
   </data>\r
   <data name="Options_PauseQueueOnLowDiskSpace" xml:space="preserve">\r
     <value>Pause queue if disk space is low before starting a job.</value>\r
@@ -1046,4 +1046,10 @@ This will not affect your current settings in the Subtitle tab.</value>
   <data name="MainView_StopEncodeConfirm" xml:space="preserve">\r
     <value>Are you sure you wish to stop thie encode?</value>\r
   </data>\r
+  <data name="Options_Experimental" xml:space="preserve">\r
+    <value>Experimental Features</value>\r
+  </data>\r
+  <data name="Options_ExperimentalFeatures" xml:space="preserve">\r
+    <value>Experimental features are ideas we are working on. These may or may not make it into a final release and may not work!</value>\r
+  </data>\r
 </root>
\ No newline at end of file
index e31a8bb98d0d8d49b40c5c97571d8d9a2e7ff646..917fadd69a06239dfbd796ac9d0aee7fb8ed7a90 100644 (file)
@@ -1396,7 +1396,6 @@ namespace HandBrakeWPF.ViewModels
         public void OpenQueueWindow()\r
         {\r
             bool showQueueInline = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowQueueInline);\r
-            showQueueInline = false; // Disabled until it's evaluated.\r
 \r
             if (showQueueInline)\r
             {\r
index 1e701dd8cf308ebd83651ec82f0c0dfa449895c3..d9cea5db91fe6b4e362db99826c413c254f768d2 100644 (file)
@@ -10,6 +10,7 @@
              xmlns:commands="clr-namespace:HandBrakeWPF.Commands"\r
              xmlns:helpers="clr-namespace:HandBrakeWPF.Helpers"\r
              xmlns:loc="clr-namespace:HandBrakeWPF.Services.Presets.Model"\r
+             xmlns:queue="clr-namespace:HandBrakeWPF.Converters.Queue"\r
              AllowDrop="True"\r
              FontSize="11"\r
              cal:Message.Attach="[Event Loaded] = [Action Load]"\r
@@ -20,6 +21,7 @@
         <Converters:BooleanConverter x:Key="booleanConverter" />\r
         <Converters:PresetsMenuConverter x:Key="presetsMenuConverter"/>\r
         <Converters:LongToIntConverter x:Key="longToIntConverter" />\r
+        <queue:InlineQueueConverter x:Key="InlineQueueConverter" />\r
 \r
         <Style TargetType="Button">\r
             <Setter Property="Padding" Value="8,2" />\r
             <Grid.RowDefinitions>\r
                 <RowDefinition Height="Auto" />\r
                 <RowDefinition Height="Auto" />\r
-                <RowDefinition Height="*" />\r
+                <RowDefinition x:Name="tabContentArea" Height="{Binding IsQueueShowingInLine, Converter={StaticResource InlineQueueConverter}}" />\r
                 <RowDefinition Height="Auto" />\r
+                <RowDefinition Height="{Binding IsQueueShowingInLine, Converter={StaticResource InlineQueueConverter}, ConverterParameter=true}"/>\r
             </Grid.RowDefinitions>\r
 \r
             <!--  Main Controls  -->\r
 \r
                     </StackPanel>\r
                 </Grid>\r
-\r
-              \r
             </Grid>\r
 \r
             <!--  Presets Options  -->\r
                 </TabItem>\r
             </TabControl>\r
 \r
-            <!-- Queue in-line display if enabled -->\r
-            <Grid  Grid.Row="2" Grid.Column="0" Margin="10,10,10,5"  Visibility="{Binding IsQueueShowingInLine, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}"\r
-                   HorizontalAlignment="Stretch" VerticalAlignment="Stretch">\r
-                <Grid.RowDefinitions>\r
-                    <RowDefinition Height="Auto" />\r
-                    <RowDefinition Height="*" />\r
-                </Grid.RowDefinitions>\r
-                <Label Content="Queue" FontWeight="Bold" Grid.Row="0"/>\r
-                <ContentControl x:Name="QueueViewModel" cal:View.Context="Embedded" Margin="5,0,0,0"  Grid.Row="1" />\r
-            </Grid>\r
-\r
             <!--  Destination  -->\r
             <StackPanel Grid.Row="3" IsEnabled="{Binding HasSource, Converter={StaticResource booleanConverter}, ConverterParameter=false}"\r
                         Margin="10,5,10,15"\r
                 </Grid>\r
             </StackPanel>\r
 \r
+            <!-- Queue in-line display if enabled -->\r
+            <Grid  Grid.Row="4" Grid.Column="0" Margin="10,0,10,10"  Visibility="{Binding IsQueueShowingInLine, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}"\r
+                   HorizontalAlignment="Stretch" VerticalAlignment="Stretch">\r
+                <Grid.RowDefinitions>\r
+                    <RowDefinition Height="Auto" />\r
+                    <RowDefinition Height="*" />\r
+                </Grid.RowDefinitions>\r
+                <Label Content="Queue" FontWeight="Bold" Grid.Row="0"/>\r
+                <ContentControl x:Name="QueueViewModel" cal:View.Context="Embedded" Grid.Row="1" />\r
+            </Grid>\r
+\r
             <!--  Presets  -->\r
-            <GroupBox Grid.Row="0" Grid.RowSpan="4"\r
+            <GroupBox Grid.Row="0" Grid.RowSpan="5"\r
                       Grid.Column="1"\r
                       HorizontalAlignment="Stretch"\r
                       VerticalAlignment="Stretch"\r
index aa728d6c36af079dbe9f5c273ae44d6d49597bf0..5e865e5a172e4ad7167c4846cd4f24498b82921b 100644 (file)
                             <CheckBox Content="{x:Static Properties:ResourcesUI.Options_MinimiseTray}" IsChecked="{Binding MinimiseToTray}" />\r
                             <CheckBox Content="{x:Static Properties:ResourcesUI.Options_ClearCompleted}" IsChecked="{Binding ClearQueueOnEncodeCompleted}" />\r
                             <CheckBox Content="{x:Static Properties:ResourcesUI.Options_AdvancedTab}" IsChecked="{Binding ShowAdvancedTab}" />\r
-                            <CheckBox Content="{x:Static Properties:ResourcesUI.Options_ShowQueueInline}" IsChecked="{Binding ShowQueueInline}" Visibility="Collapsed" />\r
                             <CheckBox Content="{x:Static Properties:ResourcesUI.OptionsView_ShowStatusInTitleBar}" IsChecked="{Binding ShowStatusInTitleBar}" />\r
                             <CheckBox Content="{x:Static Properties:ResourcesUI.OptionsView_ShowPreviewOnSummaryTab}" IsChecked="{Binding ShowPreviewOnSummaryTab}" />\r
                         </StackPanel>\r
                     </StackPanel>\r
+\r
+                    <StackPanel Orientation="Vertical" Margin="0,0,0,20">\r
+\r
+                        <TextBlock Text="{x:Static Properties:ResourcesUI.Options_Experimental}" FontSize="14" Margin="0,0,0,10"/>\r
+\r
+                        <StackPanel Orientation="Vertical" Margin="20,0,0,0">\r
+                            <TextBlock Text="{x:Static  Properties:ResourcesUI.Options_ExperimentalFeatures}"></TextBlock>\r
+                            <CheckBox Content="{x:Static Properties:ResourcesUI.Options_ShowQueueInline}" IsChecked="{Binding ShowQueueInline}" />\r
+                        </StackPanel>\r
+                    </StackPanel>\r
                 </StackPanel>\r
 \r
                 <StackPanel Name="Output" Orientation="Vertical" Margin="10,5,0,0"\r