diff options
author | sr55 <[email protected]> | 2019-06-06 15:35:02 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2019-06-06 15:35:02 +0100 |
commit | 20aa33df6fa9e9ea488fb495424a088f584032a8 (patch) | |
tree | 78310f5b331a7f4cd3bbe4706f2693d136da82f4 /win | |
parent | 9532ed2edfa915fd023e481d87b546562a7c80a1 (diff) |
WinGui: Don't show encoder options when Fallback = None and a passthru encoder is selected on the Audio Defaults screen. Also add the ? as the MacGui has. #2135
Diffstat (limited to 'win')
-rw-r--r-- | win/CS/HandBrakeWPF/Converters/Audio/AudioControlVisibilityConverter.cs | 53 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/HandBrakeWPF.csproj | 6 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Model/Audio/AudioBehaviourTrack.cs | 8 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Properties/Resources.Designer.cs | 9 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Properties/Resources.resx | 3 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Services/PowerService.cs | 36 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/AudioDefaultsViewModel.cs | 6 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/SubtitlesDefaultsViewModel.cs | 6 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/AudioDefaultsView.xaml | 164 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/Images/question.png | bin | 0 -> 2480 bytes | |||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/MainView.xaml | 2 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/SubtitlesDefaultsView.xaml | 9 |
12 files changed, 253 insertions, 49 deletions
diff --git a/win/CS/HandBrakeWPF/Converters/Audio/AudioControlVisibilityConverter.cs b/win/CS/HandBrakeWPF/Converters/Audio/AudioControlVisibilityConverter.cs new file mode 100644 index 000000000..c22a22319 --- /dev/null +++ b/win/CS/HandBrakeWPF/Converters/Audio/AudioControlVisibilityConverter.cs @@ -0,0 +1,53 @@ +// -------------------------------------------------------------------------------------------------------------------- +// <copyright file="AudioControlVisibilityConverter.cs" company="HandBrake Project (https://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 +// </summary> +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrakeWPF.Converters.Audio +{ + using System; + using System.Globalization; + using System.Windows; + using System.Windows.Data; + + using HandBrakeWPF.Services.Encode.Model.Models; + + public class AudioControlVisibilityConverter : IMultiValueConverter + { + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + if (values.Length == 3) + { + bool isVisibile = (bool)values[0]; + bool isPassthru = (bool)values[1]; + AudioEncoder fallbackEncoder = AudioEncoder.ffaac; + + if (values[2] != null && values[2].GetType() == typeof(AudioEncoder)) + { + fallbackEncoder = (AudioEncoder)values[2]; + } + + if (!isVisibile) + { + return Visibility.Collapsed; + } + + if (fallbackEncoder == AudioEncoder.None && isPassthru) + { + return Visibility.Collapsed; + } + } + + return Visibility.Visible; + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +}
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj index b81e5fce7..aa1725a10 100644 --- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj +++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj @@ -122,6 +122,7 @@ <Compile Include="Controls\AlertPanel.xaml.cs">
<DependentUpon>AlertPanel.xaml</DependentUpon>
</Compile>
+ <Compile Include="Converters\Audio\AudioControlVisibilityConverter.cs" />
<Compile Include="Converters\Audio\AudioMixdownListConverter.cs" />
<Compile Include="Converters\Audio\AudioMixdownConverter.cs" />
<Compile Include="Converters\Audio\AudioRateTypeConverter.cs" />
@@ -220,6 +221,7 @@ <Compile Include="Services\Logging\Model\LogLevel.cs" />
<Compile Include="Services\Logging\Model\LogMessage.cs" />
<Compile Include="Services\Logging\Model\LogMessageType.cs" />
+ <Compile Include="Services\PowerService.cs" />
<Compile Include="Services\Presets\Factories\JsonPresetFactory.cs" />
<Compile Include="Services\Presets\Interfaces\IPresetObject.cs" />
<Compile Include="Services\Presets\Model\PresetDisplayCategory.cs" />
@@ -722,7 +724,9 @@ <ItemGroup>
<Resource Include="Views\Images\close64_dark.png" />
</ItemGroup>
- <ItemGroup />
+ <ItemGroup>
+ <Resource Include="Views\Images\question.png" />
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<TargetFrameworkSDKToolsDirectory Condition=" '$(Platform)' == 'x64'">$(TargetFrameworkSDKToolsDirectory)$(Platform)\</TargetFrameworkSDKToolsDirectory>
diff --git a/win/CS/HandBrakeWPF/Model/Audio/AudioBehaviourTrack.cs b/win/CS/HandBrakeWPF/Model/Audio/AudioBehaviourTrack.cs index 5342d2454..3a59f781e 100644 --- a/win/CS/HandBrakeWPF/Model/Audio/AudioBehaviourTrack.cs +++ b/win/CS/HandBrakeWPF/Model/Audio/AudioBehaviourTrack.cs @@ -452,6 +452,14 @@ namespace HandBrakeWPF.Model.Audio } } + public bool IsAudioControlsVisibile + { + get + { + return true; + } + } + /// <summary> /// Gets a value indicating whether IsLossless. /// </summary> diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs index 60aa0c287..f60bc2094 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs @@ -257,6 +257,15 @@ namespace HandBrakeWPF.Properties { } /// <summary> + /// Looks up a localized string similar to When a passthru encoder is selected, the encoder options will be used for the fallback encoder.. + /// </summary> + public static string AudioDefaultViewModel_EncoderOptionsNotice { + get { + return ResourceManager.GetString("AudioDefaultViewModel_EncoderOptionsNotice", resourceCulture); + } + } + + /// <summary> /// Looks up a localized string similar to Allow passthru of:. /// </summary> public static string AudioView_AllowPassThruOf { diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx index 86df442ca..952765b40 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.resx +++ b/win/CS/HandBrakeWPF/Properties/Resources.resx @@ -1999,4 +1999,7 @@ Where supported, any user presets will have been imported.</value> <data name="Options_PromptBeforeAction" xml:space="preserve">
<value>Perform action immediately. (This will disable the 60 second confirmation dialog)</value>
</data>
+ <data name="AudioDefaultViewModel_EncoderOptionsNotice" xml:space="preserve">
+ <value>When a passthru encoder is selected, the encoder options will be used for the fallback encoder.</value>
+ </data>
</root>
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Services/PowerService.cs b/win/CS/HandBrakeWPF/Services/PowerService.cs new file mode 100644 index 000000000..9239a2cd2 --- /dev/null +++ b/win/CS/HandBrakeWPF/Services/PowerService.cs @@ -0,0 +1,36 @@ +// -------------------------------------------------------------------------------------------------------------------- +// <copyright file="PowerService.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> +// The Error Service +// </summary> +// -------------------------------------------------------------------------------------------------------------------- + + +namespace HandBrakeWPF.Services +{ + using System; + using System.Management; + + public class PowerService + { + private void GetPowerState() + { + + System.Management.ObjectQuery query = new ObjectQuery("Select * FROM Win32_Battery"); + ManagementObjectSearcher searcher = new ManagementObjectSearcher(query); + + ManagementObjectCollection collection = searcher.Get(); + + foreach (ManagementObject mo in collection) + { + foreach (PropertyData property in mo.Properties) + { + Console.WriteLine("Property {0}: Value is {1}", property.Name, property.Value); + } + } + + } + } +} diff --git a/win/CS/HandBrakeWPF/ViewModels/AudioDefaultsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AudioDefaultsViewModel.cs index 289dcb0de..1b5a20df3 100644 --- a/win/CS/HandBrakeWPF/ViewModels/AudioDefaultsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/AudioDefaultsViewModel.cs @@ -12,6 +12,7 @@ namespace HandBrakeWPF.ViewModels using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; + using System.Diagnostics; using System.Linq; using HandBrake.Interop.Interop; @@ -508,6 +509,11 @@ namespace HandBrakeWPF.ViewModels } } + public void LaunchHelp() + { + Process.Start("https://handbrake.fr/docs/en/1.2.0/advanced/audio-subtitle-defaults.html"); + } + #endregion } }
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/SubtitlesDefaultsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SubtitlesDefaultsViewModel.cs index 28a568263..f01f2bb20 100644 --- a/win/CS/HandBrakeWPF/ViewModels/SubtitlesDefaultsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/SubtitlesDefaultsViewModel.cs @@ -11,6 +11,7 @@ namespace HandBrakeWPF.ViewModels { using System.Collections.Generic; using System.ComponentModel; + using System.Diagnostics; using System.Linq; using HandBrake.Interop.Utilities; @@ -185,6 +186,11 @@ namespace HandBrakeWPF.ViewModels this.SubtitleBehaviours.SelectedLangauges.Clear(); } + public void LaunchHelp() + { + Process.Start("https://handbrake.fr/docs/en/1.2.0/advanced/audio-subtitle-defaults.html"); + } + #endregion #region Methods diff --git a/win/CS/HandBrakeWPF/Views/AudioDefaultsView.xaml b/win/CS/HandBrakeWPF/Views/AudioDefaultsView.xaml index 8449f68d7..16a2c6b1b 100644 --- a/win/CS/HandBrakeWPF/Views/AudioDefaultsView.xaml +++ b/win/CS/HandBrakeWPF/Views/AudioDefaultsView.xaml @@ -23,6 +23,7 @@ <Audio:AudioTrackDefaultBehaviourConverter x:Key="audioTrackDefaultBehaviourConverter" /> <Conveters:BooleanToHiddenVisibilityConverter x:Key="boolToHiddenVisConverter" /> <Audio:AudioRateTypeConverter x:Key="audioRateTypeConverter" /> + <Audio:AudioControlVisibilityConverter x:Key="audioControlVisibilityConverter" /> </UserControl.Resources> @@ -34,6 +35,8 @@ <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> @@ -117,42 +120,36 @@ <!-- Auto Passthru --> - <StackPanel Orientation="Vertical" Margin="10,0,0,5" Grid.Row="0" Grid.Column="1" Grid.RowSpan="3" HorizontalAlignment="Left"> + <StackPanel Orientation="Vertical" Margin="15,0,15,5" Grid.Row="0" Grid.Column="1" Grid.RowSpan="3" HorizontalAlignment="Left"> <TextBlock Text="{x:Static Properties:Resources.AudioView_AutoPassthruBehaviour}" FontWeight="Bold" Margin="0,10,0,5" /> <StackPanel Margin="5,10,0,0" Orientation="Vertical"> <TextBlock Margin="5,0,5,0" Text="{x:Static Properties:Resources.AudioView_WhenAutoPassthru}" VerticalAlignment="Center" /> <TextBlock Margin="5,0,5,0" Text="{x:Static Properties:Resources.AudioView_AllowPassThruOf}" VerticalAlignment="Center" /> </StackPanel> - <StackPanel Margin="10,10,0,0" - Orientation="Vertical"> - <CheckBox Margin="0,0,5,0" - Content="MP3" VerticalAlignment="Center" - IsChecked="{Binding AudioAllowMP3Pass}" /> - <CheckBox Margin="0,0,5,0" - Content="AAC" VerticalAlignment="Center" - IsChecked="{Binding AudioAllowAACPass}" /> - <CheckBox Margin="0,0,5,0" - Content="AC3" VerticalAlignment="Center" - IsChecked="{Binding AudioAllowAC3Pass}" /> - <CheckBox Margin="0,0,5,0" - Content="E-AC3" VerticalAlignment="Center" - IsChecked="{Binding AudioAllowEAC3Pass}" /> - <CheckBox Margin="0,0,5,0" - Content="DTS" VerticalAlignment="Center" - IsChecked="{Binding AudioAllowDTSPass}" /> - <CheckBox Margin="0,0,5,0" - Content="DTSHD" VerticalAlignment="Center" - IsChecked="{Binding AudioAllowDTSHDPass}" /> - <CheckBox Margin="0,0,5,0" - Content="TrueHD" VerticalAlignment="Center" - IsChecked="{Binding AudioAllowTrueHDPass}" /> - <CheckBox Margin="0,0,5,0" - Content="FLAC" VerticalAlignment="Center" - IsChecked="{Binding AudioAllowFlacPass}" /> - </StackPanel> - <StackPanel Orientation="Horizontal"> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + </Grid.ColumnDefinitions> + + <StackPanel Margin="10,10,0,0" Orientation="Vertical" Grid.Column="0"> + <CheckBox Margin="0,0,5,0" Content="MP3" VerticalAlignment="Center" IsChecked="{Binding AudioAllowMP3Pass}" /> + <CheckBox Margin="0,0,5,0" Content="AAC" VerticalAlignment="Center" IsChecked="{Binding AudioAllowAACPass}" /> + <CheckBox Margin="0,0,5,0" Content="AC3" VerticalAlignment="Center" IsChecked="{Binding AudioAllowAC3Pass}" /> + <CheckBox Margin="0,0,5,0" Content="E-AC3" VerticalAlignment="Center" IsChecked="{Binding AudioAllowEAC3Pass}" /> + </StackPanel> + + <StackPanel Margin="10,10,0,0" Orientation="Vertical" Grid.Column="1"> + <CheckBox Margin="0,0,5,0" Content="FLAC" VerticalAlignment="Center" IsChecked="{Binding AudioAllowFlacPass}" /> + <CheckBox Margin="0,0,5,0" Content="DTS" VerticalAlignment="Center" IsChecked="{Binding AudioAllowDTSPass}" /> + <CheckBox Margin="0,0,5,0" Content="DTSHD" VerticalAlignment="Center" IsChecked="{Binding AudioAllowDTSHDPass}" /> + <CheckBox Margin="0,0,5,0" Content="TrueHD" VerticalAlignment="Center" IsChecked="{Binding AudioAllowTrueHDPass}" /> + </StackPanel> + </Grid> + + <StackPanel Orientation="Horizontal" Margin="0,10,0,0"> <TextBlock Margin="10,0,5,0" Text="{x:Static Properties:Resources.AudioView_OtherwiseFallbackEncoder}" /> <ComboBox VerticalAlignment="Center" Width="105" Height="22" Margin="5,0,5,0"> @@ -180,8 +177,24 @@ <Button Content="{x:Static Properties:Resources.AudioDefaultsView_Clear}" cal:Message.Attach="[Event Click] = [Action ClearTracks]" Padding="8,2"/> </StackPanel> + <Grid Grid.Row="5" Margin="25,10,0,0" Grid.ColumnSpan="3"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="235" /> <!-- Codec + Quality/Bitrate --> + <ColumnDefinition Width="130" /> <!-- Mixdown --> + <ColumnDefinition Width="80" /> <!-- Samplerate --> + <ColumnDefinition Width="55" /> <!-- DRC --> + <ColumnDefinition Width="55" /> + </Grid.ColumnDefinitions> + + <TextBlock Grid.Column="0" Margin="0" VerticalAlignment="Center" FontWeight="Bold" Text="{x:Static Properties:Resources.AudioView_Codec}" /> + <TextBlock Grid.Column="1" Margin="4,0,0,0" VerticalAlignment="Center" FontWeight="Bold" Text="{x:Static Properties:Resources.AudioView_Mixdown}" /> + <TextBlock Grid.Column="2" Margin="4,0,0,0" VerticalAlignment="Center" FontWeight="Bold" Text="{x:Static Properties:Resources.AudioView_Samplerate}" /> + <TextBlock Grid.Column="3" Margin="4,0,0,0" VerticalAlignment="Center" FontWeight="Bold" Text="{x:Static Properties:Resources.AudioView_DRC}" /> + <TextBlock Grid.Column="4" Margin="4,0,0,0" VerticalAlignment="Center" FontWeight="Bold" Text="{x:Static Properties:Resources.AudioView_Gain}" /> + </Grid> + <ListBox VerticalAlignment="Stretch" MinHeight="50" - Margin="10,10,10,10" Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="3" + Margin="10,0,10,5" Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="3" dd:DragDrop.DropHandler="{Binding}" dd:DragDrop.IsDragSource="True" dd:DragDrop.IsDropTarget="True" @@ -239,7 +252,6 @@ </Grid.RowDefinitions> <!-- Row 1 --> - <TextBlock Grid.Column="2" VerticalAlignment="Center" FontWeight="Bold" Text="{x:Static Properties:Resources.AudioView_Codec}" /> <ComboBox Grid.Column="3" Width="100" Height="22" Margin="5,0,5,0"> <ComboBox.SelectedItem> <MultiBinding Converter="{StaticResource audioEncoderConverter}"> @@ -256,38 +268,86 @@ <ComboBox Grid.Column="4" Height="22" Width="65" HorizontalAlignment="Stretch" ItemsSource="{Binding AudioEncoderRateTypes, Converter={StaticResource audioRateTypeConverter}}" - SelectedItem="{Binding EncoderRateType, Converter={StaticResource audioRateTypeConverter}}" - Visibility="{Binding IsRateTypeVisible, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" /> + SelectedItem="{Binding EncoderRateType, Converter={StaticResource audioRateTypeConverter}}"> + <ComboBox.Visibility> + <MultiBinding Converter="{StaticResource audioControlVisibilityConverter}"> + <Binding Path="IsRateTypeVisible" /> + <Binding Path="IsPassthru" /> + <Binding Path="DataContext.AudioEncoderFallback" RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type UserControl}}" /> + </MultiBinding> + </ComboBox.Visibility> + </ComboBox> <ComboBox Grid.Column="5" Width="55" Height="22" Margin="5,0,5,0" ItemsSource="{Binding EncoderQualityValues}" - SelectedItem="{Binding Quality}" - Visibility="{Binding IsQualityVisible, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" /> + SelectedItem="{Binding Quality}" > + <ComboBox.Visibility> + <MultiBinding Converter="{StaticResource audioControlVisibilityConverter}"> + <Binding Path="IsQualityVisible" /> + <Binding Path="IsPassthru" /> + <Binding Path="DataContext.AudioEncoderFallback" RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type UserControl}}" /> + </MultiBinding> + </ComboBox.Visibility> + </ComboBox> <ComboBox Grid.Column="5" Width="55" Height="22" Margin="5,0,5,0" ItemsSource="{Binding Bitrates}" - SelectedItem="{Binding Bitrate}" - Visibility="{Binding IsBitrateVisible, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" /> + SelectedItem="{Binding Bitrate}" > + <ComboBox.Visibility> + <MultiBinding Converter="{StaticResource audioControlVisibilityConverter}"> + <Binding Path="IsBitrateVisible" /> + <Binding Path="IsPassthru" /> + <Binding Path="DataContext.AudioEncoderFallback" RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type UserControl}}" /> + </MultiBinding> + </ComboBox.Visibility> + </ComboBox> - <TextBlock Grid.Row="0" Grid.Column="6" VerticalAlignment="Center" FontWeight="Bold" Text="{x:Static Properties:Resources.AudioView_Mixdown}" /> <ComboBox Grid.Row="0" Grid.Column="7" Height="22" Width="120" Margin="5,0,5,0" HorizontalAlignment="Stretch" ItemsSource="{Binding Mixdowns}" SelectedItem="{Binding MixDown}" - DisplayMemberPath="DisplayName" /> - + DisplayMemberPath="DisplayName" > + <ComboBox.Visibility> + <MultiBinding Converter="{StaticResource audioControlVisibilityConverter}"> + <Binding Path="IsAudioControlsVisibile" /> + <Binding Path="IsPassthru" /> + <Binding Path="DataContext.AudioEncoderFallback" RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type UserControl}}" /> + </MultiBinding> + </ComboBox.Visibility> + </ComboBox> - <TextBlock VerticalAlignment="Center" Grid.Column="8" FontWeight="Bold" Text="{x:Static Properties:Resources.AudioView_Samplerate}" /> + <ComboBox Width="70" Height="22" Margin="5,0,5,0" Grid.Column="9" ItemsSource="{Binding DataContext.SampleRates, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" - SelectedItem="{Binding SampleRateDisplayValue}" /> + SelectedItem="{Binding SampleRateDisplayValue}" > + <ComboBox.Visibility> + <MultiBinding Converter="{StaticResource audioControlVisibilityConverter}"> + <Binding Path="IsAudioControlsVisibile" /> + <Binding Path="IsPassthru" /> + <Binding Path="DataContext.AudioEncoderFallback" RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type UserControl}}" /> + </MultiBinding> + </ComboBox.Visibility> + </ComboBox> - <TextBlock VerticalAlignment="Center" FontWeight="Bold" Text="{x:Static Properties:Resources.AudioView_DRC}" Grid.Column="10" /> <controls:NumberBox Name="drcNumericCtl" Width="45" Margin="5,0,5,0" HorizontalAlignment="Left" Grid.Column="11" Minimum="0" Modulus="0.1" Maximum="4" Number="{Binding DRC, Mode=TwoWay}" UpdateBindingOnTextChange="True" - ShowIncrementButtons="True" AllowEmpty="False" /> + ShowIncrementButtons="True" AllowEmpty="False" > + <controls:NumberBox.Visibility> + <MultiBinding Converter="{StaticResource audioControlVisibilityConverter}"> + <Binding Path="IsAudioControlsVisibile" /> + <Binding Path="IsPassthru" /> + <Binding Path="DataContext.AudioEncoderFallback" RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type UserControl}}" /> + </MultiBinding> + </controls:NumberBox.Visibility> + </controls:NumberBox> - <TextBlock VerticalAlignment="Center" FontWeight="Bold" Text="{x:Static Properties:Resources.AudioView_Gain}" Grid.Column="12" /> <controls:NumberBox Name="gainNumericCtl" Width="45" Margin="5,0,5,0" HorizontalAlignment="Left" Grid.Column="13" Minimum="-20" Modulus="1" Maximum="20" Number="{Binding Gain, Mode=TwoWay}" UpdateBindingOnTextChange="True" - ShowIncrementButtons="True" AllowEmpty="False" /> - + ShowIncrementButtons="True" AllowEmpty="False" > + <controls:NumberBox.Visibility> + <MultiBinding Converter="{StaticResource audioControlVisibilityConverter}"> + <Binding Path="IsAudioControlsVisibile" /> + <Binding Path="IsPassthru" /> + <Binding Path="DataContext.AudioEncoderFallback" RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type UserControl}}" /> + </MultiBinding> + </controls:NumberBox.Visibility> + </controls:NumberBox> </Grid> <!-- Delete --> @@ -308,6 +368,16 @@ </DataTemplate> </ListBox.ItemTemplate> </ListBox> + + <StackPanel Orientation="Horizontal" Margin="10,0,0,0" Grid.Row="7" Grid.ColumnSpan="3"> + <Button cal:Message.Attach="[Event Click] = [Action LaunchHelp]" Background="Transparent" BorderThickness="0"> + <Button.Content> + <Image Source="/Views/Images/question.png" Width="16" /> + </Button.Content> + </Button> + <TextBlock Text="{x:Static Properties:Resources.AudioDefaultViewModel_EncoderOptionsNotice}" Margin="10,0,0,0"/> + </StackPanel> + </Grid> </UserControl> diff --git a/win/CS/HandBrakeWPF/Views/Images/question.png b/win/CS/HandBrakeWPF/Views/Images/question.png Binary files differnew file mode 100644 index 000000000..663686bb9 --- /dev/null +++ b/win/CS/HandBrakeWPF/Views/Images/question.png diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml index bca3f2af0..524cc150e 100644 --- a/win/CS/HandBrakeWPF/Views/MainView.xaml +++ b/win/CS/HandBrakeWPF/Views/MainView.xaml @@ -103,7 +103,7 @@ </MenuItem>
</MenuItem>
- <MenuItem Header="{x:Static Properties:Resources.MainView_PresetsMenu}" x:Name="presetMenu" IsEnabled="{Binding HasSource, Converter={StaticResource booleanConverter}, ConverterParameter=false}">
+ <MenuItem Header="{x:Static Properties:Resources.MainView_PresetsMenu}" x:Name="presetMenu">
<MenuItem Header="{x:Static Properties:Resources.MainView_PresetsMenu}" ItemsSource="{Binding PresetsCategories, Converter={StaticResource presetsMenuConverter}}" />
<Separator />
diff --git a/win/CS/HandBrakeWPF/Views/SubtitlesDefaultsView.xaml b/win/CS/HandBrakeWPF/Views/SubtitlesDefaultsView.xaml index 386b78c56..d92461296 100644 --- a/win/CS/HandBrakeWPF/Views/SubtitlesDefaultsView.xaml +++ b/win/CS/HandBrakeWPF/Views/SubtitlesDefaultsView.xaml @@ -30,6 +30,7 @@ <Grid VerticalAlignment="Top"> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> @@ -120,6 +121,14 @@ </StackPanel> + <StackPanel Orientation="Horizontal" Margin="10,0,0,0" Grid.Row="1" Grid.ColumnSpan="3"> + <Button cal:Message.Attach="[Event Click] = [Action LaunchHelp]" Background="Transparent" BorderThickness="0"> + <Button.Content> + <Image Source="/Views/Images/question.png" Width="16" /> + </Button.Content> + </Button> + </StackPanel> + </Grid> </UserControl> |