diff options
author | sr55 <[email protected]> | 2011-03-20 17:39:20 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2011-03-20 17:39:20 +0000 |
commit | 22393506f087fcb28e4aedab2e7a47d2ae6256ec (patch) | |
tree | 68c4d67356970896ca638f064527f6d6c0326b4e /win/CS/Functions/PresetLoader.cs | |
parent | 24d2785ae92568533caed9528944167ca27e8905 (diff) |
WinGui:
- Bunch of work to help OO the UI code a bit better and prepare for the WPF UI.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3854 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/Functions/PresetLoader.cs')
-rw-r--r-- | win/CS/Functions/PresetLoader.cs | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/win/CS/Functions/PresetLoader.cs b/win/CS/Functions/PresetLoader.cs index 00e8aa46b..373d30ff8 100644 --- a/win/CS/Functions/PresetLoader.cs +++ b/win/CS/Functions/PresetLoader.cs @@ -118,28 +118,32 @@ namespace Handbrake.Functions : CheckState.Unchecked;
// Set the Width and height as Required.
- if (presetQuery.Width != 0)
+ if (presetQuery.Width.HasValue)
{
- mainWindow.PictureSettings.text_width.Value = presetQuery.Width;
+ mainWindow.PictureSettings.text_width.Value = presetQuery.Width.Value;
}
- if (presetQuery.Height != 0)
+ if (presetQuery.Height.HasValue)
{
- mainWindow.PictureSettings.text_height.Value = presetQuery.Height;
+ mainWindow.PictureSettings.text_height.Value = presetQuery.Height.Value;
}
// Max Width/Height override Width/Height
- if (presetQuery.MaxWidth != 0)
+ if (presetQuery.MaxWidth.HasValue)
{
- mainWindow.PictureSettings.text_width.Value = presetQuery.MaxWidth;
+ mainWindow.PictureSettings.text_width.Value = presetQuery.MaxWidth.Value;
}
- if (presetQuery.MaxHeight != 0)
+ if (presetQuery.MaxHeight.HasValue)
{
- mainWindow.PictureSettings.text_height.Value = presetQuery.MaxHeight;
+ mainWindow.PictureSettings.text_height.Value = presetQuery.MaxHeight.Value;
}
- mainWindow.PictureSettings.PresetMaximumResolution = new Size(presetQuery.MaxWidth, presetQuery.MaxHeight);
+ if (presetQuery.MaxHeight.HasValue && presetQuery.MaxWidth.HasValue)
+ {
+ mainWindow.PictureSettings.PresetMaximumResolution = new Size(
+ presetQuery.MaxWidth.Value, presetQuery.MaxHeight.Value);
+ }
// Case where both height and max height are 0 - For built-in presets
if (presetQuery.MaxHeight == 0 && presetQuery.Height == 0)
|