diff options
author | sr55 <[email protected]> | 2009-12-04 18:51:30 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2009-12-04 18:51:30 +0000 |
commit | 01f0aee93cfe61edc811ec29861e9cb823d82bcb (patch) | |
tree | b83101aec5a4edc86f418158d8b3de23237e9207 /win/C# | |
parent | 63eb7563f1ec33d376e516ae9b155cddac91d64f (diff) |
WinGui:
- Hidden feature: Allow user presets to be categorised if they are manually editing the user_presets.xml
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3004 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#')
-rw-r--r-- | win/C#/Presets/PresetsHandler.cs | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/win/C#/Presets/PresetsHandler.cs b/win/C#/Presets/PresetsHandler.cs index 1609c1f8a..8d1da12d6 100644 --- a/win/C#/Presets/PresetsHandler.cs +++ b/win/C#/Presets/PresetsHandler.cs @@ -236,12 +236,12 @@ namespace Handbrake.Presets {
this.LoadPresetData();
presetPanel.Nodes.Clear();
+ string category = string.Empty;
+ TreeNode rootNode = null;
if (_presets.Count != 0) // Built In Presets
{
- string category = string.Empty;
- TreeNode rootNode = null;
-
+
foreach (Preset preset in _presets)
{
if (preset.Category != category)
@@ -256,10 +256,20 @@ namespace Handbrake.Presets }
}
+ rootNode = null; category = null;
foreach (Preset preset in _userPresets) // User Presets
{
- TreeNode presetTreeview = new TreeNode(preset.Name) { ForeColor = Color.Black };
- presetPanel.Nodes.Add(presetTreeview);
+ if (preset.Category != category && preset.Category != null)
+ {
+ rootNode = new TreeNode(preset.Category) { ForeColor = Color.Black };
+ presetPanel.Nodes.Add(rootNode);
+ category = preset.Category;
+ }
+
+ if (preset.Category == category && rootNode != null)
+ rootNode.Nodes.Add(new TreeNode(preset.Name) { ForeColor = Color.Black });
+ else
+ presetPanel.Nodes.Add(new TreeNode(preset.Name) { ForeColor = Color.Black });
}
}
|