From 5996a02806deff78ab32db080023b2115a8f15ca Mon Sep 17 00:00:00 2001 From: sr55 Date: Thu, 12 Jun 2008 17:00:20 +0000 Subject: WinGui: - Fixed #78 and #79 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1508 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/C#/Functions/QueryParser.cs | 4 +-- win/C#/HandBrakeCS.csproj | 1 + win/C#/Properties/AssemblyInfo.cs | 4 +-- win/C#/Properties/Settings.Designer.cs | 4 +-- win/C#/Properties/Settings.settings | 4 +-- win/C#/app.config | 4 +-- win/C#/frmAddPreset.cs | 49 +++++++++++++++++++++------------- win/C#/frmMain.Designer.cs | 6 ++--- win/C#/frmMain.cs | 1 - 9 files changed, 45 insertions(+), 32 deletions(-) (limited to 'win/C#') diff --git a/win/C#/Functions/QueryParser.cs b/win/C#/Functions/QueryParser.cs index a0550b06e..87c1def3e 100644 --- a/win/C#/Functions/QueryParser.cs +++ b/win/C#/Functions/QueryParser.cs @@ -850,7 +850,7 @@ namespace Handbrake.Functions Match forcedSubtitles = Regex.Match(input, @"-F"); //H264 Tab - Match x264 = Regex.Match(input, @"-x ([,a-zA-Z0-9=:-]*)"); + Match x264 = Regex.Match(input, @"-x ([.,/a-zA-Z0-9=:-]*)"); //Program Options Match verbose = Regex.Match(input, @"-v"); @@ -962,7 +962,7 @@ namespace Handbrake.Functions thisQuery.q_denoise = "None"; if (denoise.Success != false) { - switch (denoise.ToString().Replace("--denoise=", "")) + switch (denoise.ToString().Replace("--denoise=", "").Replace("\"", "")) { case "weak": thisQuery.q_denoise = "Weak"; diff --git a/win/C#/HandBrakeCS.csproj b/win/C#/HandBrakeCS.csproj index 49f2ae677..a8b3107d9 100644 --- a/win/C#/HandBrakeCS.csproj +++ b/win/C#/HandBrakeCS.csproj @@ -153,6 +153,7 @@ frmUpdater.cs + diff --git a/win/C#/Properties/AssemblyInfo.cs b/win/C#/Properties/AssemblyInfo.cs index d64a9efa0..f7ea463b2 100644 --- a/win/C#/Properties/AssemblyInfo.cs +++ b/win/C#/Properties/AssemblyInfo.cs @@ -36,6 +36,6 @@ using System.Resources; // Build Number // Revision // -[assembly: AssemblyVersion("0.9.2.0")] -[assembly: AssemblyFileVersion("0.9.2.0")] +[assembly: AssemblyVersion("0.9.3.0")] +[assembly: AssemblyFileVersion("0.9.3.0")] [assembly: NeutralResourcesLanguageAttribute("")] diff --git a/win/C#/Properties/Settings.Designer.cs b/win/C#/Properties/Settings.Designer.cs index 41899aafe..f4ab1fb8a 100644 --- a/win/C#/Properties/Settings.Designer.cs +++ b/win/C#/Properties/Settings.Designer.cs @@ -73,7 +73,7 @@ namespace Handbrake.Properties { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("0.9.3")] + [global::System.Configuration.DefaultSettingValueAttribute("SVN1477")] public string hb_version { get { return ((string)(this["hb_version"])); @@ -121,7 +121,7 @@ namespace Handbrake.Properties { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("2008043001")] + [global::System.Configuration.DefaultSettingValueAttribute("2008053100")] public int hb_build { get { return ((int)(this["hb_build"])); diff --git a/win/C#/Properties/Settings.settings b/win/C#/Properties/Settings.settings index e36176bfb..c216caee5 100644 --- a/win/C#/Properties/Settings.settings +++ b/win/C#/Properties/Settings.settings @@ -15,7 +15,7 @@ Checked - 0.9.3 + SVN1477 Checked @@ -27,7 +27,7 @@ Checked - 2008043001 + 2008053100 0 diff --git a/win/C#/app.config b/win/C#/app.config index 83490f5ac..0b4648b4b 100644 --- a/win/C#/app.config +++ b/win/C#/app.config @@ -20,7 +20,7 @@ Checked - SVN1457 + SVN1477 Checked @@ -32,7 +32,7 @@ Checked - 2008051201 + 2008053100 0 diff --git a/win/C#/frmAddPreset.cs b/win/C#/frmAddPreset.cs index 2beabc53c..f6a51fc6a 100644 --- a/win/C#/frmAddPreset.cs +++ b/win/C#/frmAddPreset.cs @@ -12,6 +12,7 @@ using System.Drawing; using System.Text; using System.Windows.Forms; using System.IO; +using System.Windows.Forms; namespace Handbrake { @@ -34,28 +35,40 @@ namespace Handbrake { Functions.Common hb_common_func = new Functions.Common(); - string userPresets = Application.StartupPath.ToString() + "\\user_presets.dat"; - try + Boolean already_exists = false; + foreach (TreeNode treenode in frmMainWindow.treeView_presets.Nodes) { - // 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); + if (treenode.ToString().Equals("TreeNode: --" + txt_preset_name.Text)) + already_exists = true; } - catch (Exception exc) + + if (already_exists == true) + MessageBox.Show("Sorry, a preset with this name already exists", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); + else { - 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); + 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(); } - frmMainWindow.loadPresetPanel(); - this.Close(); } } } diff --git a/win/C#/frmMain.Designer.cs b/win/C#/frmMain.Designer.cs index f11b56f87..2cb7f6a33 100644 --- a/win/C#/frmMain.Designer.cs +++ b/win/C#/frmMain.Designer.cs @@ -966,10 +966,10 @@ namespace Handbrake // ISO_Open // this.ISO_Open.DefaultExt = "ISO"; - this.ISO_Open.Filter = "All Supported Files|*.iso;*.mpg;*.m2t;*.vob;*.ts;*.mpeg;*.mpeg;*.avi;*.mp4;*.mkv;"; + this.ISO_Open.Filter = "All Supported Files|*.iso;*.mpg;*.m2t;*.vob;*.ts;*.mpeg;*.mpeg;*.avi;*.mp4;*.mkv;" + + ""; this.ISO_Open.RestoreDirectory = true; this.ISO_Open.SupportMultiDottedExtensions = true; - // // FileToolStripMenuItem // @@ -3093,7 +3093,6 @@ namespace Handbrake private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; private System.Windows.Forms.ToolStripMenuItem mnu_open; private System.Windows.Forms.ToolStripSeparator toolStripSeparator7; - private System.Windows.Forms.TreeView treeView_presets; internal System.Windows.Forms.CheckBox check_vfr; internal System.Windows.Forms.CheckBox check_iPodAtom; internal System.Windows.Forms.Label lbl_vfr; @@ -3219,6 +3218,7 @@ namespace Handbrake internal System.Windows.Forms.TrackBar trackBar2; internal System.Windows.Forms.Label label16; internal System.Windows.Forms.Label lbl_drc1; + internal System.Windows.Forms.TreeView treeView_presets; } } \ No newline at end of file diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 12b51041b..8db694d83 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -1488,7 +1488,6 @@ namespace Handbrake else presetInput.ReadLine(); } - presetInput.Close(); } -- cgit v1.2.3