From 382ca3aad89ad78b1c074ee0c272939dd80dc888 Mon Sep 17 00:00:00 2001 From: sr55 Date: Tue, 30 Dec 2008 22:47:48 +0000 Subject: WinGui: - Set Default now set's the currently selected preset to default, not the current settings. - Add Preset can now optionally add a flag to allow saving of picture size information (just like the macgui) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2052 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/C#/frmMain/PresetLoader.cs | 48 +++++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 17 deletions(-) (limited to 'win/C#/frmMain') diff --git a/win/C#/frmMain/PresetLoader.cs b/win/C#/frmMain/PresetLoader.cs index f634909b3..b21b3556a 100644 --- a/win/C#/frmMain/PresetLoader.cs +++ b/win/C#/frmMain/PresetLoader.cs @@ -15,7 +15,7 @@ namespace Handbrake /// /// The Parsed CLI Query /// Name of the preset - public void presetLoader(frmMain mainWindow, Functions.QueryParser presetQuery, string name) + public void presetLoader(frmMain mainWindow, Functions.QueryParser presetQuery, string name, Boolean pictureSettings) { // --------------------------- // Setup the GUI @@ -80,7 +80,35 @@ namespace Handbrake if (presetQuery.CropBottom == "0" && presetQuery.CropTop == "0") if (presetQuery.CropLeft == "0" && presetQuery.CropRight == "0") mainWindow.check_customCrop.Checked = true; - + + mainWindow.text_width.Text = ""; + mainWindow.text_height.Text = ""; + + if (pictureSettings == true) + { + if (presetQuery.CropTop != null) + { + int top, bottom, left, right; + int.TryParse(presetQuery.CropTop, out top); + int.TryParse(presetQuery.CropBottom, out bottom); + int.TryParse(presetQuery.CropLeft, out left); + int.TryParse(presetQuery.CropRight, out right); + + mainWindow.check_customCrop.Checked = true; + mainWindow.text_top.Value = top; + mainWindow.text_bottom.Value = bottom; + mainWindow.text_left.Value = left; + mainWindow.text_right.Value = right; + + } + + if (presetQuery.Width != 0) + mainWindow.text_width.Text = presetQuery.Width.ToString(); + + if (presetQuery.Height != 0) + mainWindow.text_height.Text = presetQuery.Height.ToString(); + } + mainWindow.drp_deInterlace_option.Text = presetQuery.DeInterlace; mainWindow.drp_deNoise.Text = presetQuery.DeNoise; @@ -118,20 +146,6 @@ namespace Handbrake mainWindow.drp_anamorphic.SelectedIndex = 0; } - if (presetQuery.Width != 0) - mainWindow.text_width.Text = presetQuery.Width.ToString(); - else - { - mainWindow.text_width.Text = ""; - } - - if (presetQuery.Height != 0) - mainWindow.text_height.Text = presetQuery.Height.ToString(); - else - { - mainWindow.text_height.Text = ""; - } - // Set the public max width and max height varibles in frmMain // These are used by the query generator to determine if it should use -X or -w / -Y or -h if (presetQuery.MaxWidth != 0) @@ -145,7 +159,7 @@ namespace Handbrake mainWindow.text_height.Text = presetQuery.MaxHeight.ToString(); mainWindow.maxHeight = presetQuery.MaxHeight; } - + #endregion -- cgit v1.2.3