summaryrefslogtreecommitdiffstats
path: root/win/CS/Functions
diff options
context:
space:
mode:
authorsr55 <[email protected]>2011-08-27 21:39:15 +0000
committersr55 <[email protected]>2011-08-27 21:39:15 +0000
commit3e32e57c216db0b6acf6166b9f23f2ede3aece30 (patch)
treeb130fe618627832fe6d01f68198f15079d9b840c /win/CS/Functions
parentf73206bf585737a16706b7445a7add49959bc6a3 (diff)
WinGui: Some refactoring of the preset services to make them simpler and restoring old functionality that allowed storing of crop settings to match the macgui.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4194 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/Functions')
-rw-r--r--win/CS/Functions/PresetLoader.cs17
1 files changed, 9 insertions, 8 deletions
diff --git a/win/CS/Functions/PresetLoader.cs b/win/CS/Functions/PresetLoader.cs
index d448c22f2..69acda4b2 100644
--- a/win/CS/Functions/PresetLoader.cs
+++ b/win/CS/Functions/PresetLoader.cs
@@ -12,6 +12,7 @@ namespace Handbrake.Functions
using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Model.Encoding;
using HandBrake.ApplicationServices.Services.Interfaces;
+ using HandBrake.ApplicationServices.Utilities;
using HandBrake.Interop.Model.Encoding;
using OutputFormat = HandBrake.ApplicationServices.Model.Encoding.OutputFormat;
@@ -33,14 +34,14 @@ namespace Handbrake.Functions
/// <param name="mainWindow">
/// FrmMain window
/// </param>
- /// <param name="presetQuery">
- /// The Parsed CLI Query
+ /// <param name="preset">
+ /// The preset.
/// </param>
- /// <param name="name">
- /// Name of the preset
- /// </param>
- public static void LoadPreset(frmMain mainWindow, EncodeTask presetQuery, string name)
+ public static void LoadPreset(frmMain mainWindow, Preset preset)
{
+ // Send the query from the file to the Query Parser class
+ EncodeTask presetQuery = QueryParserUtility.Parse(preset.Query);
+
#region Source
// Reset some vaules to stock first to prevent errors.
@@ -95,7 +96,7 @@ namespace Handbrake.Functions
#region Picture
mainWindow.PictureSettings.check_autoCrop.Checked = true;
- if (presetQuery.IsCustomCropping)
+ if (preset.CropSettings)
{
mainWindow.PictureSettings.check_customCrop.Checked = true;
mainWindow.PictureSettings.crop_top.Value = presetQuery.Cropping.Top;
@@ -282,7 +283,7 @@ namespace Handbrake.Functions
mainWindow.x264Panel.X264Query = presetQuery.AdvancedEncoderOptions;
// Set the preset name
- mainWindow.labelPreset.Text = "Output Settings (Preset: " + name + ")";
+ mainWindow.labelPreset.Text = "Output Settings (Preset: " + preset.Name + ")";
#endregion
}