diff options
author | sr55 <[email protected]> | 2008-03-14 19:47:17 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2008-03-14 19:47:17 +0000 |
commit | 7082e5068aeae43e72999249bd63eead0b93ebd7 (patch) | |
tree | 78b1b553b242619999f3548d2c7258da99812ee1 /win/C#/frmAddPreset.cs | |
parent | 990241acf2640730ef43173afe70b11593681b7c (diff) |
WinGui:
- Users can now have their own presets appear in the presets bar. They can both add and remove their own presets.
- Anamorphic option is now a dropdown menu like the macgui.
- Video tab re-arrange to be consistant with the macgui.
- Video Framerate dropdown: Changed Automatic to Same as soure (same as the macgui)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1338 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/frmAddPreset.cs')
-rw-r--r-- | win/C#/frmAddPreset.cs | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/win/C#/frmAddPreset.cs b/win/C#/frmAddPreset.cs new file mode 100644 index 000000000..cf9b5135b --- /dev/null +++ b/win/C#/frmAddPreset.cs @@ -0,0 +1,59 @@ +using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+using System.IO;
+
+namespace Handbrake
+{
+ public partial class frmAddPreset : Form
+ {
+ private frmMain frmMainWindow;
+ public frmAddPreset(frmMain fmw)
+ {
+ InitializeComponent();
+ frmMainWindow = fmw;
+ }
+
+ private void btn_add_Click(object sender, EventArgs e)
+ {
+ if (txt_preset_name.Text.Trim() == "")
+ MessageBox.Show("You have not entered a name for the preset.","Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ else if (txt_preset_name.Text.Trim().Contains("--"))
+ MessageBox.Show("The preset name can not contain two dashes '--'","Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ else
+ {
+ Functions.Common hb_common_func = new Functions.Common();
+
+ string userPresets = Application.StartupPath.ToString() + "\\user_presets.dat";
+ try
+ {
+ // Create a StreamWriter and open the file
+ StreamWriter line = File.AppendText(userPresets);
+
+ // Generate and write the preset string to the file
+ String query = hb_common_func.GenerateTheQuery(frmMainWindow);
+ String preset = "+ " + txt_preset_name.Text + ": " + query;
+ line.WriteLine(preset);
+
+ // close the stream
+ line.Close();
+ line.Dispose();
+ MessageBox.Show("Your profile has been sucessfully added.", "Status", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
+ }
+ catch (Exception exc)
+ {
+ MessageBox.Show("Unable to write to the file. Please make sure the location has the correct permissions for file writing.\n" + exc.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
+ }
+ frmMainWindow.loadPresetPanel();
+ this.Close();
+ }
+ }
+ }
+}
+
+
+
|