summaryrefslogtreecommitdiffstats
path: root/win/C#
diff options
context:
space:
mode:
authorsr55 <[email protected]>2009-09-03 10:52:29 +0000
committersr55 <[email protected]>2009-09-03 10:52:29 +0000
commit2d2071ab5e70b291fd1fb9b5f44c5624350eefc4 (patch)
tree8ed5e2d4409d7ce18a88139e3fa951b690507f67 /win/C#
parent16aeb409c898386e42221c983f7ae515ecab0ceb (diff)
WinGui:
- Simplify code in the preset handler. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2803 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#')
-rw-r--r--win/C#/Presets/PresetsHandler.cs238
-rw-r--r--win/C#/Presets/preset.cs10
-rw-r--r--win/C#/Program.cs2
-rw-r--r--win/C#/frmAddPreset.cs2
-rw-r--r--win/C#/frmMain.cs40
5 files changed, 111 insertions, 181 deletions
diff --git a/win/C#/Presets/PresetsHandler.cs b/win/C#/Presets/PresetsHandler.cs
index 52e13a354..1609c1f8a 100644
--- a/win/C#/Presets/PresetsHandler.cs
+++ b/win/C#/Presets/PresetsHandler.cs
@@ -16,25 +16,25 @@ namespace Handbrake.Presets
{
public class PresetsHandler
{
- List<Preset> presets = new List<Preset>();
- List<Preset> user_presets = new List<Preset>();
- private static readonly XmlSerializer ser = new XmlSerializer(typeof(List<Preset>));
- string userPresetFile = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\user_presets.xml";
- string hbPresetFile = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\presets.xml";
+ List<Preset> _presets = new List<Preset>();
+ List<Preset> _userPresets = new List<Preset>();
+ private static readonly XmlSerializer Ser = new XmlSerializer(typeof(List<Preset>));
+ readonly string _userPresetFile = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\user_presets.xml";
+ readonly string _hbPresetFile = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\presets.xml";
/// <summary>
/// Add a new preset to the system
/// </summary>
/// <param name="presetName">String, The name of the new preset</param>
/// <param name="query">String, the CLI query for the new preset</param>
- /// <param name="pictureSettings"> Bool, store crop/picture sizes in the presets</param>
- public Boolean addPreset(string presetName, string query, Boolean pictureSettings)
+ /// <param name="pictureSettings"> Bool, store crop/picture sizes in the _presets</param>
+ public Boolean Add(string presetName, string query, Boolean pictureSettings)
{
- if (checkIfPresetExists(presetName) == false)
+ if (CheckIfPresetExists(presetName) == false)
{
- Preset newPreset = new Preset { Name = presetName, Query = query, PictureSettings = pictureSettings, Version = Properties.Settings.Default.hb_version};
- user_presets.Add(newPreset);
- updateUserPresetsFile();
+ Preset newPreset = new Preset { Name = presetName, Query = query, PictureSettings = pictureSettings, Version = Properties.Settings.Default.hb_version };
+ _userPresets.Add(newPreset);
+ UpdatePresetFiles();
return true;
}
return false;
@@ -44,43 +44,43 @@ namespace Handbrake.Presets
/// Remove a preset with a given name from either the built in or user preset list.
/// </summary>
/// <param name="name">String, the preset name</param>
- public void remove(string name)
+ public void Remove(string name)
{
List<Preset> newPresets = new List<Preset>();
List<Preset> newUserPresets = new List<Preset>();
// Built In Presets
- foreach (Preset item in presets)
+ foreach (Preset item in _presets)
{
if (item.Name != name)
{
newPresets.Add(item);
}
}
- presets = newPresets;
+ _presets = newPresets;
// User Presets
- foreach (Preset item in user_presets)
+ foreach (Preset item in _userPresets)
{
if (item.Name != name)
{
newUserPresets.Add(item);
}
}
- user_presets = newUserPresets;
+ _userPresets = newUserPresets;
- // Rebuild the user_presets.xml file
- updateUserPresetsFile();
- updatePresetsFile();
+ // Rebuild the _userPresets.xml file
+ UpdatePresetFiles();
+ UpdatePresetFiles();
}
/// <summary>
- /// Remove all built in presets;
+ /// Remove all built in _presets;
/// </summary>
- public void removeBuiltInPresets()
+ public void RemoveBuiltInPresets()
{
- presets.Clear();
- updatePresetsFile();
+ _presets.Clear();
+ UpdatePresetFiles();
}
/// <summary>
@@ -89,17 +89,17 @@ namespace Handbrake.Presets
/// <param name="presetName">String, The name of the new preset</param>
/// <param name="query">String, the CLI query for the new preset</param>
/// <param name="pictureSettings"> Bool, store crop/picture sizes in the preset</param>
- public void updatePreset(string presetName, string query, Boolean pictureSettings)
+ public void Update(string presetName, string query, Boolean pictureSettings)
{
// User Presets
- foreach (Preset item in user_presets)
+ foreach (Preset item in _userPresets)
{
if (item.Name == presetName)
{
item.Query = query;
item.PictureSettings = pictureSettings;
MessageBox.Show("Changes to \"" + presetName + "\" Saved", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
- updateUserPresetsFile();
+ UpdatePresetFiles();
}
}
}
@@ -109,17 +109,17 @@ namespace Handbrake.Presets
/// </summary>
/// <param name="name">String, The preset's name</param>
/// <returns>String, the CLI query for the given preset name</returns> not
- public Preset getPreset(string name)
+ public Preset GetPreset(string name)
{
// Built In Presets
- foreach (Preset item in presets)
+ foreach (Preset item in _presets)
{
if (item.Name == name)
return item;
}
// User Presets
- foreach (Preset item in user_presets)
+ foreach (Preset item in _userPresets)
{
if (item.Name == name)
return item;
@@ -131,9 +131,9 @@ namespace Handbrake.Presets
/// <summary>
/// Reads the CLI's CLI output format and load's them into the preset List<Preset>
/// </summary>
- public void updateBuiltInPresets()
+ public void UpdateBuiltInPresets()
{
- // Create a new tempory file and execute the CLI to get the built in presets.
+ // Create a new tempory file and execute the CLI to get the built in _presets.
string handbrakeCLIPath = Path.Combine(Application.StartupPath, "HandBrakeCLI.exe");
string presetsPath = Path.Combine(Path.GetTempPath(), "temp_presets.dat");
string strCmdLine = String.Format(@"cmd /c """"{0}"" --preset-list >""{1}"" 2>&1""", handbrakeCLIPath, presetsPath);
@@ -147,39 +147,20 @@ namespace Handbrake.Presets
hbproc.Close();
}
- // Clear the current built in presets and now parse the tempory presets file.
- presets.Clear();
- string filePath = Path.Combine(Path.GetTempPath(), "temp_presets.dat");
+ // Clear the current built in _presets and now parse the tempory _presets file.
+ _presets.Clear();
- if (File.Exists(filePath))
+ if (File.Exists(presetsPath))
{
- StreamReader presetInput = new StreamReader(filePath);
+ StreamReader presetInput = new StreamReader(presetsPath);
- int level = 1;
string category = String.Empty;
- string level_1_category = String.Empty;
while (!presetInput.EndOfStream)
{
string line = presetInput.ReadLine();
if (line.Contains("<") && !line.Contains("<<")) // Found the beginning of a preset block
- {
- level = 1;
category = line.Replace("<", "").Trim();
- level_1_category = category;
- }
-
- if (line.Contains("<<")) // found a sub preset block
- {
- level = 2;
- category = line.Replace("<<", "").Trim();
- }
-
- if (line.Trim().Contains(">>")) // End of sub preset block
- {
- level = 1;
- category = level_1_category;
- }
if (line.Contains("+")) // A Preset
{
@@ -187,64 +168,61 @@ namespace Handbrake.Presets
string[] presetName = r.Split(line);
Preset newPreset = new Preset
- {
- Level = level,
- Category = category,
- TopCategory = level_1_category,
+ { Category = category,
Name = presetName[0].Replace("+", "").Trim(),
Query = presetName[2],
Version = Properties.Settings.Default.hb_version,
PictureSettings = true
};
- presets.Add(newPreset);
+ _presets.Add(newPreset);
}
}
presetInput.Close();
presetInput.Dispose();
}
- // Finally, Create a new or update the current presets.xml file
- updatePresetsFile();
+ // Finally, Create a new or update the current _presets.xml file
+ UpdatePresetFiles();
}
/// <summary>
- /// Load in the preset data from presets.xml and user_presets.xml
- /// Load it into the 2 arraylist's presets and user_presets
+ /// Load in the preset data from _presets.xml and _userPresets.xml
+ /// Load it into the 2 arraylist's _presets and _userPresets
/// </summary>
- private void loadPresetData()
+ private void LoadPresetData()
{
- // First clear the presets arraylists
- presets.Clear();
- user_presets.Clear();
+ // First clear the _presets arraylists
+ _presets.Clear();
+ _userPresets.Clear();
- // Load in the users presets from user_presets.xml
- if (File.Exists(hbPresetFile))
+ // Load in the users _presets from _userPresets.xml
+ if (File.Exists(_hbPresetFile))
{
- using (FileStream strm = new FileStream(hbPresetFile, FileMode.Open, FileAccess.Read))
+ using (FileStream strm = new FileStream(_hbPresetFile, FileMode.Open, FileAccess.Read))
{
if (strm.Length != 0)
{
- List<Preset> list = ser.Deserialize(strm) as List<Preset>;
+ List<Preset> list = Ser.Deserialize(strm) as List<Preset>;
if (list != null)
foreach (Preset preset in list)
- presets.Add(preset);
+ _presets.Add(preset);
}
}
}
- // Load in the users presets from user_presets.xml
- if (File.Exists(userPresetFile))
+ // Load in the users _presets from _userPresets.xml
+ if (File.Exists(_userPresetFile))
{
- using (FileStream strm = new FileStream(userPresetFile, FileMode.Open, FileAccess.Read))
+ using (FileStream strm = new FileStream(_userPresetFile, FileMode.Open, FileAccess.Read))
{
if (strm.Length != 0)
{
- List<Preset> list = ser.Deserialize(strm) as List<Preset>;
+ List<Preset> list = Ser.Deserialize(strm) as List<Preset>;
if (list != null)
foreach (Preset preset in list)
- user_presets.Add(preset);
+ _userPresets.Add(preset);
}
}
}
@@ -254,92 +232,54 @@ namespace Handbrake.Presets
/// Setup the frmMain preset panel
/// </summary>
/// <param name="presetPanel"></param>
- public void getPresetPanel(ref TreeView presetPanel)
+ public void GetPresetPanel(ref TreeView presetPanel)
{
- this.loadPresetData();
+ this.LoadPresetData();
presetPanel.Nodes.Clear();
- if (presets.Count != 0)
+ if (_presets.Count != 0) // Built In Presets
{
- string category = presets[0].Category;
- TreeNode rootNode = new TreeNode(presets[0].Category);
- TreeNode childNode = null;
- Boolean addChildNode = false;
+ string category = string.Empty;
+ TreeNode rootNode = null;
- foreach (Preset preset in presets)
+ foreach (Preset preset in _presets)
{
- // Deal with Root
- if (preset.Category == category && preset.TopCategory == category)
- rootNode.Nodes.Add(preset.Name);
- else if (preset.Category != category && preset.TopCategory == category) // Deal with child nodes for that root
- {
- if (childNode == null) // For the first child node
- childNode = new TreeNode(preset.Category);
-
- childNode.Nodes.Add(preset.Name);
- addChildNode = true;
- }
- else if (preset.Category != category && preset.TopCategory != category && preset.Level == 1)// Deal with changing root nodes
+ if (preset.Category != category)
{
- // If we find there are child nodes, add them to the current root node set before adding the rootnode to the panel.
- if (addChildNode)
- {
- rootNode.Nodes.Add(childNode);
- childNode = null;
- addChildNode = false;
- }
- // Add the current rootnodes to the panel, and prepare for a new category of presets
- presetPanel.Nodes.Add(rootNode);
rootNode = new TreeNode(preset.Category);
- rootNode.Nodes.Add(preset.Name);
-
+ presetPanel.Nodes.Add(rootNode);
category = preset.Category;
}
+
+ if (preset.Category == category && rootNode != null)
+ rootNode.Nodes.Add(preset.Name);
}
- presetPanel.Nodes.Add(rootNode); // Add the final set of nodes
}
- // User Presets
- foreach (Preset preset in user_presets)
+ foreach (Preset preset in _userPresets) // User Presets
{
- TreeNode preset_treeview = new TreeNode(preset.Name) { ForeColor = Color.Black };
- presetPanel.Nodes.Add(preset_treeview);
+ TreeNode presetTreeview = new TreeNode(preset.Name) { ForeColor = Color.Black };
+ presetPanel.Nodes.Add(presetTreeview);
}
}
/// <summary>
- /// Updates the presets.xml file which contains the built in presets
- /// It takes the List of Presets and converts them into XML which is stored in presets.xml
+ /// Update the preset files
/// </summary>
- private void updatePresetsFile()
+ private void UpdatePresetFiles()
{
- string userPresets = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\presets.xml";
try
{
- using (FileStream strm = new FileStream(userPresets, FileMode.Create, FileAccess.Write))
+ using (FileStream strm = new FileStream(_hbPresetFile, FileMode.Create, FileAccess.Write))
{
- ser.Serialize(strm, presets);
+ Ser.Serialize(strm, _presets);
strm.Close();
strm.Dispose();
}
- }
- catch (Exception exc)
- {
- MessageBox.Show("Unable to write to the file. Please make sure the location has the correct permissions for file writing.\n Error Information: \n\n" + exc, "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
- }
- }
- /// <summary>
- /// Updates the user_presets.xml file which contains the built in presets
- /// It takes the List of Presets and converts them into XML which is stored in user_presets.xml
- /// </summary>
- private void updateUserPresetsFile()
- {
- try
- {
- using (FileStream strm = new FileStream(userPresetFile, FileMode.Create, FileAccess.Write))
+ using (FileStream strm = new FileStream(_userPresetFile, FileMode.Create, FileAccess.Write))
{
- ser.Serialize(strm, user_presets);
+ Ser.Serialize(strm, _userPresets);
strm.Close();
strm.Dispose();
}
@@ -351,24 +291,24 @@ namespace Handbrake.Presets
}
/// <summary>
- /// Check if the preset "name" exists in either presets or user_presets lists.
+ /// Check if the preset "name" exists in either _presets or _userPresets lists.
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- private Boolean checkIfPresetExists(string name)
+ private Boolean CheckIfPresetExists(string name)
{
if (name == string.Empty)
return true;
// Built In Presets
- foreach (Preset item in presets)
+ foreach (Preset item in _presets)
{
if (item.Name == name)
return true;
}
// User Presets
- foreach (Preset item in user_presets)
+ foreach (Preset item in _userPresets)
{
if (item.Name == name)
return true;
@@ -378,17 +318,17 @@ namespace Handbrake.Presets
}
/// <summary>
- /// Check if the user preset "name" exists in user_presets list.
+ /// Check if the user preset "name" exists in _userPresets list.
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public Boolean checkIfUserPresetExists(string name)
+ public Boolean CheckIfUserPresetExists(string name)
{
if (name == string.Empty)
return false;
// User Presets
- foreach (Preset item in user_presets)
+ foreach (Preset item in _userPresets)
{
if (item.Name == name)
return true;
@@ -398,18 +338,18 @@ namespace Handbrake.Presets
}
/// <summary>
- /// Check if the built in presets stored are not out of date.
+ /// Check if the built in _presets stored are not out of date.
/// Update them if they are.
/// </summary>
/// <returns></returns>
- public Boolean checkIfPresetsAreOutOfDate()
+ public Boolean CheckIfPresetsAreOutOfDate()
{
- loadPresetData();
- // Update built-in presets if the built-in presets belong to an older version.
- if (presets.Count != 0)
- if (presets[0].Version != Properties.Settings.Default.hb_version)
+ LoadPresetData();
+ // Update built-in _presets if the built-in _presets belong to an older version.
+ if (_presets.Count != 0)
+ if (_presets[0].Version != Properties.Settings.Default.hb_version)
{
- updateBuiltInPresets();
+ UpdateBuiltInPresets();
return true;
}
diff --git a/win/C#/Presets/preset.cs b/win/C#/Presets/preset.cs
index dd7628f3c..088d39c85 100644
--- a/win/C#/Presets/preset.cs
+++ b/win/C#/Presets/preset.cs
@@ -11,21 +11,11 @@ namespace Handbrake.Presets
public class Preset
{
/// <summary>
- /// Get or Set the preset's level. This indicated if it is a root or child node
- /// </summary>
- public int Level { get; set; }
-
- /// <summary>
/// Get or Set the category which the preset resides under
/// </summary>
public string Category { get; set; }
/// <summary>
- /// Get or Set the top level category for the preset.
- /// </summary>
- public string TopCategory { get; set; }
-
- /// <summary>
/// Get or Set the preset name
/// </summary>
public string Name { get; set; }
diff --git a/win/C#/Program.cs b/win/C#/Program.cs
index 64ef81b6b..71f1385f2 100644
--- a/win/C#/Program.cs
+++ b/win/C#/Program.cs
@@ -31,7 +31,7 @@ namespace Handbrake
if (!File.Exists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"HandBrake\presets.xml")))
{
PresetsHandler x = new PresetsHandler();
- x.updateBuiltInPresets();
+ x.UpdateBuiltInPresets();
}
Application.EnableVisualStyles();
diff --git a/win/C#/frmAddPreset.cs b/win/C#/frmAddPreset.cs
index 0ddba9a62..8ffd76320 100644
--- a/win/C#/frmAddPreset.cs
+++ b/win/C#/frmAddPreset.cs
@@ -30,7 +30,7 @@ namespace Handbrake
if (check_pictureSettings.Checked)
pictureSettings = true;
- if (presetCode.addPreset(txt_preset_name.Text.Trim(), query, pictureSettings))
+ if (presetCode.Add(txt_preset_name.Text.Trim(), query, pictureSettings))
{
TreeNode preset_treeview = new TreeNode(txt_preset_name.Text.Trim()) { ForeColor = Color.Black };
frmMainWindow.treeView_presets.Nodes.Add(preset_treeview);
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs
index ec2b3a6e1..e6bcdac69 100644
--- a/win/C#/frmMain.cs
+++ b/win/C#/frmMain.cs
@@ -90,10 +90,10 @@ namespace Handbrake
// Load the user's default settings or Normal Preset
if (Properties.Settings.Default.defaultPreset != "")
{
- if (presetHandler.getPreset(Properties.Settings.Default.defaultPreset) != null)
+ if (presetHandler.GetPreset(Properties.Settings.Default.defaultPreset) != null)
{
- string query = presetHandler.getPreset(Properties.Settings.Default.defaultPreset).Query;
- Boolean loadPictureSettings = presetHandler.getPreset(Properties.Settings.Default.defaultPreset).PictureSettings;
+ string query = presetHandler.GetPreset(Properties.Settings.Default.defaultPreset).Query;
+ Boolean loadPictureSettings = presetHandler.GetPreset(Properties.Settings.Default.defaultPreset).PictureSettings;
if (query != null)
{
@@ -351,7 +351,7 @@ namespace Handbrake
#region Presets Menu
private void mnu_presetReset_Click(object sender, EventArgs e)
{
- presetHandler.updateBuiltInPresets();
+ presetHandler.UpdateBuiltInPresets();
loadPresetPanel();
if (treeView_presets.Nodes.Count == 0)
MessageBox.Show("Unable to load the presets.xml file. Please select \"Update Built-in Presets\" from the Presets Menu. \nMake sure you are running the program in Admin mode if running on Vista. See Windows FAQ for details!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
@@ -362,7 +362,7 @@ namespace Handbrake
}
private void mnu_delete_preset_Click(object sender, EventArgs e)
{
- presetHandler.removeBuiltInPresets();
+ presetHandler.RemoveBuiltInPresets();
loadPresetPanel(); // Reload the preset panel
}
private void mnu_SelectDefault_Click(object sender, EventArgs e)
@@ -455,15 +455,15 @@ namespace Handbrake
{
DialogResult result = MessageBox.Show("Do you wish to include picture settings when updating the preset: " + treeView_presets.SelectedNode.Text, "Update Preset", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
if (result == DialogResult.Yes)
- presetHandler.updatePreset(treeView_presets.SelectedNode.Text, QueryGenerator.GenerateTabbedComponentsQuery(this), true);
+ presetHandler.Update(treeView_presets.SelectedNode.Text, QueryGenerator.GenerateTabbedComponentsQuery(this), true);
else if (result == DialogResult.No)
- presetHandler.updatePreset(treeView_presets.SelectedNode.Text, QueryGenerator.GenerateTabbedComponentsQuery(this), false);
+ presetHandler.Update(treeView_presets.SelectedNode.Text, QueryGenerator.GenerateTabbedComponentsQuery(this), false);
}
private void pmnu_delete_click(object sender, EventArgs e)
{
if (treeView_presets.SelectedNode != null)
{
- presetHandler.remove(treeView_presets.SelectedNode.Text);
+ presetHandler.Remove(treeView_presets.SelectedNode.Text);
treeView_presets.Nodes.Remove(treeView_presets.SelectedNode);
}
treeView_presets.Select();
@@ -475,7 +475,7 @@ namespace Handbrake
// Now enable the save menu if the selected preset is a user preset
if (treeView_presets.SelectedNode != null)
- if (presetHandler.checkIfUserPresetExists(treeView_presets.SelectedNode.Text))
+ if (presetHandler.CheckIfUserPresetExists(treeView_presets.SelectedNode.Text))
pmnu_saveChanges.Enabled = true;
treeView_presets.Select();
@@ -494,7 +494,7 @@ namespace Handbrake
{
if (treeView_presets.SelectedNode != null)
{
- presetHandler.remove(treeView_presets.SelectedNode.Text);
+ presetHandler.Remove(treeView_presets.SelectedNode.Text);
treeView_presets.Nodes.Remove(treeView_presets.SelectedNode);
}
}
@@ -542,7 +542,7 @@ namespace Handbrake
if (result == DialogResult.Yes)
{
if (treeView_presets.SelectedNode != null)
- presetHandler.remove(treeView_presets.SelectedNode.Text);
+ presetHandler.Remove(treeView_presets.SelectedNode.Text);
// Remember each nodes expanded status so we can reload it
List<Boolean> nodeStatus = new List<Boolean>();
@@ -570,10 +570,10 @@ namespace Handbrake
{
// Ok, so, we've selected a preset. Now we want to load it.
string presetName = treeView_presets.SelectedNode.Text;
- if (presetHandler.getPreset(presetName) != null)
+ if (presetHandler.GetPreset(presetName) != null)
{
- string query = presetHandler.getPreset(presetName).Query;
- Boolean loadPictureSettings = presetHandler.getPreset(presetName).PictureSettings;
+ string query = presetHandler.GetPreset(presetName).Query;
+ Boolean loadPictureSettings = presetHandler.GetPreset(presetName).PictureSettings;
if (query != null)
{
@@ -610,23 +610,23 @@ namespace Handbrake
if (openPreset.ShowDialog() == DialogResult.OK)
{
QueryParser parsed = imp.importMacPreset(openPreset.FileName);
- if (presetHandler.checkIfUserPresetExists(parsed.PresetName + " (Imported)"))
+ if (presetHandler.CheckIfPresetsAreOutOfDate(parsed.PresetName + " (Imported)"))
{
DialogResult result = MessageBox.Show("This preset appears to already exist. Would you like to overwrite it?", "Overwrite preset?",
MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (result == DialogResult.Yes)
{
PresetLoader.presetLoader(this, parsed, parsed.PresetName, parsed.UsesPictureSettings);
- presetHandler.updatePreset(parsed.PresetName + " (Imported)", queryGen.GenerateCLIQuery(this, 0, null),
+ presetHandler.Update(parsed.PresetName + " (Imported)", queryGen.GenerateCLIQuery(this, 0, null),
parsed.UsesPictureSettings);
}
}
else
{
PresetLoader.presetLoader(this, parsed, parsed.PresetName, parsed.UsesPictureSettings);
- presetHandler.addPreset(parsed.PresetName, queryGen.GenerateCLIQuery(this, 0, null), parsed.UsesPictureSettings);
+ presetHandler.Add(parsed.PresetName, queryGen.GenerateCLIQuery(this, 0, null), parsed.UsesPictureSettings);
- if (presetHandler.addPreset(parsed.PresetName + " (Imported)", queryGen.GenerateCLIQuery(this, 0, null), parsed.UsesPictureSettings))
+ if (presetHandler.Add(parsed.PresetName + " (Imported)", queryGen.GenerateCLIQuery(this, 0, null), parsed.UsesPictureSettings))
{
TreeNode preset_treeview = new TreeNode(parsed.PresetName + " (Imported)") { ForeColor = Color.Black };
treeView_presets.Nodes.Add(preset_treeview);
@@ -1685,13 +1685,13 @@ namespace Handbrake
/// </summary>
public void loadPresetPanel()
{
- if (presetHandler.checkIfPresetsAreOutOfDate())
+ if (presetHandler.CheckIfPresetsAreOutOfDate())
if (!Properties.Settings.Default.presetNotification)
MessageBox.Show(splash,
"HandBrake has determined your built-in presets are out of date... These presets will now be updated.",
"Preset Update", MessageBoxButtons.OK, MessageBoxIcon.Information);
- presetHandler.getPresetPanel(ref treeView_presets);
+ presetHandler.GetPresetPanel(ref treeView_presets);
treeView_presets.Update();
}
#endregion