summaryrefslogtreecommitdiffstats
path: root/win/C#/Presets
diff options
context:
space:
mode:
authorsr55 <[email protected]>2010-11-19 19:16:29 +0000
committersr55 <[email protected]>2010-11-19 19:16:29 +0000
commit89de52135fb2fba816979e3971742f4e15d74090 (patch)
tree5cc68d3db47ead719819adef9ee64536f4b7877e /win/C#/Presets
parentb532bf3e365ecdd4ce30cb773b25670d4a050a67 (diff)
WinGui:
- Added support for preset descriptions (currently disabled so as not to interfere with the release) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3682 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Presets')
-rw-r--r--win/C#/Presets/Preset.cs5
-rw-r--r--win/C#/Presets/PresetsHandler.cs21
2 files changed, 18 insertions, 8 deletions
diff --git a/win/C#/Presets/Preset.cs b/win/C#/Presets/Preset.cs
index 024d31667..b6151a3b0 100644
--- a/win/C#/Presets/Preset.cs
+++ b/win/C#/Presets/Preset.cs
@@ -34,5 +34,10 @@ namespace Handbrake.Presets
/// Gets or sets The version number which associates this preset with a HB build
/// </summary>
public string Version { get; set; }
+
+ /// <summary>
+ /// Gets or sets the Description for the preset
+ /// </summary>
+ public string Description { get; set; }
}
} \ No newline at end of file
diff --git a/win/C#/Presets/PresetsHandler.cs b/win/C#/Presets/PresetsHandler.cs
index d53a64ddd..456cdfd8a 100644
--- a/win/C#/Presets/PresetsHandler.cs
+++ b/win/C#/Presets/PresetsHandler.cs
@@ -62,10 +62,13 @@ namespace Handbrake.Presets
/// <param name="pictureSettings">
/// Bool, store crop/picture sizes in the Presets
/// </param>
+ /// <param name="description">
+ /// The description.
+ /// </param>
/// <returns>
/// The add.
/// </returns>
- public bool Add(string presetName, string query, bool pictureSettings)
+ public bool Add(string presetName, string query, bool pictureSettings, string description)
{
if (this.CheckIfPresetExists(presetName) == false)
{
@@ -113,8 +116,7 @@ namespace Handbrake.Presets
}
this.userPresets = newUserPresets;
- // Rebuild the UserPresets.xml file
- this.UpdatePresetFiles();
+ // Rebuild the Preset XML files
this.UpdatePresetFiles();
}
@@ -222,7 +224,8 @@ namespace Handbrake.Presets
Name = presetName[0].Replace("+", string.Empty).Trim(),
Query = presetName[2],
Version = Properties.Settings.Default.hb_version,
- CropSettings = pic
+ CropSettings = pic,
+ Description = string.Empty // Maybe one day we will populate this.
};
this.presets.Add(newPreset);
}
@@ -243,13 +246,15 @@ namespace Handbrake.Presets
{
this.LoadPresetData();
presetPanel.Nodes.Clear();
- string category = string.Empty;
+ string category = string.Empty; // The category we are currnetly processing
TreeNode rootNode = null;
if (this.presets.Count != 0) // Built In Presets
{
foreach (Preset preset in this.presets)
{
+ // If the category of this preset doesn't match the current category we are processing
+ // Then we need to create a new root node.
if (preset.Category != category)
{
rootNode = new TreeNode(preset.Category);
@@ -258,7 +263,7 @@ namespace Handbrake.Presets
}
if (preset.Category == category && rootNode != null)
- rootNode.Nodes.Add(preset.Name);
+ rootNode.Nodes.Add(new TreeNode(preset.Name) { ToolTipText = preset.Description });
}
}
@@ -274,9 +279,9 @@ namespace Handbrake.Presets
}
if (preset.Category == category && rootNode != null)
- rootNode.Nodes.Add(new TreeNode(preset.Name) {ForeColor = Color.Black});
+ rootNode.Nodes.Add(new TreeNode(preset.Name) {ForeColor = Color.Black, ToolTipText = preset.Description});
else
- presetPanel.Nodes.Add(new TreeNode(preset.Name) {ForeColor = Color.Black});
+ presetPanel.Nodes.Add(new TreeNode(preset.Name) { ForeColor = Color.Black, ToolTipText = preset.Description });
}
}