summaryrefslogtreecommitdiffstats
path: root/win/C#/frmMain.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2008-09-20 15:11:23 +0000
committersr55 <[email protected]>2008-09-20 15:11:23 +0000
commitb9601981bb42dc82e5d49377fbc6c2de989973cb (patch)
tree02bda4b9c43d029c1e2071f4cc884fe81da11390 /win/C#/frmMain.cs
parentb3b3fc83847dc15ac9d0aaed2f41e8ffd8228ef2 (diff)
WinGui:
- User presets and built in presets are now show in seperate colours. User preset's are shown in black and built in are blue. - Added cancel button to add preset. - Removed File Menu > Import. This is not required. Users can import old .hb files as text into the query editor if need be. - Adding a new user preset no longer stores Title and file input/output information. While these were never used, it's a waste of space storing them in the user presets file. - Added a comfirm dialog for removing presets. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1735 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/frmMain.cs')
-rw-r--r--win/C#/frmMain.cs57
1 files changed, 20 insertions, 37 deletions
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs
index 349ba98a2..092e9b7de 100644
--- a/win/C#/frmMain.cs
+++ b/win/C#/frmMain.cs
@@ -192,36 +192,6 @@ namespace Handbrake
// The Applications Main Menu *****************************************
#region File Menu
- private void mnu_open_Click(object sender, EventArgs e)
- {
- string filename;
- File_Open.ShowDialog();
- filename = File_Open.FileName;
-
- if (filename != "")
- {
- try
- {
- // Create StreamReader & open file
- StreamReader line = new StreamReader(filename);
-
- // Send the query from the file to the Query Parser class then load the preset
- Functions.QueryParser presetQuery = Functions.QueryParser.Parse(line.ReadLine());
- hb_common_func.presetLoader(this, presetQuery, filename);
-
- // Close the stream
- line.Close();
-
- Form preset = new frmAddPreset(this, presetHandler);
- preset.ShowDialog();
-
- }
- catch (Exception exc)
- {
- MessageBox.Show("Unable to load profile. \n\n" + exc.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
- }
- }
- }
private void mnu_exit_Click(object sender, EventArgs e)
{
Application.Exit();
@@ -1362,10 +1332,14 @@ namespace Handbrake
}
private void btn_removePreset_Click(object sender, EventArgs e)
{
- if (treeView_presets.SelectedNode != null)
- presetHandler.remove(treeView_presets.SelectedNode.Text);
- // Now reload the preset panel
- loadPresetPanel();
+ DialogResult result = MessageBox.Show("Are you sure you wish to delete the selected preset?", "Preset", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
+ if (result == DialogResult.Yes)
+ {
+ if (treeView_presets.SelectedNode != null)
+ presetHandler.remove(treeView_presets.SelectedNode.Text);
+ // Now reload the preset panel
+ loadPresetPanel();
+ }
}
private void btn_setDefault_Click(object sender, EventArgs e)
{
@@ -1770,13 +1744,22 @@ namespace Handbrake
treeView_presets.Nodes.Clear();
List<string> presetNameList = new List<string>();
- presetNameList = presetHandler.getPresetNames();
+ TreeNode preset_treeview = new TreeNode();
+
+ presetNameList = presetHandler.getBuildInPresetNames();
+ foreach (string preset in presetNameList)
+ {
+ preset_treeview = new TreeNode(preset);
+
+ // Now Fill Out List View with Items
+ treeView_presets.Nodes.Add(preset_treeview);
+ }
- // Adds a new preset name to the preset list.
- TreeNode preset_treeview = new TreeNode();
+ presetNameList = presetHandler.getUserPresetNames();
foreach (string preset in presetNameList)
{
preset_treeview = new TreeNode(preset);
+ preset_treeview.ForeColor = Color.Black;
// Now Fill Out List View with Items
treeView_presets.Nodes.Add(preset_treeview);