From 7686ecbf127a41291a7fe76852f93fe7a6f60fb4 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 17 Mar 2012 18:36:35 +0000 Subject: WinGui: (WPF) Wired up the Add Preset window and setup the build scripts to create Alpha Builds for this project. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4508 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/frmMain.cs | 38 ++++++++++++++------------------------ 1 file changed, 14 insertions(+), 24 deletions(-) (limited to 'win/CS/frmMain.cs') diff --git a/win/CS/frmMain.cs b/win/CS/frmMain.cs index 8f80de22f..697932940 100644 --- a/win/CS/frmMain.cs +++ b/win/CS/frmMain.cs @@ -841,11 +841,11 @@ namespace Handbrake { if (openPreset.ShowDialog() == DialogResult.OK) { - EncodeTask parsed = PlistPresetHandler.Import(openPreset.FileName); + Preset parsed = PlistPresetHandler.Import(openPreset.FileName); - if (presetHandler.CheckIfPresetExists(parsed.PresetName)) + if (presetHandler.CheckIfPresetExists(parsed.Name)) { - if (!presetHandler.CanUpdatePreset(parsed.PresetName)) + if (!presetHandler.CanUpdatePreset(parsed.Name)) { MessageBox.Show( "You can not import a preset with the same name as a built-in preset.", @@ -861,35 +861,25 @@ namespace Handbrake MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (result == DialogResult.Yes) { - Preset preset = new Preset - { - Name = parsed.PresetName, - Query = QueryGeneratorUtility.GenerateQuery(parsed), - CropSettings = parsed.UsesPictureSettings, - Description = string.Empty, - AudioPassthruSettings = parsed.AllowedPassthruOptions - }; + parsed.Query = QueryGeneratorUtility.GenerateQuery(parsed.Task); + parsed.AudioPassthruSettings = parsed.Task.AllowedPassthruOptions; + parsed.CropSettings = false; - presetHandler.Update(preset); + presetHandler.Update(parsed); } } else { - Preset preset = new Preset - { - Name = parsed.PresetName, - Query = QueryGeneratorUtility.GenerateQuery(parsed), - CropSettings = parsed.UsesPictureSettings, - Description = string.Empty, - AudioPassthruSettings = parsed.AllowedPassthruOptions - }; - - if (presetHandler.Add(preset)) + parsed.Query = QueryGeneratorUtility.GenerateQuery(parsed.Task); + parsed.AudioPassthruSettings = parsed.Task.AllowedPassthruOptions; + parsed.CropSettings = false; + + if (presetHandler.Add(parsed)) { - TreeNode preset_treeview = new TreeNode(parsed.PresetName) + TreeNode preset_treeview = new TreeNode(parsed.Name) { ForeColor = Color.Black, - Tag = preset, + Tag = parsed, }; treeView_presets.Nodes.Add(preset_treeview); } -- cgit v1.2.3