OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / win / C# / Functions / PresetLoader.cs
index 82d96e6..043436c 100644 (file)
@@ -67,14 +67,12 @@ namespace Handbrake.Functions
             #endregion\r
 \r
             #region Picture\r
-            mainWindow.PictureSettings.check_autoCrop.Checked = true;\r
-            if (presetQuery.CropBottom == "0" && presetQuery.CropTop == "0")\r
-                if (presetQuery.CropLeft == "0" && presetQuery.CropRight == "0")\r
-                    mainWindow.PictureSettings.check_customCrop.Checked = true;\r
-\r
+            \r
             if (pictureSettings) // only Load picture settings if the perset requires it\r
             {\r
-                if (presetQuery.CropTop != null)\r
+                mainWindow.PictureSettings.check_autoCrop.Checked = true;\r
+        \r
+                if (presetQuery.CropValues != null)\r
                 {\r
                     int top, bottom, left, right;\r
                     int.TryParse(presetQuery.CropTop, out top);\r
@@ -98,9 +96,20 @@ namespace Handbrake.Functions
             if (presetQuery.Width != 0)\r
                 mainWindow.PictureSettings.text_width.Value = presetQuery.Width;\r
             else if (presetQuery.MaxWidth == 0)\r
-                mainWindow.PictureSettings.text_width.Value = 0;\r
+            {\r
+                if (mainWindow.selectedTitle != null)\r
+                    if (mainWindow.selectedTitle.Resolution.Width != 0)\r
+                    {\r
+                        mainWindow.PictureSettings.text_width.Value = mainWindow.selectedTitle.Resolution.Width;\r
+                        if (presetQuery.Height == 0 && presetQuery.MaxHeight == 0)\r
+                            mainWindow.PictureSettings.check_KeepAR.Checked = true;\r
+                    }\r
+                    else\r
+                        mainWindow.PictureSettings.text_width.Value = 0;\r
+            }\r
 \r
-            mainWindow.PictureSettings.text_height.Value = presetQuery.Height != 0 ? presetQuery.Height : 0;\r
+            if (presetQuery.Height != 0)\r
+                mainWindow.PictureSettings.text_height.Value = presetQuery.Height;\r
 \r
             // Max Width/Height override Width/Height\r
             if (presetQuery.MaxWidth != 0)\r