summaryrefslogtreecommitdiffstats
path: root/win/C#/frmMain.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2008-10-26 22:19:34 +0000
committersr55 <[email protected]>2008-10-26 22:19:34 +0000
commit1e2d93dd99d13644ede212213de3135a6f3b76c9 (patch)
tree69d6d6ecf9464291af1939ac4ed7ecd3b22dd58e /win/C#/frmMain.cs
parentfd4e782adf072f1a3467cfcfdd83b09457e9c157 (diff)
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
Diffstat (limited to 'win/C#/frmMain.cs')
-rw-r--r--win/C#/frmMain.cs68
1 files changed, 68 insertions, 0 deletions
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<Boolean> nodeStatus = new List<Boolean>();
+ 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<Boolean> nodeStatus = new List<Boolean>();
+ 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<Boolean> nodeStatus = new List<Boolean>();
+ 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<Boolean> nodeStatus = new List<Boolean>();
+ 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++;
+ }
}
}
}