From 2839ca4c710c080467da7f9d485446400b1e4588 Mon Sep 17 00:00:00 2001 From: sr55 Date: Thu, 21 Aug 2014 15:47:07 +0000 Subject: WinGui: Use OutputFormat display name, rather than the enum name. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6330 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs | 17 +++++++++++++++-- win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs | 2 +- win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 4 +--- win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs | 2 +- win/CS/HandBrakeWPF/Views/MainView.xaml | 7 ++++--- 5 files changed, 22 insertions(+), 10 deletions(-) (limited to 'win/CS/HandBrakeWPF') diff --git a/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs b/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs index 9214745e8..e0aceaf25 100644 --- a/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs @@ -15,6 +15,7 @@ namespace HandBrakeWPF.Converters using System; using HandBrake.ApplicationServices.Model; + using HandBrake.ApplicationServices.Model.Encoding; using HandBrake.ApplicationServices.Utilities; using HandBrake.Interop.Model.Encoding; using HandBrake.Interop.Model.Encoding.x264; @@ -69,7 +70,6 @@ namespace HandBrakeWPF.Converters { return EnumHelper.GetDisplay((QsvPreset)value); } - if (value is IEnumerable) { return EnumHelper.GetEnumDisplayValues(typeof(PresetPictureSettingsMode)); @@ -90,11 +90,14 @@ namespace HandBrakeWPF.Converters { return EnumHelper.GetEnumDisplayValues(typeof(Denoise)); } - if (value is IEnumerable) { return EnumHelper.GetEnumDisplayValues(typeof(VideoScaler)); } + if (value is IEnumerable) + { + return EnumHelper.GetEnumDisplayValues(typeof(OutputFormat)); + } // Single Items if (targetType == typeof(x264Preset) || value.GetType() == typeof(x264Preset)) @@ -148,6 +151,11 @@ namespace HandBrakeWPF.Converters return EnumHelper.GetDisplay((VideoScaler)value); } + if (targetType == typeof(OutputFormat) || value.GetType() == typeof(OutputFormat)) + { + return EnumHelper.GetDisplay((OutputFormat)value); + } + return null; } @@ -223,6 +231,11 @@ namespace HandBrakeWPF.Converters return EnumHelper.GetValue(value.ToString()); } + if (targetType == typeof(OutputFormat) || value.GetType() == typeof(OutputFormat)) + { + return EnumHelper.GetValue(value.ToString()); + } + return null; } } diff --git a/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs b/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs index 0c521661b..1c5a2f955 100644 --- a/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs +++ b/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs @@ -110,7 +110,7 @@ namespace HandBrakeWPF.Helpers /* * File Extension */ - if (task.OutputFormat == OutputFormat.Mp4 || task.OutputFormat == OutputFormat.M4V) + if (task.OutputFormat == OutputFormat.Mp4) { switch (userSettingService.GetUserSetting(UserSettingConstants.UseM4v)) { diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index c91a917f8..fafc1ce2b 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -1527,10 +1527,8 @@ namespace HandBrakeWPF.ViewModels this.SelectedOutputFormat = OutputFormat.Mkv; break; case ".mp4": - this.SelectedOutputFormat = OutputFormat.Mp4; - break; case ".m4v": - this.SelectedOutputFormat = OutputFormat.M4V; + this.SelectedOutputFormat = OutputFormat.Mp4; break; } diff --git a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs index 0219c49af..0161c562b 100644 --- a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs @@ -590,7 +590,7 @@ namespace HandBrakeWPF.ViewModels if ((source.SubtitleType == SubtitleType.PGS || source.SubtitleType == SubtitleType.VobSub || source.SubtitleType == SubtitleType.ForeignAudioSearch) && this.Task != null - && (this.Task.OutputFormat == OutputFormat.Mp4 || this.Task.OutputFormat == OutputFormat.M4V)) + && this.Task.OutputFormat == OutputFormat.Mp4) { if (track.CanBeBurned) { diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml index 15452b201..f243ea6b0 100644 --- a/win/CS/HandBrakeWPF/Views/MainView.xaml +++ b/win/CS/HandBrakeWPF/Views/MainView.xaml @@ -23,7 +23,8 @@ - + +