OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 18 Mar 2008 16:35:28 +0000 (16:35 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 18 Mar 2008 16:35:28 +0000 (16:35 +0000)
- Few bug fixes in the preset system
- File > open is now Import preset. Loads in old presets into the preset bar.

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

win/C#/Functions/Common.cs
win/C#/frmMain.Designer.cs
win/C#/frmMain.cs

index 8d70523..7100eb5 100644 (file)
@@ -143,7 +143,7 @@ namespace Handbrake.Functions
             if (presetQuery.DVDChapterFinish != 0)\r
                 mainWindow.drop_chapterFinish.Text = presetQuery.DVDChapterFinish.ToString();\r
 \r
-            if (presetQuery.Format != "")\r
+            if (presetQuery.Format != null)\r
             {\r
                 string destination = mainWindow.text_destination.Text;\r
                 destination = destination.Replace(".mp4", "." + presetQuery.Format);\r
@@ -345,8 +345,10 @@ namespace Handbrake.Functions
             int totalChapters = mainWindow.drop_chapterFinish.Items.Count - 1;\r
             string dvdChapter = "";\r
 \r
-            if ((source != "") || (source != "Click 'Browse' to continue"))\r
+            if ((source != "") && (source.Trim() != "Click 'Browse' to continue"))\r
                 source = " -i " + '"' + source + '"';\r
+            else\r
+                source = "";\r
 \r
             if (dvdTitle == "Automatic")\r
                 dvdTitle = "";\r
@@ -738,7 +740,7 @@ namespace Handbrake.Functions
             if (mainWindow.Check_ChapterMarkers.Checked)\r
             {\r
 \r
-                if (source_name.Trim().Replace("-i ", "") != "Click \'Browse\' to continue")\r
+                if ((source_name.Trim().Replace("-i ", "") != "Click 'Browse' to continue") && (source_name.Trim().Replace("-i ", "") != ""))\r
                 {\r
                     if (source_title != "Automatic")\r
                     {\r
index 331271f..f722d18 100644 (file)
@@ -760,8 +760,8 @@ namespace Handbrake
             this.mnu_open.ImageTransparentColor = System.Drawing.Color.Magenta;\r
             this.mnu_open.Name = "mnu_open";\r
             this.mnu_open.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));\r
-            this.mnu_open.Size = new System.Drawing.Size(201, 22);\r
-            this.mnu_open.Text = "&Open Preset";\r
+            this.mnu_open.Size = new System.Drawing.Size(210, 22);\r
+            this.mnu_open.Text = "&Import Preset";\r
             this.mnu_open.Click += new System.EventHandler(this.mnu_open_Click);\r
             // \r
             // mnu_save\r
@@ -770,19 +770,20 @@ namespace Handbrake
             this.mnu_save.ImageTransparentColor = System.Drawing.Color.Magenta;\r
             this.mnu_save.Name = "mnu_save";\r
             this.mnu_save.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));\r
-            this.mnu_save.Size = new System.Drawing.Size(201, 22);\r
+            this.mnu_save.Size = new System.Drawing.Size(210, 22);\r
             this.mnu_save.Text = "&Save Preset";\r
+            this.mnu_save.Visible = false;\r
             this.mnu_save.Click += new System.EventHandler(this.mnu_save_Click);\r
             // \r
             // toolStripSeparator2\r
             // \r
             this.toolStripSeparator2.Name = "toolStripSeparator2";\r
-            this.toolStripSeparator2.Size = new System.Drawing.Size(198, 6);\r
+            this.toolStripSeparator2.Size = new System.Drawing.Size(207, 6);\r
             // \r
             // mnu_exit\r
             // \r
             this.mnu_exit.Name = "mnu_exit";\r
-            this.mnu_exit.Size = new System.Drawing.Size(201, 22);\r
+            this.mnu_exit.Size = new System.Drawing.Size(210, 22);\r
             this.mnu_exit.Text = "E&xit";\r
             this.mnu_exit.Click += new System.EventHandler(this.mnu_exit_Click);\r
             // \r
index b831372..a9ddbbd 100644 (file)
@@ -195,6 +195,10 @@ namespace Handbrake
 \r
                     // Close the stream\r
                     line.Close();\r
+\r
+                    Form preset = new frmAddPreset(this);\r
+                    preset.ShowDialog();\r
+\r
                 }\r
                 catch (Exception exc)\r
                 {\r