OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 8 Aug 2008 17:08:14 +0000 (17:08 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 8 Aug 2008 17:08:14 +0000 (17:08 +0000)
- Bug Fixes in QueryParser.cs and PresetLoader
- Fixes a bug where an incorrect cropping option get's chosen when a preset is loaded.
- No longer loads Source or destination from the preset.

git-svn-id: svn://localhost/HandBrake/trunk@1619 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/C#/Functions/Common.cs
win/C#/Functions/QueryParser.cs

index 3f68b63..19029fd 100644 (file)
@@ -197,10 +197,7 @@ namespace Handbrake.Functions
             mainWindow.check_iPodAtom.CheckState = CheckState.Unchecked;\r
 \r
             // Now load all the new settings onto the main window\r
-            if (presetQuery.Source != "")\r
-                mainWindow.text_source.Text = presetQuery.Source;\r
-\r
-            selectLongestTitle(mainWindow);\r
+            mainWindow.drp_dvdtitle.Text = "Automatic";\r
             mainWindow.drop_chapterStart.Text = "Auto";\r
             mainWindow.drop_chapterFinish.Text = "Auto";\r
 \r
@@ -220,9 +217,6 @@ namespace Handbrake.Functions
             // Destination tab\r
             #region destination\r
 \r
-            if (presetQuery.Destination != "")\r
-                mainWindow.text_destination.Text = presetQuery.Destination;\r
-\r
             mainWindow.drp_videoEncoder.Text = presetQuery.VideoEncoder;\r
 \r
             if (presetQuery.Format != null)\r
@@ -251,15 +245,25 @@ namespace Handbrake.Functions
 \r
             #endregion\r
 \r
-\r
-\r
             // Picture Settings Tab\r
             #region Picture\r
-            mainWindow.drp_crop.SelectedIndex = 1;\r
-            mainWindow.text_top.Text = presetQuery.CropTop;\r
-            mainWindow.text_bottom.Text = presetQuery.CropBottom;\r
-            mainWindow.text_left.Text = presetQuery.CropLeft;\r
-            mainWindow.text_right.Text = presetQuery.CropRight;\r
+\r
+            if (presetQuery.CropTop == "0" && presetQuery.CropBottom == "0" && presetQuery.CropLeft == "0" && presetQuery.CropRight == "0")\r
+            {\r
+                mainWindow.drp_crop.SelectedIndex = 2;\r
+            }\r
+            else if (presetQuery.CropTop != null && presetQuery.CropBottom != null && presetQuery.CropLeft != null && presetQuery.CropRight != null)\r
+            {\r
+                mainWindow.drp_crop.SelectedIndex = 1;\r
+                mainWindow.text_top.Text = presetQuery.CropTop;\r
+                mainWindow.text_bottom.Text = presetQuery.CropBottom;\r
+                mainWindow.text_left.Text = presetQuery.CropLeft;\r
+                mainWindow.text_right.Text = presetQuery.CropRight;\r
+            }\r
+            else\r
+            {\r
+                mainWindow.drp_crop.SelectedIndex = 0;\r
+            }\r
 \r
             mainWindow.drp_deInterlace_option.Text = presetQuery.DeInterlace;\r
             mainWindow.drp_deNoise.Text = presetQuery.DeNoise;\r
index 8970a56..ec07ba3 100644 (file)
@@ -784,7 +784,7 @@ namespace Handbrake.Functions
 \r
             #region Regular Expressions\r
             //Source\r
-            Regex r1 = new Regex(@"(-i)(?:\s\"")([a-zA-Z0-9:\\\s\.]+)(?:\"")");\r
+            Regex r1 = new Regex(@"(-i)(?:\s\"")([a-zA-Z0-9_\-:\\\s\.]+)(?:\"")");\r
             Match source = r1.Match(input.Replace('"', '\"'));\r
             Match title = Regex.Match(input, @"-t ([0-9]*)");\r
             Match chapters = Regex.Match(input, @"-c ([0-9-]*)");\r
@@ -1238,9 +1238,7 @@ namespace Handbrake.Functions
                 //H264 Tab\r
                 //\r
                 if (x264.Success != false)\r
-                {\r
                     thisQuery.q_h264 = x264.ToString().Replace("-x ", "");\r
-                }\r
 \r
                 //\r
                 //Progam Options\r
@@ -1275,7 +1273,6 @@ namespace Handbrake.Functions
                     return "Automatic";\r
             }\r
         }\r
-\r
         private static string getAudioEncoder(string audioEnc)\r
         {\r
             switch (audioEnc)\r