diff options
author | sr55 <[email protected]> | 2013-07-27 19:48:12 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2013-07-27 19:48:12 +0000 |
commit | eff32e1a98421f42caab1a5bc418efb08b9aa3b5 (patch) | |
tree | 2ff5f749ad5b25079ddba13647fe2fbb794b9b5d /win | |
parent | b41636e8ff8b02ccddba2576e8bca89b14c25a1b (diff) |
WinGui:
- When switching between the video tab and advanced panel, set the advanced tab's advanced query string from the x264 preset.
- Add a copy full query context menu to the "extra options" text box.
- Auto set the Picture settings mode on the Add Preset window.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5673 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win')
8 files changed, 53 insertions, 17 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Model/PresetPictureSettingsMode.cs b/win/CS/HandBrake.ApplicationServices/Model/PresetPictureSettingsMode.cs index 9c7d684ca..030b969e9 100644 --- a/win/CS/HandBrake.ApplicationServices/Model/PresetPictureSettingsMode.cs +++ b/win/CS/HandBrake.ApplicationServices/Model/PresetPictureSettingsMode.cs @@ -20,7 +20,7 @@ namespace HandBrake.ApplicationServices.Model None = 0,
[Display(Name = "Custom")]
Custom = 1,
- [Display(Name = "Current Source Max Size")]
+ [Display(Name = "Source Max Size")]
SourceMaximum = 2,
}
}
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs index 05ecfba15..7dd8fdcf3 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version:4.0.30319.18047
+// Runtime Version:4.0.30319.18052
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx index 2b08ae332..2fd4015ed 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.resx +++ b/win/CS/HandBrakeWPF/Properties/Resources.resx @@ -298,9 +298,7 @@ None: There is no maximum resolution for encodes using this preset. When the pr Custom: You can optionally set a Maximum width and Height. When doing this an encode will be less than or equal to these values. Keep Aspect Ratio will be automatically turned on.
-Source Maximum: Similar to custom, but the resolution of your current source is used as the Max width and Height values instead. Keep Aspect Ratio will be automatically turned on.
-
-No Limit: Always use the full source resolution for all sources keeping aspect ratio. This is the default behaviour.</value>
+Source Maximum: Similar to custom, but the resolution of your current source is used as the Max width and Height values instead. Keep Aspect Ratio will be automatically turned on.</value>
</data>
<data name="Advanced_EncoderOptions" xml:space="preserve">
<value>The options passed to the x264 encoder.
diff --git a/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs index 488f58d74..858f9cbda 100644 --- a/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs @@ -17,6 +17,7 @@ namespace HandBrakeWPF.ViewModels using HandBrake.ApplicationServices.Services;
using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Utilities;
+ using HandBrake.Interop.Model.Encoding;
using HandBrakeWPF.Services.Interfaces;
using HandBrakeWPF.ViewModels.Interfaces;
@@ -65,7 +66,7 @@ namespace HandBrakeWPF.ViewModels this.presetService = presetService;
this.errorService = errorService;
this.Title = "Add Preset";
- this.Preset = new Preset { IsBuildIn = false, IsDefault = false, Category = PresetService.UserPresetCatgoryName, UsePictureFilters = true};
+ this.Preset = new Preset { IsBuildIn = false, IsDefault = false, Category = PresetService.UserPresetCatgoryName, UsePictureFilters = true };
this.PictureSettingsModes = EnumHelper<PresetPictureSettingsMode>.GetEnumList();
}
@@ -127,10 +128,23 @@ namespace HandBrakeWPF.ViewModels /// <param name="task">
/// The Encode Task.
/// </param>
+ /// <param name="title">
+ /// The title.
+ /// </param>
public void Setup(EncodeTask task, Title title)
{
this.Preset.Task = new EncodeTask(task);
this.selectedTitle = title;
+
+ switch (task.Anamorphic)
+ {
+ default:
+ this.SelectedPictureSettingMode = PresetPictureSettingsMode.Custom;
+ break;
+ case Anamorphic.Strict:
+ this.SelectedPictureSettingMode = PresetPictureSettingsMode.SourceMaximum;
+ break;
+ }
}
/// <summary>
@@ -146,11 +160,11 @@ namespace HandBrakeWPF.ViewModels if (this.presetService.CheckIfPresetExists(this.Preset.Name))
{
- MessageBoxResult result = this.errorService.ShowMessageBox("A Preset with this name already exists. Would you like to overwrite it?", "Error", MessageBoxButton.YesNo, MessageBoxImage.Error);
- if (result == MessageBoxResult.No)
- {
- return;
- }
+ MessageBoxResult result = this.errorService.ShowMessageBox("A Preset with this name already exists. Would you like to overwrite it?", "Error", MessageBoxButton.YesNo, MessageBoxImage.Error);
+ if (result == MessageBoxResult.No)
+ {
+ return;
+ }
}
if (this.SelectedPictureSettingMode == PresetPictureSettingsMode.SourceMaximum && this.selectedTitle == null)
diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs index 74c7a1f15..f273f3209 100644 --- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs @@ -14,6 +14,7 @@ namespace HandBrakeWPF.ViewModels using System.ComponentModel;
using System.Globalization;
using System.Linq;
+ using System.Windows;
using Caliburn.Micro;
@@ -27,7 +28,6 @@ namespace HandBrakeWPF.ViewModels using HandBrake.Interop.Model.Encoding.x264;
using HandBrakeWPF.Commands.Interfaces;
- using HandBrakeWPF.Model;
using HandBrakeWPF.Properties;
using HandBrakeWPF.ViewModels.Interfaces;
@@ -173,6 +173,12 @@ namespace HandBrakeWPF.ViewModels {
if (!object.Equals(value, this.useAdvancedTab))
{
+ // Set the Advanced Tab up with the current settings, if we can.
+ if (value && !this.userSettingService.GetUserSetting<bool>(UserSettingConstants.DisableLibHbFeatures))
+ {
+ this.Task.AdvancedEncoderOptions = this.GetActualx264Query();
+ }
+
this.useAdvancedTab = value;
this.Task.ShowAdvancedTab = value;
this.NotifyOfPropertyChange(() => this.UseAdvancedTab);
@@ -873,6 +879,14 @@ namespace HandBrakeWPF.ViewModels this.canClear = true;
}
+ /// <summary>
+ /// The copy query.
+ /// </summary>
+ public void CopyQuery()
+ {
+ Clipboard.SetDataObject(this.SelectedVideoEncoder == VideoEncoder.X264 ? this.GetActualx264Query() : this.ExtraArguments);
+ }
+
#endregion
/// <summary>
diff --git a/win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs index e981b3e02..94d425c7e 100644 --- a/win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs @@ -187,6 +187,7 @@ namespace HandBrakeWPF.ViewModels {
ShowX264AdvancedOptions = this.Task.ShowAdvancedTab;
this.NotifyOfPropertyChange(() => ShowX264AdvancedOptions);
+ this.NotifyOfPropertyChange(() => this.AdvancedOptionsString);
}
}
diff --git a/win/CS/HandBrakeWPF/Views/AddPresetView.xaml b/win/CS/HandBrakeWPF/Views/AddPresetView.xaml index b49b439a6..0c398eaaf 100644 --- a/win/CS/HandBrakeWPF/Views/AddPresetView.xaml +++ b/win/CS/HandBrakeWPF/Views/AddPresetView.xaml @@ -5,7 +5,7 @@ xmlns:Converters="clr-namespace:HandBrakeWPF.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:Properties="clr-namespace:HandBrakeWPF.Properties"
+ xmlns:Properties="clr-namespace:HandBrakeWPF.Properties" xmlns:controls="clr-namespace:HandBrakeWPF.Controls"
Title="{Binding Title}"
Width="350"
ResizeMode="NoResize"
@@ -106,11 +106,13 @@ Orientation="Horizontal"
Visibility="{Binding ShowCustomInputs,
Converter={StaticResource boolToVisConverter}}">
- <TextBox Width="50" Text="{Binding CustomWidth}" />
+ <controls:NumberBox Width="60" Number="{Binding CustomWidth, Mode=TwoWay}" HorizontalAlignment="Left" Margin="0,0,0,5"
+ AllowEmpty="True" />
<TextBlock Margin="10,0,10,0"
FontWeight="Bold"
Text="X" />
- <TextBox Width="50" Text="{Binding CustomHeight}" />
+ <controls:NumberBox Width="60" Number="{Binding CustomHeight, Mode=TwoWay}" HorizontalAlignment="Left" Margin="0,0,0,5"
+ AllowEmpty="True" />
</StackPanel>
<CheckBox Grid.Row="4"
diff --git a/win/CS/HandBrakeWPF/Views/VideoView.xaml b/win/CS/HandBrakeWPF/Views/VideoView.xaml index 7c617c2c1..c4bd565c7 100644 --- a/win/CS/HandBrakeWPF/Views/VideoView.xaml +++ b/win/CS/HandBrakeWPF/Views/VideoView.xaml @@ -5,7 +5,8 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:Converters="clr-namespace:HandBrakeWPF.Converters"
xmlns:Video="clr-namespace:HandBrakeWPF.Converters.Video"
- xmlns:Properties="clr-namespace:HandBrakeWPF.Properties" mc:Ignorable="d" >
+ xmlns:Properties="clr-namespace:HandBrakeWPF.Properties"
+ xmlns:Micro="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro" mc:Ignorable="d" >
<UserControl.Resources>
<Converters:BooleanConverter x:Key="boolConverter" />
@@ -196,7 +197,13 @@ <TextBlock Text="Extra Options:" Grid.Row="4" Grid.Column="0" Margin="0,10,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" />
<TextBox Text="{Binding ExtraArguments, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Height="30" MaxLines="2" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3" Margin="5,10,0,0" VerticalAlignment="Center"
- ToolTip="{Binding FullOptionsTooltip}" Style="{StaticResource LongToolTipHolder}" />
+ ToolTip="{Binding FullOptionsTooltip}" Style="{StaticResource LongToolTipHolder}">
+ <TextBox.ContextMenu>
+ <ContextMenu>
+ <MenuItem Header="Copy Full Query" Micro:Message.Attach="[Event Click] = [Action CopyQuery]" />
+ </ContextMenu>
+ </TextBox.ContextMenu>
+ </TextBox>
</Grid>
|