OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Thu, 19 Feb 2009 20:48:16 +0000 (20:48 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Thu, 19 Feb 2009 20:48:16 +0000 (20:48 +0000)
- Fixed a bug in the preset update function.

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

win/C#/Presets/PresetsHandler.cs

index 7bf3f90..aa52d06 100644 (file)
@@ -89,6 +89,7 @@ namespace Handbrake.Presets
                     item.Query = query;\r
                     item.PictureSettings = pictureSettings;\r
                     MessageBox.Show("Changes to \"" + presetName + "\" Saved", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);\r
+                    updateUserPresetsFile();\r
                 }\r
             }\r
         }\r
@@ -225,10 +226,8 @@ namespace Handbrake.Presets
             presets.Clear();\r
             user_presets.Clear();\r
 \r
-            string filePath = string.Empty;\r
-\r
             // Load in the users presets from user_presets.xml\r
-            filePath = Application.StartupPath.ToString() + "\\presets.xml";\r
+            string filePath = Application.StartupPath + "\\presets.xml";\r
             if (File.Exists(filePath))\r
             {\r
                 using (FileStream strm = new FileStream(filePath, FileMode.Open, FileAccess.Read))\r
@@ -244,7 +243,7 @@ namespace Handbrake.Presets
             }\r
 \r
             // Load in the users presets from user_presets.xml\r
-            filePath = Application.StartupPath.ToString() + "\\user_presets.xml";\r
+            filePath = Application.StartupPath + "\\user_presets.xml";\r
             if (File.Exists(filePath))\r
             {\r
                 using (FileStream strm = new FileStream(filePath, FileMode.Open, FileAccess.Read))\r
@@ -266,7 +265,7 @@ namespace Handbrake.Presets
         /// </summary>\r
         private void updatePresetsFile()\r
         {\r
-            string userPresets = Application.StartupPath.ToString() + "\\presets.xml";\r
+            string userPresets = Application.StartupPath + "\\presets.xml";\r
             try\r
             {\r
                 using (FileStream strm = new FileStream(userPresets, FileMode.Create, FileAccess.Write))\r
@@ -278,7 +277,7 @@ namespace Handbrake.Presets
             }\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 Error Information: \n\n" + exc.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);\r
+                MessageBox.Show("Unable to write to the file. Please make sure the location has the correct permissions for file writing.\n Error Information: \n\n" + exc, "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);\r
             }\r
         }\r
 \r
@@ -288,7 +287,7 @@ namespace Handbrake.Presets
         /// </summary>\r
         private void updateUserPresetsFile()\r
         {\r
-            string userPresets = Application.StartupPath.ToString() + "\\user_presets.xml";\r
+            string userPresets = Application.StartupPath + "\\user_presets.xml";\r
             try\r
             {\r
                 using (FileStream strm = new FileStream(userPresets, FileMode.Create, FileAccess.Write))\r
@@ -300,7 +299,7 @@ namespace Handbrake.Presets
             }\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 Error Information: \n\n" + exc.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);\r
+                MessageBox.Show("Unable to write to the file. Please make sure the location has the correct permissions for file writing.\n Error Information: \n\n" + exc, "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);\r
             }\r
         }\r
 \r