From 2adcc5dca5a2c0b0b10208700641c1c1b7140554 Mon Sep 17 00:00:00 2001 From: sr55 Date: Mon, 25 Dec 2017 16:05:09 +0000 Subject: WinGui: Toolbar Consistency #833 --- win/CS/HandBrakeWPF/Views/MainView.xaml | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml index 9d6e28452..f4fffe924 100644 --- a/win/CS/HandBrakeWPF/Views/MainView.xaml +++ b/win/CS/HandBrakeWPF/Views/MainView.xaml @@ -179,20 +179,6 @@ - - - - + + -- cgit v1.2.3 From 903ceebfcd0eb6cd8b4c6651b3ec93520c25d18e Mon Sep 17 00:00:00 2001 From: sr55 Date: Mon, 25 Dec 2017 16:05:52 +0000 Subject: WinGui: Toolbar Consistency pt2 #833 --- .../Subtitles/CanBurnSubtitleConverter.cs | 47 ++++++++++++++++++++++ .../Properties/ResourcesUI.Designer.cs | 9 +++++ win/CS/HandBrakeWPF/Properties/ResourcesUI.resx | 3 ++ 3 files changed, 59 insertions(+) create mode 100644 win/CS/HandBrakeWPF/Converters/Subtitles/CanBurnSubtitleConverter.cs diff --git a/win/CS/HandBrakeWPF/Converters/Subtitles/CanBurnSubtitleConverter.cs b/win/CS/HandBrakeWPF/Converters/Subtitles/CanBurnSubtitleConverter.cs new file mode 100644 index 000000000..36bd40892 --- /dev/null +++ b/win/CS/HandBrakeWPF/Converters/Subtitles/CanBurnSubtitleConverter.cs @@ -0,0 +1,47 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Subtitle Behaviour Converter +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrakeWPF.Converters.Subtitles +{ + using System; + using System.Globalization; + using System.Windows.Data; + + using HandBrakeWPF.Services.Encode.Model; + using HandBrakeWPF.Services.Encode.Model.Models; + + public class CanBurnSubtitleConverter : IMultiValueConverter + { + + + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + if (values.Length >= 1) + { + bool sourceTrackCanBurn = (bool)values[0]; + SubtitleType type = (SubtitleType)values[1]; + EncodeTask task = values[2] as EncodeTask; + + if (task != null && OutputFormat.Mp4.Equals(task.OutputFormat) && SubtitleType.PGS.Equals(type)) + { + return false; + } + + return sourceTrackCanBurn; + } + + return true; + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs index 089502218..4868b37f5 100644 --- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs @@ -1005,6 +1005,15 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to Show Preview. + /// + public static string MainView_ShowPreview { + get { + return ResourceManager.GetString("MainView_ShowPreview", resourceCulture); + } + } + /// /// Looks up a localized string similar to Show Queue. /// diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx index 0b8c69afa..8379ecb7d 100644 --- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx +++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx @@ -1019,4 +1019,7 @@ This will not affect your current settings in the Subtitle tab. Save New Preset + + Show Preview + \ No newline at end of file -- cgit v1.2.3 From 0ee7c489ca5c0408877d304b65cb1d92160af807 Mon Sep 17 00:00:00 2001 From: sr55 Date: Mon, 25 Dec 2017 16:06:19 +0000 Subject: WinGui: Disable Subtitle Burn In Checkbox for PGS + MP4 #1077 --- win/CS/HandBrakeWPF/HandBrakeWPF.csproj | 1 + .../Services/Encode/Model/Models/SubtitleTrack.cs | 4 +++- win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs | 2 +- win/CS/HandBrakeWPF/Views/SubtitlesView.xaml | 13 +++++++++++-- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj index dea2d44d0..0e2d5c5ea 100644 --- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj +++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj @@ -162,6 +162,7 @@ + diff --git a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/SubtitleTrack.cs b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/SubtitleTrack.cs index d29709310..e481907bb 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/SubtitleTrack.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/SubtitleTrack.cs @@ -171,8 +171,10 @@ namespace HandBrakeWPF.Services.Encode.Model.Models if (this.sourceTrack != null) { this.Track = this.sourceTrack.ToString(); + this.SubtitleType = this.sourceTrack.SubtitleType; } - + + this.NotifyOfPropertyChange(() => this.SubtitleType); this.NotifyOfPropertyChange(() => this.CanBeBurned); this.NotifyOfPropertyChange(() => this.CanBeForced); diff --git a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs index c05fda5e5..bc8ba1ce2 100644 --- a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs @@ -576,7 +576,7 @@ namespace HandBrakeWPF.ViewModels SubtitleTrack track = new SubtitleTrack { - SubtitleType = SubtitleType.VobSub, + SubtitleType = source.SubtitleType, SourceTrack = source, }; diff --git a/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml b/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml index 2268d5aaa..2d4d7492d 100644 --- a/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml +++ b/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml @@ -10,12 +10,14 @@ xmlns:controls="clr-namespace:HandBrakeWPF.Controls" xmlns:splitButton="clr-namespace:HandBrakeWPF.Controls.SplitButton" xmlns:Properties="clr-namespace:HandBrakeWPF.Properties" + xmlns:subtitles="clr-namespace:HandBrakeWPF.Converters.Subtitles" d:DesignHeight="350" d:DesignWidth="500" mc:Ignorable="d" x:Name="subTab"> + + +