summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsr55 <[email protected]>2017-12-12 21:38:59 +0000
committersr55 <[email protected]>2017-12-12 21:38:59 +0000
commit02bb7c53bf68e0ba64ccd221b3435b444abb744b (patch)
treedfae39db91e22795d26db21f2bc0e250109505cb
parent462d4aa8d369266bbc8204148c6da85930893790 (diff)
WinGui: Initial Activation of the "modified" preset detection code. (Audio/Subtitle Tabs still to be done)
-rw-r--r--win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs18
-rw-r--r--win/CS/HandBrakeWPF/Properties/ResourcesUI.resx6
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs10
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs1
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs41
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs18
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs2
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs4
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs46
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs2
-rw-r--r--win/CS/HandBrakeWPF/Views/MainView.xaml25
11 files changed, 138 insertions, 35 deletions
diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs
index 0546fc14d..e5d724ead 100644
--- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs
+++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs
@@ -826,6 +826,15 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to (Modified).
+ /// </summary>
+ public static string MainView_ModifiedPreset {
+ get {
+ return ResourceManager.GetString("MainView_ModifiedPreset", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Muxing: This may take a while....
/// </summary>
public static string MainView_Muxing {
@@ -961,6 +970,15 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to Selected Preset:.
+ /// </summary>
+ public static string MainView_SelectedPreset {
+ get {
+ return ResourceManager.GetString("MainView_SelectedPreset", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Set Default.
/// </summary>
public static string MainView_SetDefault {
diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx
index 4dd72b89b..74e069650 100644
--- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx
+++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx
@@ -1004,4 +1004,10 @@ This will not affect your current settings in the Subtitle tab.</value>
<data name="MainView_Range" xml:space="preserve">
<value>Range:</value>
</data>
+ <data name="MainView_ModifiedPreset" xml:space="preserve">
+ <value>(Modified)</value>
+ </data>
+ <data name="MainView_SelectedPreset" xml:space="preserve">
+ <value>Selected Preset:</value>
+ </data>
</root> \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
index 9d04261b0..643daaccc 100644
--- a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
@@ -337,7 +337,15 @@ namespace HandBrakeWPF.ViewModels
return false;
}
- if (preset.AudioTrackBehaviours.SelectedLangauges != this.AudioBehaviours.SelectedLangauges)
+ foreach (var language in preset.AudioTrackBehaviours.SelectedLangauges)
+ {
+ if (!this.AudioBehaviours.SelectedLangauges.Contains(language))
+ {
+ return false;
+ }
+ }
+
+ if (preset.AudioTrackBehaviours.SelectedLangauges.Count != this.AudioBehaviours.SelectedLangauges.Count)
{
return false;
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs
index 3939d786a..92420fbe9 100644
--- a/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs
@@ -92,6 +92,7 @@ namespace HandBrakeWPF.ViewModels
{
this.Task.IncludeChapterMarkers = value;
this.NotifyOfPropertyChange(() => this.IncludeChapterMarkers);
+ this.OnTabStatusChanged(null);
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs
index c1fff3015..1582617ec 100644
--- a/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs
@@ -83,6 +83,7 @@ namespace HandBrakeWPF.ViewModels
{
this.CurrentTask.CustomDecomb = value;
this.NotifyOfPropertyChange(() => this.CustomDecomb);
+ this.OnTabStatusChanged(null);
}
}
@@ -100,6 +101,7 @@ namespace HandBrakeWPF.ViewModels
{
this.CurrentTask.CustomDeinterlace = value;
this.NotifyOfPropertyChange(() => this.CustomDeinterlace);
+ this.OnTabStatusChanged(null);
}
}
@@ -117,6 +119,7 @@ namespace HandBrakeWPF.ViewModels
{
this.CurrentTask.CustomDenoise = value;
this.NotifyOfPropertyChange(() => this.CustomDenoise);
+ this.OnTabStatusChanged(null);
}
}
@@ -134,6 +137,7 @@ namespace HandBrakeWPF.ViewModels
{
this.CurrentTask.CustomDetelecine = value;
this.NotifyOfPropertyChange(() => this.CustomDetelecine);
+ this.OnTabStatusChanged(null);
}
}
@@ -174,6 +178,7 @@ namespace HandBrakeWPF.ViewModels
this.CurrentTask.Deblock = value;
this.NotifyOfPropertyChange(() => this.DeblockValue);
this.NotifyOfPropertyChange(() => this.DeblockText);
+ this.OnTabStatusChanged(null);
}
}
@@ -246,6 +251,7 @@ namespace HandBrakeWPF.ViewModels
{
this.CurrentTask.Grayscale = value;
this.NotifyOfPropertyChange(() => this.Grayscale);
+ this.OnTabStatusChanged(null);
}
}
@@ -270,6 +276,7 @@ namespace HandBrakeWPF.ViewModels
this.NotifyOfPropertyChange(() => this.ShowDecombCustom);
this.NotifyOfPropertyChange(() => this.ShowDeinterlaceCustom);
this.NotifyOfPropertyChange(() => this.ShowDeinterlaceDecombCustom);
+ this.OnTabStatusChanged(null);
}
}
@@ -288,8 +295,11 @@ namespace HandBrakeWPF.ViewModels
this.CurrentTask.CombDetect = value;
this.NotifyOfPropertyChange(() => this.SelectedCombDetectPreset);
+ if (value != CombDetect.Custom) this.CustomCombDetect = string.Empty;
+
// Show / Hide the Custom Control
this.NotifyOfPropertyChange(() => this.ShowCombDetectCustom);
+ this.OnTabStatusChanged(null);
}
}
@@ -318,6 +328,7 @@ namespace HandBrakeWPF.ViewModels
{
this.CurrentTask.CustomCombDetect = value;
this.NotifyOfPropertyChange(() => this.CustomCombDetect);
+ this.OnTabStatusChanged(null);
}
}
@@ -342,6 +353,7 @@ namespace HandBrakeWPF.ViewModels
this.NotifyOfPropertyChange(() => this.ShowDecombCustom);
this.NotifyOfPropertyChange(() => this.ShowDeinterlaceCustom);
this.NotifyOfPropertyChange(() => this.ShowDeinterlaceDecombCustom);
+ this.OnTabStatusChanged(null);
}
}
@@ -368,6 +380,7 @@ namespace HandBrakeWPF.ViewModels
this.NotifyOfPropertyChange(() => this.ShowDenoiseOptions);
this.NotifyOfPropertyChange(() => this.ShowDenoiseTune);
+ this.OnTabStatusChanged(null);
}
}
@@ -390,6 +403,7 @@ namespace HandBrakeWPF.ViewModels
this.ShowDetelecineCustom = this.CurrentTask.Detelecine == Detelecine.Custom;
if (value != Detelecine.Custom) this.CustomDetelecine = string.Empty;
this.NotifyOfPropertyChange(() => this.ShowDetelecineCustom);
+ this.OnTabStatusChanged(null);
}
}
@@ -460,6 +474,7 @@ namespace HandBrakeWPF.ViewModels
this.NotifyOfPropertyChange(() => this.ShowDecombCustom);
this.NotifyOfPropertyChange(() => this.ShowDeinterlaceCustom);
this.NotifyOfPropertyChange(() => this.ShowDeinterlaceDecombCustom);
+ this.OnTabStatusChanged(null);
}
}
@@ -492,6 +507,7 @@ namespace HandBrakeWPF.ViewModels
{
this.CurrentTask.DenoiseTune = value;
this.NotifyOfPropertyChange(() => this.SelectedDenoiseTune);
+ this.OnTabStatusChanged(null);
}
}
@@ -516,6 +532,7 @@ namespace HandBrakeWPF.ViewModels
this.NotifyOfPropertyChange(() => this.ShowDenoiseCustom);
this.NotifyOfPropertyChange(() => this.ShowDenoiseOptions);
this.NotifyOfPropertyChange(() => this.ShowDenoiseTune);
+ this.OnTabStatusChanged(null);
}
}
@@ -582,6 +599,7 @@ namespace HandBrakeWPF.ViewModels
{
this.CurrentTask.Rotation = value;
this.NotifyOfPropertyChange(() => this.SelectedRotation);
+ this.OnTabStatusChanged(null);
}
}
@@ -599,6 +617,7 @@ namespace HandBrakeWPF.ViewModels
{
this.CurrentTask.FlipVideo = value;
this.NotifyOfPropertyChange(() => this.FlipVideo);
+ this.OnTabStatusChanged(null);
}
}
@@ -651,6 +670,7 @@ namespace HandBrakeWPF.ViewModels
this.NotifyOfPropertyChange(() => this.SelectedSharpenTune);
this.NotifyOfPropertyChange(() => this.SelectedSharpenPreset);
+ this.OnTabStatusChanged(null);
}
}
@@ -667,6 +687,7 @@ namespace HandBrakeWPF.ViewModels
this.NotifyOfPropertyChange(() => this.SelectedSharpenPreset);
this.NotifyOfPropertyChange(() => this.ShowSharpenTune);
this.NotifyOfPropertyChange(() => this.ShowSharpenCustom);
+ this.OnTabStatusChanged(null);
}
}
@@ -681,6 +702,7 @@ namespace HandBrakeWPF.ViewModels
if (value == this.CurrentTask.SharpenTune) return;
this.CurrentTask.SharpenTune = value;
this.NotifyOfPropertyChange(() => this.SelectedSharpenTune);
+ this.OnTabStatusChanged(null);
}
}
@@ -695,6 +717,7 @@ namespace HandBrakeWPF.ViewModels
if (value == this.CurrentTask.SharpenCustom) return;
this.CurrentTask.SharpenCustom = value;
this.NotifyOfPropertyChange(() => this.CustomSharpen);
+ this.OnTabStatusChanged(null);
}
}
@@ -862,17 +885,17 @@ namespace HandBrakeWPF.ViewModels
return false;
}
- if (preset.Task.CustomDecomb != this.CustomDecomb)
+ if ((preset.Task.CustomDecomb ?? string.Empty) != (this.CustomDecomb ?? string.Empty))
{
return false;
}
- if (preset.Task.CustomDeinterlace != this.CustomDeinterlace)
+ if ((preset.Task.CustomDeinterlace ?? string.Empty) != (this.CustomDeinterlace ?? string.Empty))
{
return false;
}
- if (preset.Task.CustomCombDetect != this.CustomCombDetect)
+ if ((preset.Task.CustomCombDetect ?? string.Empty) != (this.CustomCombDetect ?? string.Empty))
{
return false;
}
@@ -882,12 +905,12 @@ namespace HandBrakeWPF.ViewModels
return false;
}
- if (preset.Task.DenoisePreset != this.SelectedDenoisePreset)
+ if (this.SelectedDenoise != Denoise.Off && preset.Task.DenoisePreset != this.SelectedDenoisePreset)
{
return false;
}
- if (preset.Task.DenoiseTune != this.SelectedDenoiseTune)
+ if (this.SelectedDenoise != Denoise.Off && preset.Task.DenoiseTune != this.SelectedDenoiseTune)
{
return false;
}
@@ -897,17 +920,19 @@ namespace HandBrakeWPF.ViewModels
return false;
}
- if (!Equals(preset.Task.SharpenPreset, this.SelectedSharpenPreset))
+ if (this.SelectedSharpen != Sharpen.Off && !Equals(preset.Task.SharpenPreset, this.SelectedSharpenPreset))
{
return false;
}
- if (!Equals(preset.Task.SharpenTune, this.SelectedSharpenTune))
+ if (this.SelectedSharpen != Sharpen.Off && !Equals(preset.Task.SharpenTune, this.SelectedSharpenTune))
{
return false;
}
- if (preset.Task.Deblock != this.DeblockValue)
+ int presetDeblock = preset.Task.Deblock == 0 ? 4 : preset.Task.Deblock;
+
+ if (presetDeblock != this.DeblockValue)
{
return false;
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index 9478680eb..fd65c9c67 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -2122,6 +2122,7 @@ namespace HandBrakeWPF.ViewModels
{
// Tab Settings
this.isSettingPreset = true;
+ this.IsModifiedPreset = false;
this.PictureSettingsViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
this.VideoViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
this.FiltersViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
@@ -2268,6 +2269,16 @@ namespace HandBrakeWPF.ViewModels
bool matchesPreset = this.PictureSettingsViewModel.MatchesPreset(this.selectedPreset);
+ if (!this.SummaryViewModel.MatchesPreset(this.selectedPreset))
+ {
+ matchesPreset = false;
+ }
+
+ if (!this.PictureSettingsViewModel.MatchesPreset(this.selectedPreset))
+ {
+ matchesPreset = false;
+ }
+
if (!this.VideoViewModel.MatchesPreset(this.selectedPreset))
{
matchesPreset = false;
@@ -2303,12 +2314,7 @@ namespace HandBrakeWPF.ViewModels
matchesPreset = false;
}
- if (!this.SummaryViewModel.MatchesPreset(this.selectedPreset))
- {
- matchesPreset = false;
- }
-
- this.IsModifiedPreset = matchesPreset;
+ this.IsModifiedPreset = !matchesPreset;
}
/// <summary>
diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
index 8d2635485..e95579673 100644
--- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
@@ -571,6 +571,7 @@ namespace HandBrakeWPF.ViewModels
this.Task.Anamorphic = value;
this.NotifyOfPropertyChange(() => this.SelectedAnamorphicMode);
this.RecaulcatePictureSettingsProperties(ChangedPictureField.Anamorphic);
+ this.OnTabStatusChanged(null);
}
}
}
@@ -590,6 +591,7 @@ namespace HandBrakeWPF.ViewModels
this.Task.Modulus = value;
this.NotifyOfPropertyChange(() => this.SelectedModulus);
this.RecaulcatePictureSettingsProperties(ChangedPictureField.Modulus);
+ this.OnTabStatusChanged(null);
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs
index 5409e7502..248ff157d 100644
--- a/win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs
@@ -202,6 +202,7 @@ namespace HandBrakeWPF.ViewModels
this.SetExtension(string.Format(".{0}", this.Task.OutputFormat.ToString().ToLower()));
this.OnOutputFormatChanged(new OutputFormatChangedEventArgs(null));
+ this.OnTabStatusChanged(null);
}
}
}
@@ -239,6 +240,7 @@ namespace HandBrakeWPF.ViewModels
}
this.Task.OptimizeMP4 = value;
this.NotifyOfPropertyChange(() => this.OptimizeMP4);
+ this.OnTabStatusChanged(null);
}
}
@@ -259,6 +261,7 @@ namespace HandBrakeWPF.ViewModels
}
this.Task.IPod5GSupport = value;
this.NotifyOfPropertyChange(() => this.IPod5GSupport);
+ this.OnTabStatusChanged(null);
}
}
@@ -276,6 +279,7 @@ namespace HandBrakeWPF.ViewModels
}
this.Task.AlignAVStart = value;
this.NotifyOfPropertyChange(() => this.AlignAVStart);
+ this.OnTabStatusChanged(null);
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
index 5b6caa1f5..e36a75b4e 100644
--- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
@@ -183,6 +183,7 @@ namespace HandBrakeWPF.ViewModels
}
this.NotifyOfPropertyChange(() => this.IsConstantFramerate);
+ this.OnTabStatusChanged(null);
}
}
@@ -211,6 +212,7 @@ namespace HandBrakeWPF.ViewModels
}
this.NotifyOfPropertyChange(() => this.IsConstantQuantity);
+ this.OnTabStatusChanged(null);
}
}
@@ -233,6 +235,7 @@ namespace HandBrakeWPF.ViewModels
}
this.NotifyOfPropertyChange(() => this.IsPeakFramerate);
+ this.OnTabStatusChanged(null);
}
}
@@ -255,6 +258,7 @@ namespace HandBrakeWPF.ViewModels
}
this.NotifyOfPropertyChange(() => this.IsVariableFramerate);
+ this.OnTabStatusChanged(null);
}
}
@@ -360,6 +364,7 @@ namespace HandBrakeWPF.ViewModels
this.NotifyOfPropertyChange(() => this.RF);
this.NotifyOfPropertyChange(() => this.DisplayRF);
this.NotifyOfPropertyChange(() => this.IsLossless);
+ this.OnTabStatusChanged(null);
}
}
@@ -380,6 +385,7 @@ namespace HandBrakeWPF.ViewModels
}
this.Task.VideoBitrate = value;
this.NotifyOfPropertyChange(() => this.VideoBitrate);
+ this.OnTabStatusChanged(null);
}
}
@@ -408,6 +414,7 @@ namespace HandBrakeWPF.ViewModels
{
this.Task.TwoPass = value;
this.NotifyOfPropertyChange(() => this.TwoPass);
+ this.OnTabStatusChanged(null);
}
}
@@ -425,6 +432,7 @@ namespace HandBrakeWPF.ViewModels
{
this.Task.TurboFirstPass = value;
this.NotifyOfPropertyChange(() => this.TurboFirstPass);
+ this.OnTabStatusChanged(null);
}
}
@@ -489,6 +497,7 @@ namespace HandBrakeWPF.ViewModels
this.NotifyOfPropertyChange(() => this.SelectedFramerate);
this.NotifyOfPropertyChange(() => this.Task);
+ this.OnTabStatusChanged(null);
}
}
@@ -512,6 +521,7 @@ namespace HandBrakeWPF.ViewModels
this.NotifyOfPropertyChange(() => this.SelectedVideoEncoder);
this.HandleEncoderChange(this.Task.VideoEncoder);
this.HandleRFChange();
+ this.OnTabStatusChanged(null);
}
}
}
@@ -564,6 +574,7 @@ namespace HandBrakeWPF.ViewModels
this.Task.ExtraAdvancedArguments = value;
this.NotifyOfPropertyChange(() => this.ExtraArguments);
this.NotifyOfPropertyChange(() => FullOptionsTooltip);
+ this.OnTabStatusChanged(null);
}
}
}
@@ -694,6 +705,7 @@ namespace HandBrakeWPF.ViewModels
this.NotifyOfPropertyChange(() => this.FastDecode);
this.NotifyOfPropertyChange(() => this.FullOptionsTooltip);
+ this.OnTabStatusChanged(null);
}
}
@@ -711,6 +723,7 @@ namespace HandBrakeWPF.ViewModels
this.Task.VideoPreset = value;
this.NotifyOfPropertyChange(() => this.VideoPreset);
this.NotifyOfPropertyChange(() => this.FullOptionsTooltip);
+ this.OnTabStatusChanged(null);
}
}
@@ -791,6 +804,7 @@ namespace HandBrakeWPF.ViewModels
this.NotifyOfPropertyChange(() => this.VideoTune);
this.NotifyOfPropertyChange(() => this.FullOptionsTooltip);
+ this.OnTabStatusChanged(null);
}
}
@@ -808,6 +822,7 @@ namespace HandBrakeWPF.ViewModels
this.Task.VideoProfile = value;
this.NotifyOfPropertyChange(() => this.VideoProfile);
this.NotifyOfPropertyChange(() => this.FullOptionsTooltip);
+ this.OnTabStatusChanged(null);
}
}
@@ -825,6 +840,7 @@ namespace HandBrakeWPF.ViewModels
this.Task.VideoLevel = value;
this.NotifyOfPropertyChange(() => this.VideoLevel);
this.NotifyOfPropertyChange(() => this.FullOptionsTooltip);
+ this.OnTabStatusChanged(null);
}
}
@@ -1046,6 +1062,16 @@ namespace HandBrakeWPF.ViewModels
{
return false;
}
+
+ if (preset.Task.TwoPass != this.Task.TwoPass)
+ {
+ return false;
+ }
+
+ if (preset.Task.TurboFirstPass != this.Task.TurboFirstPass)
+ {
+ return false;
+ }
}
else
{
@@ -1055,16 +1081,6 @@ namespace HandBrakeWPF.ViewModels
}
}
- if (preset.Task.TwoPass != this.Task.TwoPass)
- {
- return false;
- }
-
- if (preset.Task.TurboFirstPass != this.Task.TurboFirstPass)
- {
- return false;
- }
-
if (this.Task.VideoEncoder == VideoEncoder.X264 || this.Task.VideoEncoder == VideoEncoder.X264_10
|| this.Task.VideoEncoder == VideoEncoder.X265 || this.Task.VideoEncoder == VideoEncoder.X265_10
|| this.Task.VideoEncoder == VideoEncoder.X265_12 || this.Task.VideoEncoder == VideoEncoder.QuickSync
@@ -1084,7 +1100,15 @@ namespace HandBrakeWPF.ViewModels
}
}
- if (preset.Task.VideoTunes != this.Task.VideoTunes)
+ foreach (VideoTune tune in preset.Task.VideoTunes)
+ {
+ if (!this.Task.VideoTunes.Contains(tune))
+ {
+ return false;
+ }
+ }
+
+ if (preset.Task.VideoTunes.Count != this.Task.VideoTunes.Count)
{
return false;
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs
index 806b763be..951db4657 100644
--- a/win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs
@@ -959,7 +959,7 @@ namespace HandBrakeWPF.ViewModels
public bool MatchesPreset(Preset preset)
{
- return false;
+ return true;
}
/// <summary>
diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml
index cf6b45635..2bb8a6746 100644
--- a/win/CS/HandBrakeWPF/Views/MainView.xaml
+++ b/win/CS/HandBrakeWPF/Views/MainView.xaml
@@ -353,17 +353,26 @@
<Label Content="Presets" FontWeight="Bold" VerticalAlignment="Center" />
<StackPanel Orientation="Horizontal" Margin="8,0,0,0" Visibility="{Binding IsPresetPanelShowing, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}">
- <Button x:Name="SelectPresetsButton" Margin="15,0,0,0" VerticalAlignment="Center" Click="SelectPreset_OnClick" Width="250">
+ <Button x:Name="SelectPresetsButton" Margin="15,0,0,0" VerticalAlignment="Center" Click="SelectPreset_OnClick" Width="255">
<Button.Content>
- <StackPanel Orientation="Horizontal" VerticalAlignment="Stretch">
- <TextBlock Margin="0,0,5,0" Padding="0"
- VerticalAlignment="Center" Width="215"
+ <Grid VerticalAlignment="Stretch" Width="235">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="*" />
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
+ <TextBlock Margin="0,0,5,0" Padding="0" Grid.Column="0"
+ VerticalAlignment="Center"
Text="{Binding SelectedPreset.DisplayValue}" TextTrimming="CharacterEllipsis" />
- <Path Height="8" Margin="2,0,0,1" VerticalAlignment="Center" HorizontalAlignment="Center"
+ <TextBlock Text="(Modified)" Margin="0,0,5,0" FontStyle="Italic" VerticalAlignment="Center" Grid.Column="1"
+ Visibility="{Binding IsModifiedPreset, Converter={StaticResource boolToVisConverter}, TargetNullValue=Collapsed, FallbackValue=Collapsed}"/>
+
+ <Path Height="8" Margin="2,0,0,1" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Column="3"
Data="M 0 0 L 4 4 L 0 8 Z"
Fill="{DynamicResource GlyphBrush}" x:Name="dropdownArrowSelectPreset" />
- </StackPanel>
+ </Grid>
</Button.Content>
<Button.ContextMenu>
@@ -407,9 +416,9 @@
</Button>
</StackPanel>
<StackPanel Margin="8,0,0,0" Orientation="Horizontal" Visibility="{Binding IsPresetPanelShowing, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}">
- <TextBlock Text="Selected Preset:" Margin="5,0,0,0" />
+ <TextBlock Text="{x:Static Properties:ResourcesUI.MainView_SelectedPreset}" Margin="5,0,0,0" />
<TextBlock Text="{Binding SelectedPreset.Name}" Margin="5,0,0,0" />
- <TextBlock Text="(Default)" Visibility="{Binding SelectedPreset.IsDefault, Converter={StaticResource boolToVisConverter}}" Margin="5,0,0,0" />
+ <TextBlock Text="{x:Static Properties:ResourcesUI.MainView_ModifiedPreset}" FontStyle="Italic" Visibility="{Binding IsModifiedPreset, Converter={StaticResource boolToVisConverter}}" Margin="5,0,0,0" />
</StackPanel>