OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Thu, 12 Jun 2008 17:00:20 +0000 (17:00 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Thu, 12 Jun 2008 17:00:20 +0000 (17:00 +0000)
- Fixed #78 and #79

git-svn-id: svn://localhost/HandBrake/trunk@1508 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/C#/Functions/QueryParser.cs
win/C#/HandBrakeCS.csproj
win/C#/Properties/AssemblyInfo.cs
win/C#/Properties/Settings.Designer.cs
win/C#/Properties/Settings.settings
win/C#/app.config
win/C#/frmAddPreset.cs
win/C#/frmMain.Designer.cs
win/C#/frmMain.cs

index a0550b0..87c1def 100644 (file)
@@ -850,7 +850,7 @@ namespace Handbrake.Functions
             Match forcedSubtitles = Regex.Match(input, @"-F");\r
 \r
             //H264 Tab\r
-            Match x264 = Regex.Match(input, @"-x ([,a-zA-Z0-9=:-]*)");\r
+            Match x264 = Regex.Match(input, @"-x ([.,/a-zA-Z0-9=:-]*)");\r
 \r
             //Program Options\r
             Match verbose = Regex.Match(input, @"-v");\r
@@ -962,7 +962,7 @@ namespace Handbrake.Functions
                 thisQuery.q_denoise = "None";\r
                 if (denoise.Success != false)\r
                 {\r
-                    switch (denoise.ToString().Replace("--denoise=", ""))\r
+                    switch (denoise.ToString().Replace("--denoise=", "").Replace("\"", ""))\r
                     {\r
                         case "weak":\r
                             thisQuery.q_denoise = "Weak";\r
index 49f2ae6..a8b3107 100644 (file)
       <DependentUpon>frmUpdater.cs</DependentUpon>\r
     </Compile>\r
     <Compile Include="Functions\Common.cs" />\r
+    <Compile Include="Functions\Presets.cs" />\r
     <Compile Include="Functions\RssReader.cs" />\r
     <Compile Include="Functions\CLI.cs" />\r
     <Compile Include="Functions\QueryParser.cs" />\r
index d64a9ef..f7ea463 100644 (file)
@@ -36,6 +36,6 @@ using System.Resources;
 //      Build Number\r
 //      Revision\r
 //\r
-[assembly: AssemblyVersion("0.9.2.0")]\r
-[assembly: AssemblyFileVersion("0.9.2.0")]\r
+[assembly: AssemblyVersion("0.9.3.0")]\r
+[assembly: AssemblyFileVersion("0.9.3.0")]\r
 [assembly: NeutralResourcesLanguageAttribute("")]\r
index 41899aa..f4ab1fb 100644 (file)
@@ -73,7 +73,7 @@ namespace Handbrake.Properties {
         \r
         [global::System.Configuration.UserScopedSettingAttribute()]\r
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\r
-        [global::System.Configuration.DefaultSettingValueAttribute("0.9.3")]\r
+        [global::System.Configuration.DefaultSettingValueAttribute("SVN1477")]\r
         public string hb_version {\r
             get {\r
                 return ((string)(this["hb_version"]));\r
@@ -121,7 +121,7 @@ namespace Handbrake.Properties {
         \r
         [global::System.Configuration.UserScopedSettingAttribute()]\r
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\r
-        [global::System.Configuration.DefaultSettingValueAttribute("2008043001")]\r
+        [global::System.Configuration.DefaultSettingValueAttribute("2008053100")]\r
         public int hb_build {\r
             get {\r
                 return ((int)(this["hb_build"]));\r
index e36176b..c216cae 100644 (file)
@@ -15,7 +15,7 @@
       <Value Profile="(Default)">Checked</Value>\r
     </Setting>\r
     <Setting Name="hb_version" Type="System.String" Scope="User">\r
-      <Value Profile="(Default)">0.9.3</Value>\r
+      <Value Profile="(Default)">SVN1477</Value>\r
     </Setting>\r
     <Setting Name="tooltipEnable" Type="System.String" Scope="User">\r
       <Value Profile="(Default)">Checked</Value>\r
@@ -27,7 +27,7 @@
       <Value Profile="(Default)">Checked</Value>\r
     </Setting>\r
     <Setting Name="hb_build" Type="System.Int32" Scope="User">\r
-      <Value Profile="(Default)">2008043001</Value>\r
+      <Value Profile="(Default)">2008053100</Value>\r
     </Setting>\r
     <Setting Name="skipversion" Type="System.Int32" Scope="User">\r
       <Value Profile="(Default)">0</Value>\r
index 83490f5..0b4648b 100644 (file)
@@ -20,7 +20,7 @@
                 <value>Checked</value>\r
             </setting>\r
             <setting name="hb_version" serializeAs="String">\r
-                <value>SVN1457</value>\r
+                <value>SVN1477</value>\r
             </setting>\r
             <setting name="tooltipEnable" serializeAs="String">\r
                 <value>Checked</value>\r
@@ -32,7 +32,7 @@
                 <value>Checked</value>\r
             </setting>\r
             <setting name="hb_build" serializeAs="String">\r
-                <value>2008051201</value>\r
+                <value>2008053100</value>\r
             </setting>\r
             <setting name="skipversion" serializeAs="String">\r
                 <value>0</value>\r
index 2beabc5..f6a51fc 100644 (file)
@@ -12,6 +12,7 @@ using System.Drawing;
 using System.Text;\r
 using System.Windows.Forms;\r
 using System.IO;\r
+using System.Windows.Forms;\r
 \r
 namespace Handbrake\r
 {\r
@@ -34,28 +35,40 @@ namespace Handbrake
             {\r
                 Functions.Common hb_common_func = new Functions.Common();\r
 \r
-                string userPresets = Application.StartupPath.ToString() + "\\user_presets.dat";\r
-                try\r
+                Boolean already_exists = false;\r
+                foreach (TreeNode treenode in frmMainWindow.treeView_presets.Nodes)\r
                 {\r
-                    // Create a StreamWriter and open the file\r
-                    StreamWriter line = File.AppendText(userPresets);\r
-\r
-                    // Generate and write the preset string to the file\r
-                    String query = hb_common_func.GenerateTheQuery(frmMainWindow);\r
-                    String preset = "+ " + txt_preset_name.Text + ":  " + query;\r
-                    line.WriteLine(preset);\r
-\r
-                    // close the stream\r
-                    line.Close();\r
-                    line.Dispose();\r
-                    MessageBox.Show("Your profile has been sucessfully added.", "Status", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);\r
+                    if (treenode.ToString().Equals("TreeNode: --" + txt_preset_name.Text))\r
+                        already_exists = true;  \r
                 }\r
-                catch (Exception exc)\r
+\r
+                if (already_exists == true)\r
+                    MessageBox.Show("Sorry, a preset with this name already exists", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
+                else\r
                 {\r
-                    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);\r
+                    string userPresets = Application.StartupPath.ToString() + "\\user_presets.dat";\r
+                    try\r
+                    {\r
+                        // Create a StreamWriter and open the file\r
+                        StreamWriter line = File.AppendText(userPresets);\r
+\r
+                        // Generate and write the preset string to the file\r
+                        String query = hb_common_func.GenerateTheQuery(frmMainWindow);\r
+                        String preset = "+ " + txt_preset_name.Text + ":  " + query;\r
+                        line.WriteLine(preset);\r
+\r
+                        // close the stream\r
+                        line.Close();\r
+                        line.Dispose();\r
+                        MessageBox.Show("Your profile has been sucessfully added.", "Status", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);\r
+                    }\r
+                    catch (Exception exc)\r
+                    {\r
+                        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);\r
+                    }\r
+                    frmMainWindow.loadPresetPanel();\r
+                    this.Close();\r
                 }\r
-                frmMainWindow.loadPresetPanel();\r
-                this.Close();\r
             }\r
         }\r
     }\r
index f11b56f..2cb7f6a 100644 (file)
@@ -966,10 +966,10 @@ namespace Handbrake
             // ISO_Open\r
             // \r
             this.ISO_Open.DefaultExt = "ISO";\r
-            this.ISO_Open.Filter = "All Supported Files|*.iso;*.mpg;*.m2t;*.vob;*.ts;*.mpeg;*.mpeg;*.avi;*.mp4;*.mkv;";\r
+            this.ISO_Open.Filter = "All Supported Files|*.iso;*.mpg;*.m2t;*.vob;*.ts;*.mpeg;*.mpeg;*.avi;*.mp4;*.mkv;" +\r
+                "";\r
             this.ISO_Open.RestoreDirectory = true;\r
             this.ISO_Open.SupportMultiDottedExtensions = true;\r
-  \r
             // \r
             // FileToolStripMenuItem\r
             // \r
@@ -3093,7 +3093,6 @@ namespace Handbrake
         private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;\r
         private System.Windows.Forms.ToolStripMenuItem mnu_open;\r
         private System.Windows.Forms.ToolStripSeparator toolStripSeparator7;\r
-        private System.Windows.Forms.TreeView treeView_presets;\r
         internal System.Windows.Forms.CheckBox check_vfr;\r
         internal System.Windows.Forms.CheckBox check_iPodAtom;\r
         internal System.Windows.Forms.Label lbl_vfr;\r
@@ -3219,6 +3218,7 @@ namespace Handbrake
         internal System.Windows.Forms.TrackBar trackBar2;\r
         internal System.Windows.Forms.Label label16;\r
         internal System.Windows.Forms.Label lbl_drc1;\r
+        internal System.Windows.Forms.TreeView treeView_presets;\r
 \r
     }\r
 }
\ No newline at end of file
index 12b5104..8db694d 100644 (file)
@@ -1488,7 +1488,6 @@ namespace Handbrake
                         else\r
                             presetInput.ReadLine();\r
                     }\r
-\r
                     presetInput.Close();\r
                 }\r
 \r