diff options
author | sr55 <[email protected]> | 2007-11-30 23:18:40 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2007-11-30 23:18:40 +0000 |
commit | 35b65e6e13f552193fd910e4778fe38dd4d3406d (patch) | |
tree | feeedee094a2704fb8ebc90773152f5b7f1896e9 /win/C#/frmMain.cs | |
parent | a62a5de1bc665f16223dddde3b6606731e5f9d76 (diff) |
WinGui:
- Changed the presets to a treeview. This will allow presets to have child nodes for additional future presets.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1090 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/frmMain.cs')
-rw-r--r-- | win/C#/frmMain.cs | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 6c6e3489a..9831a1039 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -291,7 +291,7 @@ namespace Handbrake private void mnu_presetReset_Click(object sender, EventArgs e)
{
- listview_presets.Items.Clear();
+ treeView_presets.Nodes.Clear();
grabCLIPresets();
updatePresets();
MessageBox.Show("Presets have been updated", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Information);
@@ -899,16 +899,14 @@ namespace Handbrake presets[15] = "QuickTime";
presets[16] = "Television";
- ListViewItem preset_listview = new ListViewItem();
- string[] presetList = new string[1];
+ TreeNode preset_treeview = new TreeNode();
foreach (string preset in presets)
{
- presetList[0] = preset;
- preset_listview = new ListViewItem(presetList);
+ preset_treeview = new TreeNode(preset);
// Now Fill Out List View with Items
- listview_presets.Items.Add(preset_listview);
+ treeView_presets.Nodes.Add(preset_treeview);
}
}
@@ -925,12 +923,20 @@ namespace Handbrake // Function to select the default preset.
private void loadNormalPreset()
{
- ListViewItem item = listview_presets.FindItemWithText("Normal");
-
- if (item != null)
+
+ int normal = 0;
+ foreach(TreeNode treenode in treeView_presets.Nodes)
{
- item.Selected = true;
+ if (treenode.ToString().Equals("TreeNode: Normal"))
+ normal = treenode.Index;
}
+
+ TreeNode np = treeView_presets.Nodes[normal];
+
+ treeView_presets.SelectedNode = np;
+
+
+
}
// Buttons
@@ -944,15 +950,12 @@ namespace Handbrake }
// Preset Selection
- private void listview_presets_SelectedIndexChanged(object sender, EventArgs e)
+ private void treeView_presets_AfterSelect(object sender, TreeViewEventArgs e)
{
+
string selectedPreset = null;
- ListView.SelectedListViewItemCollection name = null;
- name = listview_presets.SelectedItems;
-
- if (listview_presets.SelectedItems.Count != 0)
- selectedPreset = name[0].SubItems[0].Text;
+ selectedPreset = treeView_presets.SelectedNode.Text;
try
{
@@ -991,7 +994,6 @@ namespace Handbrake MessageBox.Show(exc.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
-
#endregion
//---------------------------------------------------
@@ -1754,7 +1756,6 @@ namespace Handbrake #endregion
-
// This is the END of the road ------------------------------------------------------------------------------
}
}
\ No newline at end of file |