OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 17 Oct 2010 19:36:02 +0000 (19:36 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 17 Oct 2010 19:36:02 +0000 (19:36 +0000)
- Fix a bug in the AutoName where is used the folder name instead of source name when multiple files are scanned.

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

win/C#/Functions/Main.cs
win/C#/frmMain.cs
win/C#/frmOptions.Designer.cs

index 3856713..c26d595 100644 (file)
@@ -10,10 +10,8 @@ namespace Handbrake.Functions
     using System.Diagnostics;\r
     using System.IO;\r
     using System.Linq;\r
-    using System.Net;\r
     using System.Text;\r
     using System.Text.RegularExpressions;\r
-    using System.Threading;\r
     using System.Windows.Forms;\r
     using System.Xml.Serialization;\r
 \r
@@ -23,7 +21,6 @@ namespace Handbrake.Functions
     using HandBrake.ApplicationServices.Parsing;\r
     using HandBrake.ApplicationServices.Services.Interfaces;\r
     using Model;\r
-    using HandBrake.ApplicationServices.Services;\r
 \r
     /// <summary>\r
     /// Useful functions which various screens can use.\r
index b54fda0..165da56 100644 (file)
@@ -77,6 +77,11 @@ namespace Handbrake
                     return this.dvdDriveLabel;\r
                 }\r
 \r
+                if (selectedTitle != null && !string.IsNullOrEmpty(selectedTitle.SourceName))\r
+                {\r
+                    return Path.GetFileName(selectedTitle.SourceName);\r
+                }\r
+\r
                 if (Path.GetFileNameWithoutExtension(this.sourcePath) != "VIDEO_TS")\r
                     return Path.GetFileNameWithoutExtension(this.sourcePath);\r
 \r
@@ -1435,7 +1440,7 @@ namespace Handbrake
             // Update the source label if we have multiple streams\r
             if (selectedTitle != null)\r
                 if (!string.IsNullOrEmpty(selectedTitle.SourceName))\r
-                    labelSource.Text = labelSource.Text = Path.GetFileName(selectedTitle.SourceName);\r
+                    labelSource.Text = Path.GetFileName(selectedTitle.SourceName);\r
 \r
             // Run the AutoName & ChapterNaming functions\r
             if (Properties.Settings.Default.autoNaming)\r
@@ -2196,11 +2201,6 @@ namespace Handbrake
         private void UpdateSourceLabel()\r
         {\r
             labelSource.Text = string.IsNullOrEmpty(sourcePath) ? "Select \"Source\" to continue." : this.SourceName;\r
-\r
-            if (selectedTitle != null)\r
-                if (!string.IsNullOrEmpty(selectedTitle.SourceName))\r
-                    // If it's one of multiple source files, make sure we don't use the folder name\r
-                    labelSource.Text = Path.GetFileName(selectedTitle.SourceName);\r
         }\r
 \r
         /// <summary>\r
index f4f2e0b..51a7cc9 100644 (file)
@@ -667,7 +667,7 @@ namespace Handbrake
             this.check_preventSleep.AutoSize = true;\r
             this.check_preventSleep.Location = new System.Drawing.Point(73, 45);\r
             this.check_preventSleep.Name = "check_preventSleep";\r
-            this.check_preventSleep.Size = new System.Drawing.Size(266, 17);\r
+            this.check_preventSleep.Size = new System.Drawing.Size(260, 17);\r
             this.check_preventSleep.TabIndex = 91;\r
             this.check_preventSleep.Text = "Prevent the system from sleeping when encoding.";\r
             this.ToolTip.SetToolTip(this.check_preventSleep, "Prevent system from sleeping during encoding.");\r
@@ -680,7 +680,7 @@ namespace Handbrake
             this.check_clearOldLogs.AutoSize = true;\r
             this.check_clearOldLogs.Location = new System.Drawing.Point(73, 234);\r
             this.check_clearOldLogs.Name = "check_clearOldLogs";\r
-            this.check_clearOldLogs.Size = new System.Drawing.Size(166, 17);\r
+            this.check_clearOldLogs.Size = new System.Drawing.Size(162, 17);\r
             this.check_clearOldLogs.TabIndex = 90;\r
             this.check_clearOldLogs.Text = "Clear logs older than 30 days";\r
             this.ToolTip.SetToolTip(this.check_clearOldLogs, "Clear logs which are older than 30 days.\r\nThis only applies to HandBrakes Applica" +\r
@@ -775,7 +775,7 @@ namespace Handbrake
             this.check_logsInSpecifiedLocation.AutoSize = true;\r
             this.check_logsInSpecifiedLocation.Location = new System.Drawing.Point(73, 139);\r
             this.check_logsInSpecifiedLocation.Name = "check_logsInSpecifiedLocation";\r
-            this.check_logsInSpecifiedLocation.Size = new System.Drawing.Size(306, 17);\r
+            this.check_logsInSpecifiedLocation.Size = new System.Drawing.Size(305, 17);\r
             this.check_logsInSpecifiedLocation.TabIndex = 87;\r
             this.check_logsInSpecifiedLocation.Text = "Put a copy of individual encode logs in a specified location:";\r
             this.ToolTip.SetToolTip(this.check_logsInSpecifiedLocation, "Place a copy of the encode log in the same folder as the encoded movie.");\r