From 1e2d93dd99d13644ede212213de3135a6f3b76c9 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 26 Oct 2008 22:19:34 +0000 Subject: WinGui: - Temporary hack to remember top level preset nodes expanded status. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1871 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/C#/frmMain.Designer.cs | 65 ++++++++++++++++++++++---------------------- win/C#/frmMain.cs | 68 ++++++++++++++++++++++++++++++++++++++++++++++ win/C#/frmMain.resx | 6 ++++ 3 files changed, 106 insertions(+), 33 deletions(-) (limited to 'win/C#') diff --git a/win/C#/frmMain.Designer.cs b/win/C#/frmMain.Designer.cs index c2b660d2c..7f98b16e2 100644 --- a/win/C#/frmMain.Designer.cs +++ b/win/C#/frmMain.Designer.cs @@ -38,7 +38,7 @@ namespace Handbrake System.Windows.Forms.Label Label38; System.Windows.Forms.ContextMenuStrip notifyIconMenu; System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); this.btn_restore = new System.Windows.Forms.ToolStripMenuItem(); this.DVD_Save = new System.Windows.Forms.SaveFileDialog(); this.File_Save = new System.Windows.Forms.SaveFileDialog(); @@ -236,6 +236,7 @@ namespace Handbrake this.groupBox_dest = new System.Windows.Forms.GroupBox(); this.btn_destBrowse = new System.Windows.Forms.Button(); this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.treeView_presets = new System.Windows.Forms.TreeView(); this.presets_menu = new System.Windows.Forms.ContextMenuStrip(this.components); this.pmnu_expandAll = new System.Windows.Forms.ToolStripMenuItem(); @@ -259,7 +260,6 @@ namespace Handbrake this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components); this.StatusStrip = new System.Windows.Forms.StatusStrip(); this.lbl_encode = new System.Windows.Forms.ToolStripStatusLabel(); - this.splitContainer1 = new System.Windows.Forms.SplitContainer(); Label38 = new System.Windows.Forms.Label(); notifyIconMenu = new System.Windows.Forms.ContextMenuStrip(this.components); notifyIconMenu.SuspendLayout(); @@ -286,12 +286,12 @@ namespace Handbrake this.tabPage4.SuspendLayout(); this.groupBox_dest.SuspendLayout(); this.groupBox2.SuspendLayout(); - this.presets_menu.SuspendLayout(); - this.toolStrip1.SuspendLayout(); - this.StatusStrip.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); + this.presets_menu.SuspendLayout(); + this.toolStrip1.SuspendLayout(); + this.StatusStrip.SuspendLayout(); this.SuspendLayout(); // // Label38 @@ -651,9 +651,9 @@ namespace Handbrake // // number // - dataGridViewCellStyle1.Format = "N0"; - dataGridViewCellStyle1.NullValue = null; - this.number.DefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle3.Format = "N0"; + dataGridViewCellStyle3.NullValue = null; + this.number.DefaultCellStyle = dataGridViewCellStyle3; this.number.HeaderText = "Chapter Number"; this.number.MaxInputLength = 3; this.number.Name = "number"; @@ -2953,6 +2953,26 @@ namespace Handbrake this.groupBox2.TabStop = false; this.groupBox2.Text = "Presets"; // + // splitContainer1 + // + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.Location = new System.Drawing.Point(3, 17); + this.splitContainer1.Name = "splitContainer1"; + this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.Controls.Add(this.treeView_presets); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.btn_addPreset); + this.splitContainer1.Panel2.Controls.Add(this.btn_removePreset); + this.splitContainer1.Panel2.Controls.Add(this.btn_setDefault); + this.splitContainer1.Size = new System.Drawing.Size(239, 526); + this.splitContainer1.SplitterDistance = 485; + this.splitContainer1.TabIndex = 1; + // // treeView_presets // this.treeView_presets.ContextMenuStrip = this.presets_menu; @@ -2966,10 +2986,9 @@ namespace Handbrake this.treeView_presets.ShowLines = false; this.treeView_presets.Size = new System.Drawing.Size(239, 485); this.treeView_presets.TabIndex = 0; + this.treeView_presets.MouseUp += new System.Windows.Forms.MouseEventHandler(this.treeview_presets_mouseUp); this.treeView_presets.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView_presets_AfterSelect); this.treeView_presets.KeyUp += new System.Windows.Forms.KeyEventHandler(this.treeView_presets_deleteKey); - this.treeView_presets.MouseUp += new System.Windows.Forms.MouseEventHandler(this.treeview_presets_mouseUp); - // // presets_menu // @@ -3170,26 +3189,6 @@ namespace Handbrake this.lbl_encode.Size = new System.Drawing.Size(31, 17); this.lbl_encode.Text = "{0}"; // - // splitContainer1 - // - this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer1.Location = new System.Drawing.Point(3, 17); - this.splitContainer1.Name = "splitContainer1"; - this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; - // - // splitContainer1.Panel1 - // - this.splitContainer1.Panel1.Controls.Add(this.treeView_presets); - // - // splitContainer1.Panel2 - // - this.splitContainer1.Panel2.Controls.Add(this.btn_addPreset); - this.splitContainer1.Panel2.Controls.Add(this.btn_removePreset); - this.splitContainer1.Panel2.Controls.Add(this.btn_setDefault); - this.splitContainer1.Size = new System.Drawing.Size(239, 526); - this.splitContainer1.SplitterDistance = 485; - this.splitContainer1.TabIndex = 1; - // // frmMain // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -3243,14 +3242,14 @@ namespace Handbrake this.groupBox_dest.ResumeLayout(false); this.groupBox_dest.PerformLayout(); this.groupBox2.ResumeLayout(false); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel2.ResumeLayout(false); + this.splitContainer1.ResumeLayout(false); this.presets_menu.ResumeLayout(false); this.toolStrip1.ResumeLayout(false); this.toolStrip1.PerformLayout(); this.StatusStrip.ResumeLayout(false); this.StatusStrip.PerformLayout(); - this.splitContainer1.Panel1.ResumeLayout(false); - this.splitContainer1.Panel2.ResumeLayout(false); - this.splitContainer1.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 957fa217d..652ff22dd 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -102,6 +102,8 @@ namespace Handbrake loadUserDefaults(); else loadNormalPreset(); + // Expand the preset Nodes + treeView_presets.ExpandAll(); // Enabled GUI tooltip's if Required if (Properties.Settings.Default.tooltipEnable == "Checked") ToolTip.Active = true; @@ -319,7 +321,24 @@ namespace Handbrake if (treeView_presets.SelectedNode != null) { presetHandler.remove(treeView_presets.SelectedNode.Text); + + // Remember each nodes expanded status so we can reload it + List nodeStatus = new List(); + foreach (TreeNode node in treeView_presets.Nodes) + { + nodeStatus.Add(node.IsExpanded); + } + loadPresetPanel(); + + int i = 0; + foreach (TreeNode node in treeView_presets.Nodes) + { + if (nodeStatus[i] == true) + node.Expand(); + + i++; + } } treeView_presets.Select(); } @@ -1385,8 +1404,25 @@ namespace Handbrake // Presets private void btn_addPreset_Click(object sender, EventArgs e) { + // Remember each nodes expanded status so we can reload it + List nodeStatus = new List(); + foreach (TreeNode node in treeView_presets.Nodes) + nodeStatus.Add(node.IsExpanded); + nodeStatus.Add(true); + + // Now add the new preset Form preset = new frmAddPreset(this, queryGen.GenerateTheQuery(this), presetHandler); preset.ShowDialog(); + + // And finally, re-expand any of the nodes if required + int i = 0; + foreach (TreeNode node in treeView_presets.Nodes) + { + if (nodeStatus[i] == true) + node.Expand(); + + i++; + } } private void btn_removePreset_Click(object sender, EventArgs e) { @@ -1395,8 +1431,24 @@ namespace Handbrake { if (treeView_presets.SelectedNode != null) presetHandler.remove(treeView_presets.SelectedNode.Text); + + // Remember each nodes expanded status so we can reload it + List nodeStatus = new List(); + foreach (TreeNode node in treeView_presets.Nodes) + nodeStatus.Add(node.IsExpanded); + // Now reload the preset panel loadPresetPanel(); + + // And finally, re-expand any of the nodes if required + int i = 0; + foreach (TreeNode node in treeView_presets.Nodes) + { + if (nodeStatus[i] == true) + node.Expand(); + + i++; + } } treeView_presets.Select(); } @@ -1439,8 +1491,24 @@ namespace Handbrake { if (treeView_presets.SelectedNode != null) presetHandler.remove(treeView_presets.SelectedNode.Text); + + // Remember each nodes expanded status so we can reload it + List nodeStatus = new List(); + foreach (TreeNode node in treeView_presets.Nodes) + nodeStatus.Add(node.IsExpanded); + // Now reload the preset panel loadPresetPanel(); + + // And finally, re-expand any of the nodes if required + int i = 0; + foreach (TreeNode node in treeView_presets.Nodes) + { + if (nodeStatus[i] == true) + node.Expand(); + + i++; + } } } } diff --git a/win/C#/frmMain.resx b/win/C#/frmMain.resx index 1ae5e6636..4601e5975 100644 --- a/win/C#/frmMain.resx +++ b/win/C#/frmMain.resx @@ -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. Note: Do not change any of the chapter numbers! + + True + + + True + CABAC, or context adaptive binary arithmetic coding, is used by x264 to reduce the bitrate needed for a given quality by 15%. 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. -- cgit v1.2.3