diff options
author | sr55 <[email protected]> | 2020-03-03 20:14:23 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2020-03-03 20:14:23 +0000 |
commit | 7880dd5e9e1a7db8fbd0f2cc3a616704b3864066 (patch) | |
tree | 4fa98834e8f2499fa52f84567cf72774625abea3 /win/CS | |
parent | 5605170542cbe1ae5131462912fb88e0fbfeca52 (diff) |
WinGui: Fix a localisation issue on the Point to Point Dropdown and add Title/Point to Point information on the Queue Display. Fixes #2651
Diffstat (limited to 'win/CS')
-rw-r--r-- | win/CS/HandBrakeWPF/Converters/Main/PointToPointConverter.cs | 19 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Converters/ResourceConverterBase.cs | 2 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 4 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/MainView.xaml | 6 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/QueueView.xaml | 40 |
5 files changed, 54 insertions, 17 deletions
diff --git a/win/CS/HandBrakeWPF/Converters/Main/PointToPointConverter.cs b/win/CS/HandBrakeWPF/Converters/Main/PointToPointConverter.cs new file mode 100644 index 000000000..f63b4b34c --- /dev/null +++ b/win/CS/HandBrakeWPF/Converters/Main/PointToPointConverter.cs @@ -0,0 +1,19 @@ +// -------------------------------------------------------------------------------------------------------------------- +// <copyright file="PointToPointConverter.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> +// PointToPoint Converter +// </summary> +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrakeWPF.Converters.Main +{ + using System.Windows.Data; + + using HandBrakeWPF.Services.Encode.Model.Models; + + public class PointToPointConverter : ResourceConverterBase<PointToPointMode>, IValueConverter + { + } +} diff --git a/win/CS/HandBrakeWPF/Converters/ResourceConverterBase.cs b/win/CS/HandBrakeWPF/Converters/ResourceConverterBase.cs index 36a588f59..7f1a1b433 100644 --- a/win/CS/HandBrakeWPF/Converters/ResourceConverterBase.cs +++ b/win/CS/HandBrakeWPF/Converters/ResourceConverterBase.cs @@ -46,7 +46,7 @@ namespace HandBrakeWPF.Converters { return new BindingList<string>( - EnumHelper<T>.GetEnumDisplayValues(typeof(T)).ToList()); + EnumHelper<T>.GetEnumDisplayValuesSubset((BindingList<T>)value).ToList()); } if (value != null && value.GetType() == typeof(T)) diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 989ddd7b6..eab9a0fb7 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -471,11 +471,11 @@ namespace HandBrakeWPF.ViewModels /// <summary>
/// Gets RangeMode.
/// </summary>
- public IEnumerable<PointToPointMode> RangeMode
+ public BindingList<PointToPointMode> RangeMode
{
get
{
- return new List<PointToPointMode>
+ return new BindingList<PointToPointMode>
{
PointToPointMode.Chapters, PointToPointMode.Seconds, PointToPointMode.Frames
};
diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml index c224efccd..cdbf4bbd2 100644 --- a/win/CS/HandBrakeWPF/Views/MainView.xaml +++ b/win/CS/HandBrakeWPF/Views/MainView.xaml @@ -12,6 +12,7 @@ xmlns:loc="clr-namespace:HandBrakeWPF.Services.Presets.Model"
xmlns:queue="clr-namespace:HandBrakeWPF.Converters.Queue"
xmlns:behaviours="clr-namespace:HandBrakeWPF.Behaviours"
+ xmlns:main="clr-namespace:HandBrakeWPF.Converters.Main"
AllowDrop="True"
FontSize="11"
cal:Message.Attach="[Event Loaded] = [Action Load]"
@@ -26,6 +27,7 @@ <Converters:BooleanConverter x:Key="NotBooleanConverter" />
<Converters:ThemeImageConverter x:Key="themeConverter" />
<Converters:EnumComboConverter x:Key="enumComboConverter" />
+ <main:PointToPointConverter x:Key="PointToPointConverter" />
<Style TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Padding" Value="8,2" />
@@ -409,8 +411,8 @@ <ComboBox Name="PointToPointMode"
MinWidth="80"
Margin="5,0,0,0"
- ItemsSource="{Binding RangeMode}" ToolTip="{x:Static Properties:ResourcesTooltips.MainView_Range}"
- SelectedItem="{Binding SelectedPointToPoint}" />
+ ItemsSource="{Binding RangeMode, Converter={StaticResource PointToPointConverter}}" ToolTip="{x:Static Properties:ResourcesTooltips.MainView_Range}"
+ SelectedItem="{Binding SelectedPointToPoint, Converter={StaticResource PointToPointConverter}}" />
<ComboBox Name="StartPoint"
MinWidth="60"
Margin="5,0,0,0"
diff --git a/win/CS/HandBrakeWPF/Views/QueueView.xaml b/win/CS/HandBrakeWPF/Views/QueueView.xaml index 12c63c093..f4a8a7ce1 100644 --- a/win/CS/HandBrakeWPF/Views/QueueView.xaml +++ b/win/CS/HandBrakeWPF/Views/QueueView.xaml @@ -14,6 +14,7 @@ xmlns:helpers="clr-namespace:HandBrakeWPF.Helpers"
xmlns:Properties="clr-namespace:HandBrakeWPF.Properties"
xmlns:queue="clr-namespace:HandBrakeWPF.Converters.Queue"
+ xmlns:main="clr-namespace:HandBrakeWPF.Converters.Main"
Title="{Binding Title}"
Width="975"
Height="550"
@@ -36,6 +37,7 @@ <video:VideoOptionsTooltipConverter x:Key="videoOptionsTooltipConverter" />
<queue:PictureSettingsDescConveter x:Key="pictureSettingsDescConverter" />
<Converters:ThemeImageConverter x:Key="themeConverter" />
+ <main:PointToPointConverter x:Key="PointToPointConverter" />
<Style x:Key="LongToolTipHolder" TargetType="FrameworkElement">
<Setter Property="ToolTipService.ShowDuration" Value="10000" />
@@ -408,6 +410,7 @@ <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
@@ -418,25 +421,38 @@ <TextBlock FontWeight="Bold" Text="{x:Static Properties:Resources.QueueView_Source}" VerticalAlignment="Top" Grid.Row="0" Grid.Column="0" />
<TextBlock Text="{Binding SelectedTask.Task.Source}" TextWrapping="Wrap" Grid.Row="0" Grid.Column="1" />
- <TextBlock FontWeight="Bold" Text="{x:Static Properties:Resources.QueueView_Destination}" VerticalAlignment="Top" Grid.Row="1" Grid.Column="0" />
- <TextBlock Text="{Binding SelectedTask.Task.Destination}" TextWrapping="Wrap" Grid.Row="1" Grid.Column="1" />
+ <TextBlock FontWeight="Bold" Text="{x:Static Properties:Resources.MainView_Title}" VerticalAlignment="Top" Grid.Row="1" Grid.Column="0" />
+
+ <StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="1" Margin="0,0,0,0" >
+ <TextBlock Text="{Binding SelectedTask.Task.Title}" TextWrapping="Wrap"/>
+ <TextBlock Text="{Binding SelectedTask.Task.PointToPointMode, Converter={StaticResource PointToPointConverter}}" TextWrapping="Wrap" Margin="10,0,0,0" FontWeight="Bold"/>
+ <TextBlock Text=":" FontWeight="Bold" />
+ <TextBlock Text="{Binding SelectedTask.Task.StartPoint}" TextWrapping="Wrap" Margin="5,0,0,0"/>
+ <TextBlock Text="to" TextWrapping="Wrap" Margin="5,0,5,0"/>
+ <TextBlock Text="{Binding SelectedTask.Task.EndPoint}" TextWrapping="Wrap"/>
+ </StackPanel>
+
+
- <TextBlock FontWeight="Bold" Text="{x:Static Properties:Resources.QueueView_PictureSettings}" VerticalAlignment="Top" Grid.Row="2" Grid.Column="0" />
- <TextBlock Text="{Binding SelectedTask.Task, Converter={StaticResource pictureSettingsDescConverter}}" TextWrapping="Wrap" Grid.Row="2" Grid.Column="1" />
+ <TextBlock FontWeight="Bold" Text="{x:Static Properties:Resources.QueueView_Destination}" VerticalAlignment="Top" Grid.Row="2" Grid.Column="0" />
+ <TextBlock Text="{Binding SelectedTask.Task.Destination}" TextWrapping="Wrap" Grid.Row="2" Grid.Column="1" />
- <TextBlock FontWeight="Bold" Text="{x:Static Properties:Resources.QueueView_Video}" Grid.Row="3" Grid.Column="0" />
- <TextBlock Text="{Binding SelectedTask.Task, Converter={StaticResource videoOptionsTooltipConverter}}" Grid.Row="3" Grid.Column="1" TextWrapping="Wrap" />
+ <TextBlock FontWeight="Bold" Text="{x:Static Properties:Resources.QueueView_PictureSettings}" VerticalAlignment="Top" Grid.Row="3" Grid.Column="0" />
+ <TextBlock Text="{Binding SelectedTask.Task, Converter={StaticResource pictureSettingsDescConverter}}" TextWrapping="Wrap" Grid.Row="3" Grid.Column="1" />
- <TextBlock FontWeight="Bold" Text="{x:Static Properties:Resources.QueueView_Audio}" Grid.Row="4" Grid.Column="0" VerticalAlignment="Top"/>
+ <TextBlock FontWeight="Bold" Text="{x:Static Properties:Resources.QueueView_Video}" Grid.Row="4" Grid.Column="0" />
+ <TextBlock Text="{Binding SelectedTask.Task, Converter={StaticResource videoOptionsTooltipConverter}}" Grid.Row="4" Grid.Column="1" TextWrapping="Wrap" />
+
+ <TextBlock FontWeight="Bold" Text="{x:Static Properties:Resources.QueueView_Audio}" Grid.Row="5" Grid.Column="0" VerticalAlignment="Top"/>
<TextBlock Text="{Binding SelectedTask.Task.AudioTracks, Converter={StaticResource audioTrackDisplayConverter}}"
- Grid.Row="4" Grid.Column="1" />
+ Grid.Row="5" Grid.Column="1" />
- <TextBlock FontWeight="Bold" VerticalAlignment="Top" Text="{x:Static Properties:Resources.QueueView_Subtitles}" Grid.Row="5" Grid.Column="0" />
+ <TextBlock FontWeight="Bold" VerticalAlignment="Top" Text="{x:Static Properties:Resources.QueueView_Subtitles}" Grid.Row="6" Grid.Column="0" />
<TextBlock Text="{Binding SelectedTask.Task.SubtitleTracks, Converter={StaticResource subtitleTrackDisplayConverter}}"
- Grid.Row="5" Grid.Column="1" />
+ Grid.Row="6" Grid.Column="1" />
- <TextBlock FontWeight="Bold" VerticalAlignment="Top" Grid.Row="6" Grid.Column="0" Text="{x:Static Properties:Resources.QueueView_Advanced}" />
- <TextBlock Text="{Binding SelectedTask.Task, Converter={StaticResource encoderOptionsTooltipConverter}}" Grid.Row="6" Grid.Column="1" TextWrapping="Wrap" />
+ <TextBlock FontWeight="Bold" VerticalAlignment="Top" Grid.Row="7" Grid.Column="0" Text="{x:Static Properties:Resources.QueueView_Advanced}" />
+ <TextBlock Text="{Binding SelectedTask.Task, Converter={StaticResource encoderOptionsTooltipConverter}}" Grid.Row="7" Grid.Column="1" TextWrapping="Wrap" />
</Grid>
</StackPanel>
|