summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels
diff options
context:
space:
mode:
authorsr55 <[email protected]>2013-07-27 19:48:12 +0000
committersr55 <[email protected]>2013-07-27 19:48:12 +0000
commiteff32e1a98421f42caab1a5bc418efb08b9aa3b5 (patch)
tree2ff5f749ad5b25079ddba13647fe2fbb794b9b5d /win/CS/HandBrakeWPF/ViewModels
parentb41636e8ff8b02ccddba2576e8bca89b14c25a1b (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/CS/HandBrakeWPF/ViewModels')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs26
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs16
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs1
3 files changed, 36 insertions, 7 deletions
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);
}
}