]> granicus.if.org Git - handbrake/commitdiff
WinGui: A number of small fixes and Improvements.
authorsr55 <sr55.hb@outlook.com>
Tue, 27 Dec 2016 12:09:13 +0000 (12:09 +0000)
committersr55 <sr55.hb@outlook.com>
Tue, 27 Dec 2016 12:09:21 +0000 (12:09 +0000)
- Fix Update Preset Option.  Add CC and Foreign Audio Scan were not  setting correctly when updating a preset. Fixes #442
- Fix an issue where "Normal" Preset  was showing as default as well as "Fast".
- Fix issues in the preset loading of the Deinterlace/Decomb Presets. Fixes #443
- Make the Video Extra Options Box Fix to area to make it easier to read long option strings.
- Change the logic for enabling the Use Advanced Options box to not look at the option string. Fixes #441

win/CS/HandBrakeWPF/Model/Subtitles/SubtitleBehaviours.cs
win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs
win/CS/HandBrakeWPF/Services/Presets/PresetService.cs
win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs
win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
win/CS/HandBrakeWPF/Views/MainView.xaml
win/CS/HandBrakeWPF/Views/VideoView.xaml

index 8859b1c01c17afc8605e0652b7a033189d6eeb63..11200b450a6635530c2177cf32c9d5b878f36560 100644 (file)
@@ -46,6 +46,8 @@ namespace HandBrakeWPF.Model.Subtitles
             this.SelectedBehaviour = behaviours.selectedBehaviour;\r
             this.SelectedBurnInBehaviour = behaviours.selectedBurnInBehaviour;\r
             this.SelectedLangauges = new BindingList<string>(behaviours.SelectedLangauges.ToList());\r
+            this.AddClosedCaptions = behaviours.AddClosedCaptions;\r
+            this.AddForeignAudioScanTrack = behaviours.AddForeignAudioScanTrack;\r
         }\r
 \r
         /// <summary>\r
index 909ada66f995ae5d0253ebdf742fc283afeafea8..f3b1bd56fe9a6bad35e3f8593a283e8e5d971986 100644 (file)
@@ -107,7 +107,7 @@ namespace HandBrakeWPF.Services.Presets.Factories
                     preset.Task.Deinterlace = Deinterlace.Default;\r
                     preset.Task.DeinterlaceFilter = DeinterlaceFilter.Decomb;\r
                     break;\r
-                case "deinterlace":\r
+                case "yadif":\r
                     preset.Task.Decomb = Decomb.Default;\r
                     preset.Task.Deinterlace = Deinterlace.Default;\r
                     preset.Task.DeinterlaceFilter = DeinterlaceFilter.Yadif;\r
@@ -121,7 +121,7 @@ namespace HandBrakeWPF.Services.Presets.Factories
 \r
             if (preset.Task.DeinterlaceFilter == DeinterlaceFilter.Decomb)\r
             {\r
-                switch (importedPreset.PictureDeinterlaceFilter)\r
+                switch (importedPreset.PictureDeinterlacePreset)\r
                 {\r
                     case "custom":\r
                         preset.Task.Decomb = Decomb.Custom;\r
@@ -151,7 +151,7 @@ namespace HandBrakeWPF.Services.Presets.Factories
 \r
             if (preset.Task.DeinterlaceFilter == DeinterlaceFilter.Yadif)\r
             {\r
-                switch (importedPreset.PictureDeinterlaceFilter)\r
+                switch (importedPreset.PictureDeinterlacePreset)\r
                 {\r
                     case "custom":\r
                         preset.Task.Deinterlace = Deinterlace.Custom;\r
@@ -595,12 +595,19 @@ namespace HandBrakeWPF.Services.Presets.Factories
             preset.PictureDeinterlaceFilter = export.Task.DeinterlaceFilter == DeinterlaceFilter.Decomb\r
                 ? "decomb"\r
                 : export.Task.DeinterlaceFilter == DeinterlaceFilter.Yadif ? "yadif" : "off";\r
+\r
+\r
             preset.PictureDeinterlacePreset = export.Task.DeinterlaceFilter == DeinterlaceFilter.Decomb\r
                 ? EnumHelper<Decomb>.GetShortName(export.Task.Decomb)\r
                 : export.Task.DeinterlaceFilter == DeinterlaceFilter.Yadif ? EnumHelper<Deinterlace>.GetShortName(export.Task.Deinterlace) : string.Empty;\r
+\r
             preset.PictureDeinterlaceCustom = export.Task.DeinterlaceFilter == DeinterlaceFilter.Decomb\r
                 ? export.Task.CustomDecomb\r
                 : export.Task.DeinterlaceFilter == DeinterlaceFilter.Yadif ? export.Task.CustomDeinterlace : string.Empty;\r
+\r
+            preset.PictureCombDetectPreset = EnumHelper<CombDetect>.GetShortName(export.Task.CombDetect);\r
+            preset.PictureCombDetectCustom = export.Task.CustomCombDetect;\r
+\r
             preset.PictureDeinterlaceCustom = export.Task.CustomDeinterlace;\r
             preset.PictureDenoiseCustom = export.Task.CustomDenoise;\r
             preset.PictureDenoiseFilter = EnumHelper<Denoise>.GetShortName(export.Task.Denoise);\r
@@ -608,8 +615,7 @@ namespace HandBrakeWPF.Services.Presets.Factories
             preset.PictureDenoiseTune = EnumHelper<DenoiseTune>.GetShortName(export.Task.DenoiseTune);\r
             preset.PictureDetelecine = EnumHelper<Detelecine>.GetShortName(export.Task.Detelecine);\r
             preset.PictureDetelecineCustom = export.Task.CustomDetelecine;\r
-            preset.PictureCombDetectPreset = EnumHelper<CombDetect>.GetShortName(export.Task.CombDetect);\r
-            preset.PictureCombDetectCustom = export.Task.CustomCombDetect;\r
+      \r
 \r
             // Video\r
             preset.VideoEncoder = EnumHelper<VideoEncoder>.GetShortName(export.Task.VideoEncoder);\r
index 8af0b3d0372c9ce97e4a7f4cabd863840cb64d02..6869b89a2301f5e07f9ff85ba7ec70c668986a61 100644 (file)
@@ -384,11 +384,6 @@ namespace HandBrakeWPF.Services.Presets
 \r
                     preset.Task.AllowedPassthruOptions = new AllowedPassthru(true); // We don't want to override the built-in preset\r
 \r
-                    if (preset.Name == "Normal")\r
-                    {\r
-                        preset.IsDefault = true;\r
-                    }\r
-\r
                     this.presets.Add(preset);\r
                 }\r
             }\r
index 3c5e13f821cf0971e6a5f9b1d363f28a4d0c7f74..67476f57f63594518430815af2b6d46638623725 100644 (file)
@@ -634,6 +634,8 @@ namespace HandBrakeWPF.ViewModels
                     this.SelectedDeinterlaceFilter = DeinterlaceFilter.Off;\r
                 }\r
 \r
+                this.SelectedCombDetectPreset = preset.Task.CombDetect;\r
+\r
                 this.Grayscale = preset.Task.Grayscale;\r
                 this.DeblockValue = preset.Task.Deblock == 0 ? 4 : preset.Task.Deblock;\r
                 this.SelectedDenoisePreset = preset.Task.DenoisePreset;\r
index 7b3cf78130f7e8b9fae4f7ea6237e876c6782bda..9b9daf5c608ae7bae5f961c9809e2437405546ae 100644 (file)
@@ -946,7 +946,7 @@ namespace HandBrakeWPF.ViewModels
                 }\r
 \r
                 this.ExtraArguments = preset.Task.ExtraAdvancedArguments;\r
-                this.UseAdvancedTab = (!string.IsNullOrEmpty(preset.Task.AdvancedEncoderOptions) && this.IsAdvancedTabOptionEnabled) || preset.Task.ShowAdvancedTab;\r
+                this.UseAdvancedTab = this.IsAdvancedTabOptionEnabled && preset.Task.ShowAdvancedTab;\r
             }\r
         }\r
 \r
index cac30d9e50446eeb9b45c01304bb92dfdbeab9ee..e257a4ea8f920c0e904c0d7bc1417a018e39f04d 100644 (file)
                     <ContentControl x:Name="FiltersViewModel" />\r
                 </TabItem>\r
                 <TabItem Name="videoTab" Header="{x:Static Properties:ResourcesUI.MainView_VideoTab}">\r
-                    <ContentControl x:Name="VideoViewModel" />\r
+                    <ContentControl x:Name="VideoViewModel" VerticalAlignment="Stretch" />\r
                 </TabItem>\r
                 <TabItem Name="audioTab" Header="{x:Static Properties:ResourcesUI.MainView_AudioTab}">\r
                     <ContentControl x:Name="AudioViewModel" />\r
index bc6e1881ec8c0c1b45188e627320f313c27eadab..ac615b18b9cd21abc9a9ea75677e16a44b0588e6 100644 (file)
@@ -32,7 +32,7 @@
 \r
             <Grid.RowDefinitions>\r
                 <RowDefinition Height="Auto" />\r
-                <RowDefinition Height="Auto" />\r
+                <RowDefinition Height="*" />\r
             </Grid.RowDefinitions>\r
 \r
             <StackPanel Orientation="Vertical" Grid.Column="0" >\r
@@ -75,7 +75,6 @@
                 </StackPanel>\r
             </StackPanel>\r
 \r
-\r
             <StackPanel Orientation="Vertical" Grid.Column="1">\r
                 <TextBlock Text="Quality" FontWeight="Bold" Margin="0,0,0,10"/>\r
 \r
                         <RowDefinition Height="Auto" />\r
                         <RowDefinition Height="Auto" />\r
                         <RowDefinition Height="Auto" />\r
-                        <RowDefinition Height="Auto" />\r
                         <RowDefinition Height="*" />\r
                     </Grid.RowDefinitions>\r
 \r
                         <ColumnDefinition Width="*" />\r
                     </Grid.ColumnDefinitions>\r
 \r
-\r
-\r
                     <!-- Row 1 -->\r
                     <TextBlock Text="{x:Static Properties:ResourcesUI.VideoView_EncoderPreset}" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" Visibility="{Binding DisplayOptimiseOptions, Converter={StaticResource boolToVisConverter}}" />\r
                     <StackPanel Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Orientation="Horizontal" Visibility="{Binding DisplayOptimiseOptions, Converter={StaticResource boolToVisConverter}}">\r
                         <TextBlock Text="{Binding VideoPreset.DisplayName}" Margin="5,0,0,0" />\r
                     </StackPanel>\r
 \r
-                    <TextBlock Text="{x:Static Properties:ResourcesUI.VideoView_EncodeTune}" Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" Margin="0,10,0,0"\r
+                    <TextBlock Text="{x:Static Properties:ResourcesUI.VideoView_EncodeTune}" Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" Margin="0,5,0,0"\r
                                Visibility="{Binding DisplayTuneControls, Converter={StaticResource boolToVisConverter}}"/>\r
-                    <ComboBox Width="100" Grid.Row="2" Grid.Column="1" Margin="5,10,5,0" Height="22"\r
+                    <ComboBox Width="100" Grid.Row="2" Grid.Column="1" Margin="5,5,5,0" Height="22"\r
                               ItemsSource="{Binding VideoTunes}" DisplayMemberPath="DisplayName" SelectedItem="{Binding VideoTune}"\r
                               ToolTip="{x:Static Properties:ResourcesTooltips.Video_EncoderTune}"  Visibility="{Binding DisplayTuneControls, Converter={StaticResource boolToVisConverter}}"\r
                               Style="{StaticResource LongToolTipHolder}" />\r
-                    <CheckBox IsChecked="{Binding FastDecode}" Content="{x:Static Properties:ResourcesUI.VideoView_FastDecode}" Grid.Row="2" Grid.Column="2" Margin="10,10,10,0" VerticalAlignment="Center"\r
+                    <CheckBox IsChecked="{Binding FastDecode}" Content="{x:Static Properties:ResourcesUI.VideoView_FastDecode}" Grid.Row="2" Grid.Column="2" Margin="10,5,10,0" VerticalAlignment="Center" VerticalContentAlignment="Center"\r
                               ToolTip="{x:Static Properties:ResourcesTooltips.Video_FastDecode}"  Visibility="{Binding DisplayTuneControls, Converter={StaticResource boolToVisConverter}}"/>\r
 \r
           \r
                     <!-- Row 2-->\r
-                    <TextBlock Text="{x:Static Properties:ResourcesUI.VideoView_EncoderProfile}" Grid.Row="3" Grid.Column="0" Margin="0,10,0,0" VerticalAlignment="Center" Visibility="{Binding DisplayProfileControl, Converter={StaticResource boolToVisConverter}}"/>\r
-                    <ComboBox Width="100" Grid.Row="3" Grid.Column="1" Margin="5,10,5,0" Height="22" VerticalAlignment="Center" Visibility="{Binding DisplayProfileControl, Converter={StaticResource boolToVisConverter}}"\r
+                    <TextBlock Text="{x:Static Properties:ResourcesUI.VideoView_EncoderProfile}" Grid.Row="3" Grid.Column="0" Margin="0,5,0,0" VerticalAlignment="Center" Visibility="{Binding DisplayProfileControl, Converter={StaticResource boolToVisConverter}}"/>\r
+                    <ComboBox Width="100" Grid.Row="3" Grid.Column="1" Margin="5,5,5,0" Height="22" VerticalAlignment="Center" Visibility="{Binding DisplayProfileControl, Converter={StaticResource boolToVisConverter}}"\r
                           ItemsSource="{Binding VideoProfiles}" DisplayMemberPath="DisplayName" SelectedItem="{Binding VideoProfile}"\r
                           Style="{StaticResource LongToolTipHolder}" ToolTip="{x:Static Properties:ResourcesTooltips.Video_Profile}"  />\r
 \r
-                    <TextBlock Text="{x:Static Properties:ResourcesUI.VideoView_EncoderLevel}" Grid.Row="3" Grid.Column="2" Margin="10,10,0,0" VerticalAlignment="Center" Visibility="{Binding DisplayLevelControl, Converter={StaticResource boolToVisConverter}}" />\r
-                    <ComboBox Width="100" Grid.Row="3" Grid.Column="3" Margin="5,10,5,0" Height="22" VerticalAlignment="Center" Visibility="{Binding DisplayLevelControl, Converter={StaticResource boolToVisConverter}}"\r
+                    <TextBlock Text="{x:Static Properties:ResourcesUI.VideoView_EncoderLevel}" Grid.Row="3" Grid.Column="2" Margin="10,5,0,0" VerticalAlignment="Center" Visibility="{Binding DisplayLevelControl, Converter={StaticResource boolToVisConverter}}" />\r
+                    <ComboBox Width="100" Grid.Row="3" Grid.Column="3" Margin="5,5,5,0" Height="22" VerticalAlignment="Center" Visibility="{Binding DisplayLevelControl, Converter={StaticResource boolToVisConverter}}"\r
                           ItemsSource="{Binding VideoLevels}"  DisplayMemberPath="DisplayName" SelectedItem="{Binding VideoLevel}"\r
                           Style="{StaticResource LongToolTipHolder}" ToolTip="{x:Static Properties:ResourcesTooltips.Video_Level}" />\r
 \r
                     <!-- Row 3 -->\r
                     <TextBlock Text="{x:Static Properties:ResourcesUI.VideoView_ExtraOptions}" Grid.Row="4" Grid.Column="0" Margin="0,5,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" />\r
-                    <TextBox Text="{Binding ExtraArguments, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" MinWidth="200" Width="365" HorizontalAlignment="Left" TextWrapping="WrapWithOverflow"\r
-                             Height="30" MaxLines="3" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="4" Margin="5,10,0,0" VerticalAlignment="Center"\r
+                    <TextBox Text="{Binding ExtraArguments, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" TextWrapping="WrapWithOverflow"\r
+                             MaxLines="4" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="4" Margin="5,5,5,2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" VerticalContentAlignment="Stretch"\r
                              ToolTip="{Binding FullOptionsTooltip}" Style="{StaticResource LongToolTipHolder}" >\r
                         <TextBox.ContextMenu>\r
                             <ContextMenu>\r