summaryrefslogtreecommitdiffstats
path: root/win/C#/frmMain.cs
diff options
context:
space:
mode:
Diffstat (limited to 'win/C#/frmMain.cs')
-rw-r--r--win/C#/frmMain.cs62
1 files changed, 35 insertions, 27 deletions
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs
index c0008185d..224c077c5 100644
--- a/win/C#/frmMain.cs
+++ b/win/C#/frmMain.cs
@@ -371,33 +371,7 @@ namespace Handbrake
}
private void mnu_importMacPreset_Click(object sender, EventArgs e)
{
- Import imp = new Import();
- if (openPreset.ShowDialog() == DialogResult.OK)
- {
- QueryParser parsed = imp.importMacPreset(openPreset.FileName);
- if (presetHandler.checkIfUserPresetExists(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),
- parsed.UsesPictureSettings);
- }
- }
- else
- {
- PresetLoader.presetLoader(this, parsed, parsed.PresetName, parsed.UsesPictureSettings);
- presetHandler.addPreset(parsed.PresetName, queryGen.generateCLIQuery(this, 0, null), parsed.UsesPictureSettings);
-
- if (presetHandler.addPreset(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);
- }
- }
- }
+ importPreset();
}
private void btn_new_preset_Click(object sender, EventArgs e)
{
@@ -473,6 +447,10 @@ namespace Handbrake
{
treeView_presets.CollapseAll();
}
+ private void pmnu_import_Click(object sender, EventArgs e)
+ {
+ importPreset();
+ }
private void pmnu_saveChanges_Click(object sender, EventArgs e)
{
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);
@@ -626,6 +604,36 @@ namespace Handbrake
}
}
}
+ private void importPreset()
+ {
+ Import imp = new Import();
+ if (openPreset.ShowDialog() == DialogResult.OK)
+ {
+ QueryParser parsed = imp.importMacPreset(openPreset.FileName);
+ if (presetHandler.checkIfUserPresetExists(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),
+ parsed.UsesPictureSettings);
+ }
+ }
+ else
+ {
+ PresetLoader.presetLoader(this, parsed, parsed.PresetName, parsed.UsesPictureSettings);
+ presetHandler.addPreset(parsed.PresetName, queryGen.generateCLIQuery(this, 0, null), parsed.UsesPictureSettings);
+
+ if (presetHandler.addPreset(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);
+ }
+ }
+ }
+ }
#endregion
#region ToolStrip