From da4025b6af1d0f5550159b87bf6a14c025752107 Mon Sep 17 00:00:00 2001 From: sr55 Date: Fri, 18 Feb 2011 21:56:19 +0000 Subject: WinGui - Wire in the new preset service. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3799 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/C#/frmAddPreset.cs | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'win/C#/frmAddPreset.cs') diff --git a/win/C#/frmAddPreset.cs b/win/C#/frmAddPreset.cs index 208dd1cc3..bfc804cd5 100644 --- a/win/C#/frmAddPreset.cs +++ b/win/C#/frmAddPreset.cs @@ -8,11 +8,12 @@ namespace Handbrake using System; using System.Windows.Forms; + using HandBrake.ApplicationServices.Model; + using HandBrake.ApplicationServices.Services; + using Handbrake.Functions; using Handbrake.Model; - using Presets; - /// /// The Add Preset Window /// @@ -23,7 +24,7 @@ namespace Handbrake /// /// The Preset Handler /// - private readonly PresetsHandler presetCode; + private readonly PresetService presetCode; /// /// Initializes a new instance of the class. @@ -34,7 +35,7 @@ namespace Handbrake /// /// The preset handler. /// - public frmAddPreset(frmMain mainWindow, PresetsHandler presetHandler) + public frmAddPreset(frmMain mainWindow, PresetService presetHandler) { InitializeComponent(); this.mainWindow = mainWindow; @@ -78,7 +79,16 @@ namespace Handbrake string query = QueryGenerator.GenerateQueryForPreset(mainWindow, pictureSettingsMode, check_useFilters.Checked, 0, 0); - if (presetCode.Add(txt_preset_name.Text.Trim(), query, pictureSettingsMode != QueryPictureSettingsMode.None, string.Empty)) + + Preset preset = new Preset + { + Name = this.txt_preset_name.Text, + Query = query, + CropSettings = pictureSettingsMode != QueryPictureSettingsMode.None, + Description = string.Empty + }; + + if (presetCode.Add(preset)) { this.DialogResult = DialogResult.OK; this.Close(); -- cgit v1.2.3