From e8d5cc79660cf7e3671c4cfab51da54451e5b14c Mon Sep 17 00:00:00 2001 From: sr55 Date: Fri, 19 Jun 2020 20:26:35 +0100 Subject: WinGui: Minor tweaks to the queue summary screen. - Added the same Filters summary that exists on the main window summary tab to the queue summary window. - Compacted the Advanced summary from 5 to 3 lines. - Match the mac UI and show default/forced on the subtitle tracks. Fixes #2922 --- .../Queue/FilterSettingsDescConverter.cs | 80 ++++++++++++++++++++++ .../Subtitles/SubtitlesQueueDisplayConverter.cs | 10 +++ .../Video/EncoderOptionsTooltipConverter.cs | 3 +- .../HandBrakeWPF/Properties/Resources.Designer.cs | 27 ++++++++ win/CS/HandBrakeWPF/Properties/Resources.resx | 9 +++ win/CS/HandBrakeWPF/Views/QueueView.xaml | 22 +++--- 6 files changed, 141 insertions(+), 10 deletions(-) create mode 100644 win/CS/HandBrakeWPF/Converters/Queue/FilterSettingsDescConverter.cs (limited to 'win') diff --git a/win/CS/HandBrakeWPF/Converters/Queue/FilterSettingsDescConverter.cs b/win/CS/HandBrakeWPF/Converters/Queue/FilterSettingsDescConverter.cs new file mode 100644 index 000000000..d9ef55f22 --- /dev/null +++ b/win/CS/HandBrakeWPF/Converters/Queue/FilterSettingsDescConverter.cs @@ -0,0 +1,80 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrakeWPF.Converters.Queue +{ + using System; + using System.Collections.Generic; + using System.Globalization; + using System.Windows.Data; + using HandBrake.Interop.Interop.Model.Encoding; + + using HandBrakeWPF.Properties; + using HandBrakeWPF.Services.Encode.Model; + using HandBrakeWPF.Utilities; + using HandBrakeWPF.ViewModelItems.Filters; + + public class FilterSettingsDescConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + EncodeTask task = value as EncodeTask; + if (task != null) + { + List filters = new List(); + + if (task.Detelecine != Detelecine.Off) + { + filters.Add(Resources.SummaryView_Detelecine); + } + + if (task.DeinterlaceFilter != DeinterlaceFilter.Off) + { + filters.Add(EnumHelper.GetShortName(task.DeinterlaceFilter)); + } + + if (task.Denoise != Denoise.Off) + { + filters.Add(task.Denoise.ToString()); + } + + if (task.Sharpen != Sharpen.Off) + { + filters.Add(task.Sharpen.ToString()); + } + + if (task.DeblockPreset != null && task.DeblockPreset.Key != DeblockFilter.Off) + { + filters.Add(Resources.SummaryView_Deblock); + } + + if (task.Grayscale) + { + filters.Add(Resources.SummaryView_Grayscale); + } + + if (task.Rotation != 0 || task.FlipVideo) + { + filters.Add(Resources.SummaryView_Rotation); + } + + if (filters.Count == 0) + { + return Resources.SummaryView_NoFilters; + } + + return string.Join(", ", filters).TrimEnd(',').Trim(); + } + + return Resources.SummaryView_NoFilters; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/win/CS/HandBrakeWPF/Converters/Subtitles/SubtitlesQueueDisplayConverter.cs b/win/CS/HandBrakeWPF/Converters/Subtitles/SubtitlesQueueDisplayConverter.cs index 42f336273..f0a64b7b6 100644 --- a/win/CS/HandBrakeWPF/Converters/Subtitles/SubtitlesQueueDisplayConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Subtitles/SubtitlesQueueDisplayConverter.cs @@ -53,6 +53,16 @@ namespace HandBrakeWPF.Converters.Subtitles { text = text + string.Format(", {0}", Resources.SummaryView_Burned); } + + if (track.Forced) + { + text = text + string.Format(", {0}", Resources.SummaryView_Forced); + } + + if (track.Default) + { + text = text + string.Format(", {0}", Resources.SummaryView_Forced); + } sutitleTracks.AppendLine(text); } diff --git a/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs b/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs index c66b339cc..3fcc3e384 100644 --- a/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs @@ -49,7 +49,8 @@ namespace HandBrakeWPF.Converters.Video { VideoTune tune = task.VideoTunes.FirstOrDefault(); - return string.Format("Preset: {0}{5}Tune: {1}{5}Profile: {2}{5}Level: {3}{5}Extra Arguments: {4}{5}", + return string.Format( + "Preset: {0}, Tune: {1}{5}Profile: {2}, Level: {3}{5}Extra Arguments: {4}{5}", task.VideoPreset != null ? task.VideoPreset.ShortName : VideoPreset.None.DisplayName, tune != null ? tune.ShortName : VideoTune.None.DisplayName, task.VideoProfile != null ? task.VideoProfile.ShortName : VideoProfile.Auto.DisplayName, diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs index f56f22cd0..0213629cc 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs @@ -4689,6 +4689,15 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to Filters:. + /// + public static string QueueView_FilterSettings { + get { + return ResourceManager.GetString("QueueView_FilterSettings", resourceCulture); + } + } + /// /// Looks up a localized string similar to Import Queue. /// @@ -5770,6 +5779,15 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to Default. + /// + public static string SummaryView_Default { + get { + return ResourceManager.GetString("SummaryView_Default", resourceCulture); + } + } + /// /// Looks up a localized string similar to Detelecine. /// @@ -5788,6 +5806,15 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to Forced. + /// + public static string SummaryView_Forced { + get { + return ResourceManager.GetString("SummaryView_Forced", resourceCulture); + } + } + /// /// Looks up a localized string similar to Grayscale. /// diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx index e9561f778..d869657b0 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.resx +++ b/win/CS/HandBrakeWPF/Properties/Resources.resx @@ -2271,4 +2271,13 @@ Please choose a different preset. ( Windows 10 Only! ) + + Filters: + + + Default + + + Forced + \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Views/QueueView.xaml b/win/CS/HandBrakeWPF/Views/QueueView.xaml index c8b290118..cb30f44d6 100644 --- a/win/CS/HandBrakeWPF/Views/QueueView.xaml +++ b/win/CS/HandBrakeWPF/Views/QueueView.xaml @@ -29,13 +29,13 @@ - + @@ -417,6 +417,7 @@ + @@ -446,19 +447,22 @@ - - + + + + + - + + Grid.Row="6" Grid.Column="1" /> - + + Grid.Row="7" Grid.Column="1" /> - - + + -- cgit v1.2.3