OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 26 Oct 2008 22:19:34 +0000 (22:19 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 26 Oct 2008 22:19:34 +0000 (22:19 +0000)
- Temporary hack to remember top level preset nodes expanded status.

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

win/C#/frmMain.Designer.cs
win/C#/frmMain.cs
win/C#/frmMain.resx

index c2b660d..7f98b16 100644 (file)
@@ -38,7 +38,7 @@ namespace Handbrake
             System.Windows.Forms.Label Label38;\r
             System.Windows.Forms.ContextMenuStrip notifyIconMenu;\r
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));\r
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();\r
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();\r
             this.btn_restore = new System.Windows.Forms.ToolStripMenuItem();\r
             this.DVD_Save = new System.Windows.Forms.SaveFileDialog();\r
             this.File_Save = new System.Windows.Forms.SaveFileDialog();\r
@@ -236,6 +236,7 @@ namespace Handbrake
             this.groupBox_dest = new System.Windows.Forms.GroupBox();\r
             this.btn_destBrowse = new System.Windows.Forms.Button();\r
             this.groupBox2 = new System.Windows.Forms.GroupBox();\r
+            this.splitContainer1 = new System.Windows.Forms.SplitContainer();\r
             this.treeView_presets = new System.Windows.Forms.TreeView();\r
             this.presets_menu = new System.Windows.Forms.ContextMenuStrip(this.components);\r
             this.pmnu_expandAll = new System.Windows.Forms.ToolStripMenuItem();\r
@@ -259,7 +260,6 @@ namespace Handbrake
             this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components);\r
             this.StatusStrip = new System.Windows.Forms.StatusStrip();\r
             this.lbl_encode = new System.Windows.Forms.ToolStripStatusLabel();\r
-            this.splitContainer1 = new System.Windows.Forms.SplitContainer();\r
             Label38 = new System.Windows.Forms.Label();\r
             notifyIconMenu = new System.Windows.Forms.ContextMenuStrip(this.components);\r
             notifyIconMenu.SuspendLayout();\r
@@ -286,12 +286,12 @@ namespace Handbrake
             this.tabPage4.SuspendLayout();\r
             this.groupBox_dest.SuspendLayout();\r
             this.groupBox2.SuspendLayout();\r
-            this.presets_menu.SuspendLayout();\r
-            this.toolStrip1.SuspendLayout();\r
-            this.StatusStrip.SuspendLayout();\r
             this.splitContainer1.Panel1.SuspendLayout();\r
             this.splitContainer1.Panel2.SuspendLayout();\r
             this.splitContainer1.SuspendLayout();\r
+            this.presets_menu.SuspendLayout();\r
+            this.toolStrip1.SuspendLayout();\r
+            this.StatusStrip.SuspendLayout();\r
             this.SuspendLayout();\r
             // \r
             // Label38\r
@@ -651,9 +651,9 @@ namespace Handbrake
             // \r
             // number\r
             // \r
-            dataGridViewCellStyle1.Format = "N0";\r
-            dataGridViewCellStyle1.NullValue = null;\r
-            this.number.DefaultCellStyle = dataGridViewCellStyle1;\r
+            dataGridViewCellStyle3.Format = "N0";\r
+            dataGridViewCellStyle3.NullValue = null;\r
+            this.number.DefaultCellStyle = dataGridViewCellStyle3;\r
             this.number.HeaderText = "Chapter Number";\r
             this.number.MaxInputLength = 3;\r
             this.number.Name = "number";\r
@@ -2953,6 +2953,26 @@ namespace Handbrake
             this.groupBox2.TabStop = false;\r
             this.groupBox2.Text = "Presets";\r
             // \r
+            // splitContainer1\r
+            // \r
+            this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;\r
+            this.splitContainer1.Location = new System.Drawing.Point(3, 17);\r
+            this.splitContainer1.Name = "splitContainer1";\r
+            this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;\r
+            // \r
+            // splitContainer1.Panel1\r
+            // \r
+            this.splitContainer1.Panel1.Controls.Add(this.treeView_presets);\r
+            // \r
+            // splitContainer1.Panel2\r
+            // \r
+            this.splitContainer1.Panel2.Controls.Add(this.btn_addPreset);\r
+            this.splitContainer1.Panel2.Controls.Add(this.btn_removePreset);\r
+            this.splitContainer1.Panel2.Controls.Add(this.btn_setDefault);\r
+            this.splitContainer1.Size = new System.Drawing.Size(239, 526);\r
+            this.splitContainer1.SplitterDistance = 485;\r
+            this.splitContainer1.TabIndex = 1;\r
+            // \r
             // treeView_presets\r
             // \r
             this.treeView_presets.ContextMenuStrip = this.presets_menu;\r
@@ -2966,10 +2986,9 @@ namespace Handbrake
             this.treeView_presets.ShowLines = false;\r
             this.treeView_presets.Size = new System.Drawing.Size(239, 485);\r
             this.treeView_presets.TabIndex = 0;\r
+            this.treeView_presets.MouseUp += new System.Windows.Forms.MouseEventHandler(this.treeview_presets_mouseUp);\r
             this.treeView_presets.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView_presets_AfterSelect);\r
             this.treeView_presets.KeyUp += new System.Windows.Forms.KeyEventHandler(this.treeView_presets_deleteKey);\r
-            this.treeView_presets.MouseUp += new System.Windows.Forms.MouseEventHandler(this.treeview_presets_mouseUp);\r
-\r
             // \r
             // presets_menu\r
             // \r
@@ -3170,26 +3189,6 @@ namespace Handbrake
             this.lbl_encode.Size = new System.Drawing.Size(31, 17);\r
             this.lbl_encode.Text = "{0}";\r
             // \r
-            // splitContainer1\r
-            // \r
-            this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;\r
-            this.splitContainer1.Location = new System.Drawing.Point(3, 17);\r
-            this.splitContainer1.Name = "splitContainer1";\r
-            this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;\r
-            // \r
-            // splitContainer1.Panel1\r
-            // \r
-            this.splitContainer1.Panel1.Controls.Add(this.treeView_presets);\r
-            // \r
-            // splitContainer1.Panel2\r
-            // \r
-            this.splitContainer1.Panel2.Controls.Add(this.btn_addPreset);\r
-            this.splitContainer1.Panel2.Controls.Add(this.btn_removePreset);\r
-            this.splitContainer1.Panel2.Controls.Add(this.btn_setDefault);\r
-            this.splitContainer1.Size = new System.Drawing.Size(239, 526);\r
-            this.splitContainer1.SplitterDistance = 485;\r
-            this.splitContainer1.TabIndex = 1;\r
-            // \r
             // frmMain\r
             // \r
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
@@ -3243,14 +3242,14 @@ namespace Handbrake
             this.groupBox_dest.ResumeLayout(false);\r
             this.groupBox_dest.PerformLayout();\r
             this.groupBox2.ResumeLayout(false);\r
+            this.splitContainer1.Panel1.ResumeLayout(false);\r
+            this.splitContainer1.Panel2.ResumeLayout(false);\r
+            this.splitContainer1.ResumeLayout(false);\r
             this.presets_menu.ResumeLayout(false);\r
             this.toolStrip1.ResumeLayout(false);\r
             this.toolStrip1.PerformLayout();\r
             this.StatusStrip.ResumeLayout(false);\r
             this.StatusStrip.PerformLayout();\r
-            this.splitContainer1.Panel1.ResumeLayout(false);\r
-            this.splitContainer1.Panel2.ResumeLayout(false);\r
-            this.splitContainer1.ResumeLayout(false);\r
             this.ResumeLayout(false);\r
             this.PerformLayout();\r
 \r
index 957fa21..652ff22 100644 (file)
@@ -102,6 +102,8 @@ namespace Handbrake
                 loadUserDefaults();\r
             else\r
                 loadNormalPreset();\r
+            // Expand the preset Nodes\r
+            treeView_presets.ExpandAll();\r
             // Enabled GUI tooltip's if Required\r
             if (Properties.Settings.Default.tooltipEnable == "Checked")\r
                 ToolTip.Active = true;\r
@@ -319,7 +321,24 @@ namespace Handbrake
             if (treeView_presets.SelectedNode != null)\r
             {\r
                 presetHandler.remove(treeView_presets.SelectedNode.Text);\r
+\r
+                // Remember each nodes expanded status so we can reload it\r
+                List<Boolean> nodeStatus = new List<Boolean>();\r
+                foreach (TreeNode node in treeView_presets.Nodes)\r
+                {\r
+                    nodeStatus.Add(node.IsExpanded);\r
+                }\r
+\r
                 loadPresetPanel();\r
+\r
+                int i = 0;\r
+                foreach (TreeNode node in treeView_presets.Nodes)\r
+                {\r
+                    if (nodeStatus[i] == true)\r
+                        node.Expand();\r
+\r
+                    i++;\r
+                }\r
             }\r
             treeView_presets.Select();\r
         }\r
@@ -1385,8 +1404,25 @@ namespace Handbrake
         // Presets\r
         private void btn_addPreset_Click(object sender, EventArgs e)\r
         {\r
+            // Remember each nodes expanded status so we can reload it\r
+            List<Boolean> nodeStatus = new List<Boolean>();\r
+            foreach (TreeNode node in treeView_presets.Nodes)\r
+                nodeStatus.Add(node.IsExpanded);\r
+            nodeStatus.Add(true);\r
+\r
+            // Now add the new preset\r
             Form preset = new frmAddPreset(this, queryGen.GenerateTheQuery(this), presetHandler);\r
             preset.ShowDialog();\r
+\r
+            // And finally, re-expand any of the nodes if required\r
+            int i = 0;\r
+            foreach (TreeNode node in treeView_presets.Nodes)\r
+            {\r
+                if (nodeStatus[i] == true)\r
+                    node.Expand();\r
+\r
+                i++;\r
+            }\r
         }\r
         private void btn_removePreset_Click(object sender, EventArgs e)\r
         {\r
@@ -1395,8 +1431,24 @@ namespace Handbrake
             {\r
                 if (treeView_presets.SelectedNode != null)\r
                     presetHandler.remove(treeView_presets.SelectedNode.Text);\r
+               \r
+                // Remember each nodes expanded status so we can reload it\r
+                List<Boolean> nodeStatus = new List<Boolean>();\r
+                foreach (TreeNode node in treeView_presets.Nodes)\r
+                    nodeStatus.Add(node.IsExpanded);\r
+\r
                 // Now reload the preset panel\r
                 loadPresetPanel();\r
+\r
+                // And finally, re-expand any of the nodes if required\r
+                int i = 0;\r
+                foreach (TreeNode node in treeView_presets.Nodes)\r
+                {\r
+                    if (nodeStatus[i] == true)\r
+                        node.Expand();\r
+\r
+                    i++;\r
+                }\r
             }\r
             treeView_presets.Select();\r
         }\r
@@ -1439,8 +1491,24 @@ namespace Handbrake
                 {\r
                     if (treeView_presets.SelectedNode != null)\r
                         presetHandler.remove(treeView_presets.SelectedNode.Text);\r
+\r
+                    // Remember each nodes expanded status so we can reload it\r
+                    List<Boolean> nodeStatus = new List<Boolean>();\r
+                    foreach (TreeNode node in treeView_presets.Nodes)\r
+                        nodeStatus.Add(node.IsExpanded);\r
+\r
                     // Now reload the preset panel\r
                     loadPresetPanel();\r
+\r
+                    // And finally, re-expand any of the nodes if required\r
+                    int i = 0;\r
+                    foreach (TreeNode node in treeView_presets.Nodes)\r
+                    {\r
+                        if (nodeStatus[i] == true)\r
+                            node.Expand();\r
+\r
+                        i++;\r
+                    }\r
                 }\r
             }\r
         }\r
index 1ae5e66..4601e59 100644 (file)
@@ -155,6 +155,12 @@ Make sure you have selected a "Title" from the "Source" box above otherwise
 the list will not be populated with the correct amount of chapters.\r
 Note: Do not change any of the chapter numbers!</value>\r
   </data>\r
+  <metadata name="number.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
+    <value>True</value>\r
+  </metadata>\r
+  <metadata name="name.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
+    <value>True</value>\r
+  </metadata>\r
   <data name="check_Cabac.ToolTip" xml:space="preserve">\r
     <value>CABAC, or context adaptive binary arithmetic coding, is used by x264 to reduce the bitrate needed for a given quality by 15%. \r
 This makes it very cool and very useful, and it should be left on whenever possible. However, it is incompatible with the iPod 5.5G, and makes the AppleTV struggle. \r