OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / win / C# / frmMain.cs
index a5b131b..2489c8e 100644 (file)
@@ -1109,7 +1109,7 @@ namespace Handbrake
             // Make sure the destination path exists.\r
             if (!Directory.Exists(Path.GetDirectoryName(jobDestination)))\r
             {\r
-                MessageBox.Show("Destination Path does not exist.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
+                MessageBox.Show(string.Format("Destination Path does not exist.\nPath: {0}\n\nThis item was not added to the Queue.", Path.GetDirectoryName(jobDestination)), "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
                 return;\r
             }\r
 \r
@@ -1118,7 +1118,7 @@ namespace Handbrake
             {\r
                 DialogResult result =\r
                     MessageBox.Show(\r
-                        "There is already a queue item for this destination path. \n\n If you continue, the encode will be overwritten. Do you wish to continue?",\r
+                        string.Format("There is already a queue item for this destination path.\nDestination Path: {0} \n\nIf you continue, the encode will be overwritten. Do you wish to continue?", jobDestination),\r
                         "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);\r
                 if (result == DialogResult.Yes)\r
                     encodeQueue.Add(query, this.GetTitle(), jobSourcePath, jobDestination, (rtf_query.Text != string.Empty));\r
@@ -1259,29 +1259,31 @@ namespace Handbrake
         #region Main Window and Tab Control\r
 \r
         // Source\r
-        private void btn_dvd_source_Click(object sender, EventArgs e)\r
+        private void BtnFolderScanClicked(object sender, EventArgs e)\r
         {\r
+            this.btn_source.HideDropDown();\r
             if (DVD_Open.ShowDialog() == DialogResult.OK)\r
             {\r
                 this.selectedSourceType = SourceType.Folder;\r
-                SelectSource(DVD_Open.SelectedPath);\r
+                SelectSource(DVD_Open.SelectedPath, 0);\r
             }\r
             else\r
                 UpdateSourceLabel();\r
         }\r
 \r
-        private void btn_file_source_Click(object sender, EventArgs e)\r
+        private void BtnFileScanClicked(object sender, EventArgs e)\r
         {\r
+            this.btn_source.HideDropDown();\r
             if (ISO_Open.ShowDialog() == DialogResult.OK)\r
             {\r
                 this.selectedSourceType = SourceType.VideoFile;\r
-                SelectSource(ISO_Open.FileName);\r
+                SelectSource(ISO_Open.FileName, 0);\r
             }\r
             else\r
                 UpdateSourceLabel();\r
         }\r
 \r
-        private void mnu_dvd_drive_Click(object sender, EventArgs e)\r
+        private void MnuDvdDriveClick(object sender, EventArgs e)\r
         {\r
             ToolStripMenuItem item = sender as ToolStripMenuItem;\r
             if (item != null)\r
@@ -1295,12 +1297,50 @@ namespace Handbrake
 \r
                     if (this.dvdDrivePath == null) return;\r
                     this.selectedSourceType = SourceType.DvdDrive;\r
-                    SelectSource(this.dvdDrivePath);\r
+                    SelectSource(this.dvdDrivePath, 0);\r
                 }\r
             }\r
         }\r
 \r
-        private void SelectSource(string file)\r
+        private void VideoTitleSpecificScanClick(object sender, EventArgs e)\r
+        {\r
+            this.btn_source.HideDropDown();\r
+            if (ISO_Open.ShowDialog() == DialogResult.OK)\r
+            {\r
+                this.selectedSourceType = SourceType.VideoFile;\r
+\r
+                int sourceTitle = 0;\r
+                TitleSpecificScan title = new TitleSpecificScan();\r
+                if (title.ShowDialog() == DialogResult.OK)\r
+                {\r
+                    sourceTitle = title.Title;\r
+                    SelectSource(ISO_Open.FileName, sourceTitle);\r
+                }          \r
+            }\r
+            else\r
+                UpdateSourceLabel();\r
+        }\r
+\r
+        private void FolderTitleSpecificScanClick(object sender, EventArgs e)\r
+        {\r
+            this.btn_source.HideDropDown();\r
+            if (DVD_Open.ShowDialog() == DialogResult.OK)\r
+            {\r
+                this.selectedSourceType = SourceType.Folder;\r
+\r
+                int sourceTitle = 0;\r
+                TitleSpecificScan title = new TitleSpecificScan();\r
+                if (title.ShowDialog() == DialogResult.OK)\r
+                {\r
+                    sourceTitle = title.Title;\r
+                    SelectSource(DVD_Open.SelectedPath, sourceTitle);\r
+                }\r
+            }\r
+            else\r
+                UpdateSourceLabel();\r
+        }\r
+\r
+        private void SelectSource(string file, int titleSpecific)\r
         {\r
             Check_ChapterMarkers.Enabled = true;\r
             sourcePath = string.Empty;\r
@@ -1312,7 +1352,7 @@ namespace Handbrake
             }\r
 \r
             sourcePath = Path.GetFileName(file);\r
-            StartScan(file, 0);\r
+            StartScan(file, titleSpecific);\r
         }\r
 \r
         private void drp_dvdtitle_Click(object sender, EventArgs e)\r
@@ -1350,6 +1390,12 @@ namespace Handbrake
                     for (int i = 1; i <= selectedTitle.AngleCount; i++)\r
                         drop_angle.Items.Add(i.ToString());\r
 \r
+                    if (drop_angle.Items.Count == 0)\r
+                    {\r
+                        drop_angle.Visible = false;\r
+                        lbl_angle.Visible = false;\r
+                    }\r
+\r
                     if (drop_angle.Items.Count != 0)\r
                         drop_angle.SelectedIndex = 0;\r
                 }\r
@@ -2296,7 +2342,7 @@ namespace Handbrake
                             Text = drive.RootDirectory + " (" + drive.VolumeLabel + ")",\r
                             Image = Resources.disc_small\r
                         };\r
-                    menuItem.Click += new EventHandler(mnu_dvd_drive_Click);\r
+                    menuItem.Click += new EventHandler(MnuDvdDriveClick);\r
                     menuItems.Add(menuItem);\r
                 }\r
 \r