]> granicus.if.org Git - handbrake/commitdiff
WinGui: Quick hack to force width to update when changing preset for HD sources....
authorsr55 <sr55.hb@outlook.com>
Sat, 18 Feb 2012 20:46:50 +0000 (20:46 +0000)
committersr55 <sr55.hb@outlook.com>
Sat, 18 Feb 2012 20:46:50 +0000 (20:46 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4455 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/Controls/PictureSettings.cs
win/CS/Functions/PresetLoader.cs

index 7684c9ad698b2f9a3f588c8048fd3b52a3dfb42b..8e45b9778f381fc6d9727d8ceeceffd10e678127 100644 (file)
@@ -26,6 +26,7 @@ namespace Handbrake.Controls
         private bool preventChangingDisplayWidth;\r
         private double cachedDar;\r
         private Title sourceTitle;\r
+        private Size presetMaximumResolution;\r
 \r
         /// <summary>\r
         /// Initializes a new instance of the <see cref="PictureSettings"/> class. \r
@@ -67,11 +68,27 @@ namespace Handbrake.Controls
         /// </summary>\r
         public Preset CurrentlySelectedPreset { get; set; }\r
 \r
+        public bool SizeSet { get; set; }\r
+\r
         /// <summary>\r
         /// Gets or sets the maximum allowable size for the encoded resolution. Set a value to\r
         /// "0" if the maximum does not matter.\r
         /// </summary>\r
-        public Size PresetMaximumResolution { get; set; }\r
+        public Size PresetMaximumResolution\r
+        {\r
+            get\r
+            {\r
+                return this.presetMaximumResolution;\r
+            }\r
+            set\r
+            {\r
+                this.presetMaximumResolution = value;\r
+                if (presetMaximumResolution == new Size(0, 0) && !SizeSet && this.sourceTitle != null)\r
+                {\r
+                    text_width.Value = this.sourceTitle.Resolution.Width;\r
+                }\r
+            }\r
+        }\r
 \r
         /// <summary>\r
         /// Set the Preset Crop Warning Label\r
index 47029c935feaa4a862244bbc5446724cc22be6a1..6aacfd9c59c180416484a04c2bf482586e269959 100644 (file)
@@ -147,28 +147,34 @@ namespace Handbrake.Functions
                                                                      ? CheckState.Checked\r
                                                                      : CheckState.Unchecked;\r
 \r
+            bool sizeSet = false;\r
             // Set the Width and height as Required.\r
             if (presetQuery.Width.HasValue)\r
             {\r
                 mainWindow.PictureSettings.text_width.Value = presetQuery.Width.Value;\r
+                sizeSet = true;\r
             }\r
 \r
             if (presetQuery.Height.HasValue)\r
             {\r
                 mainWindow.PictureSettings.text_height.Value = presetQuery.Height.Value;\r
+                sizeSet = true;\r
             }\r
 \r
             // Max Width/Height override Width/Height\r
             if (presetQuery.MaxWidth.HasValue)\r
             {\r
                 mainWindow.PictureSettings.text_width.Value = presetQuery.MaxWidth.Value;\r
+                sizeSet = true;\r
             }\r
 \r
             if (presetQuery.MaxHeight.HasValue)\r
             {\r
                 mainWindow.PictureSettings.text_height.Value = presetQuery.MaxHeight.Value;\r
+                sizeSet = true;\r
             }\r
 \r
+            mainWindow.PictureSettings.SizeSet = sizeSet;\r
             mainWindow.PictureSettings.PresetMaximumResolution = new Size(\r
                      presetQuery.MaxWidth.HasValue ? presetQuery.MaxWidth.Value : 0,\r
                      presetQuery.MaxHeight.HasValue ? presetQuery.MaxHeight.Value : 0);\r