diff options
author | sr55 <[email protected]> | 2014-08-21 15:47:07 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2014-08-21 15:47:07 +0000 |
commit | 2839ca4c710c080467da7f9d485446400b1e4588 (patch) | |
tree | 7e92e723d206a758e66353090654f4dae136dbef /win/CS/HandBrakeWPF | |
parent | 084f08caa5811d92c8865e9ec46a7849f00a9294 (diff) |
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
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r-- | win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs | 17 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs | 2 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 4 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs | 2 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/MainView.xaml | 7 |
5 files changed, 22 insertions, 10 deletions
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<QsvPreset>.GetDisplay((QsvPreset)value);
}
-
if (value is IEnumerable<PresetPictureSettingsMode>)
{
return EnumHelper<PresetPictureSettingsMode>.GetEnumDisplayValues(typeof(PresetPictureSettingsMode));
@@ -90,11 +90,14 @@ namespace HandBrakeWPF.Converters {
return EnumHelper<Denoise>.GetEnumDisplayValues(typeof(Denoise));
}
-
if (value is IEnumerable<VideoScaler>)
{
return EnumHelper<VideoScaler>.GetEnumDisplayValues(typeof(VideoScaler));
}
+ if (value is IEnumerable<OutputFormat>)
+ {
+ return EnumHelper<OutputFormat>.GetEnumDisplayValues(typeof(OutputFormat));
+ }
// Single Items
if (targetType == typeof(x264Preset) || value.GetType() == typeof(x264Preset))
@@ -148,6 +151,11 @@ namespace HandBrakeWPF.Converters return EnumHelper<VideoScaler>.GetDisplay((VideoScaler)value);
}
+ if (targetType == typeof(OutputFormat) || value.GetType() == typeof(OutputFormat))
+ {
+ return EnumHelper<OutputFormat>.GetDisplay((OutputFormat)value);
+ }
+
return null;
}
@@ -223,6 +231,11 @@ namespace HandBrakeWPF.Converters return EnumHelper<VideoScaler>.GetValue(value.ToString());
}
+ if (targetType == typeof(OutputFormat) || value.GetType() == typeof(OutputFormat))
+ {
+ return EnumHelper<OutputFormat>.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<int>(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 @@ <UserControl.Resources>
<Converters:BooleanConverter x:Key="booleanConverter" />
-
+ <Converters:EnumComboConverter x:Key="enumComboConverter" />
+
<Style TargetType="Button">
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Padding" Value="5,1" />
@@ -485,8 +486,8 @@ <ComboBox Name="Container"
MinWidth="100"
Margin="8,0,0,0"
- ItemsSource="{Binding OutputFormats}"
- SelectedItem="{Binding SelectedOutputFormat}"
+ ItemsSource="{Binding OutputFormats, Converter={StaticResource enumComboConverter}}"
+ SelectedItem="{Binding SelectedOutputFormat, Converter={StaticResource enumComboConverter}}"
/>
<CheckBox Name="WebOptimized"
Margin="8,0,0,0"
|