]> granicus.if.org Git - handbrake/commitdiff
WinGui: (0.9.x) Fix Default preset option not working for custom presets.
authorsr55 <sr55.hb@outlook.com>
Fri, 23 Mar 2012 21:27:25 +0000 (21:27 +0000)
committersr55 <sr55.hb@outlook.com>
Fri, 23 Mar 2012 21:27:25 +0000 (21:27 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/0.9.x@4528 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/frmMain.cs

index e4fec9c3f12c43fe729b3deb6c61f940acf58bf9..b70b44a6afef3bdeac3e9f9807bd3483dea41452 100644 (file)
@@ -622,7 +622,7 @@ namespace Handbrake
             Form preset = new frmAddPreset(this, presetHandler);\r
             if (preset.ShowDialog() == DialogResult.OK)\r
             {\r
-                TreeNode presetTreeview = new TreeNode(presetHandler.LastPresetAdded.Name) { ForeColor = Color.Black };\r
+                TreeNode presetTreeview = new TreeNode(presetHandler.LastPresetAdded.Name) { ForeColor = Color.Black, Tag = presetHandler.LastPresetAdded };\r
                 treeView_presets.Nodes.Add(presetTreeview);\r
                 presetHandler.LastPresetAdded = null;\r
             }\r
@@ -826,10 +826,19 @@ namespace Handbrake
         {\r
             foreach (TreeNode treenode in treeView_presets.Nodes)\r
             {\r
+                if (treenode.Tag != null && ((Preset)treenode.Tag).Name == presetName)\r
+                {\r
+                    treeView_presets.SelectedNode = treenode;\r
+                    return;\r
+                }\r
+\r
                 foreach (TreeNode node in treenode.Nodes)\r
                 {\r
                     if (node.Text.Equals(presetName))\r
+                    {\r
                         treeView_presets.SelectedNode = node;\r
+                        return;\r
+                    }\r
                 }\r
             }\r
         }\r