]> granicus.if.org Git - handbrake/commitdiff
WinGui:
authorsr55 <sr55.hb@outlook.com>
Sun, 24 Feb 2008 18:40:27 +0000 (18:40 +0000)
committersr55 <sr55.hb@outlook.com>
Sun, 24 Feb 2008 18:40:27 +0000 (18:40 +0000)
- Fixed bug where the chapter markers csv filename renamed the same for every item on the queue. This meant the same chapter names got added to each encode when in fact, each encode should have had a separate file.
- Disabled development expiry code.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1313 b64f7644-9d1e-0410-96f1-a4d463321fa5

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

index 4c3e47dcb26197273250644e2ce555972df8ffbc..ebeb0c9c6063c36d6d42d6faff82ee2738a6c075 100644 (file)
@@ -714,20 +714,46 @@ namespace Handbrake.Functions
 \r
             string ChapterMarkers = "";\r
 \r
+            // Attach Source name and dvd title to the start of the chapters.csv filename.\r
+            // This is for the queue. It allows different chapter name files for each title.\r
+            string source_name = mainWindow.text_source.Text;\r
+            string[] sourceName = source.Split('\\');\r
+            source_name = sourceName[sourceName.Length - 1].Replace(".iso", "").Replace(".mpg", "").Replace(".ts", "").Replace(".ps", "");\r
+            source_name = source_name.Replace("\"", "");\r
+\r
+            string source_title = mainWindow.drp_dvdtitle.Text;\r
+            string[] titlesplit = source_title.Split(' ');\r
+            source_title = titlesplit[0];\r
+\r
             if (mainWindow.Check_ChapterMarkers.Checked)\r
             {\r
-                Boolean saveCSV = chapterCSVSave(mainWindow);\r
-                if (saveCSV == false)\r
+\r
+                if (source_name != "Click 'Browse' to continue")\r
                 {\r
-                    MessageBox.Show("Unable to save Chapter Makrers file! \n Chapter marker names will NOT be saved in your encode \n\n", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
-                    ChapterMarkers = " -m ";\r
+                    if (source_title != "Automatic")\r
+                    {\r
+                        string filename = source_name + "-" + source_title + "-chapters.csv";\r
+                        string path = Path.Combine(Path.GetTempPath(), filename);\r
+\r
+                        Boolean saveCSV = chapterCSVSave(mainWindow, path);\r
+                        if (saveCSV == false)\r
+                            ChapterMarkers = " -m ";\r
+                        else\r
+                        {\r
+                            ChapterMarkers = " --markers=" + "\"" + path + "\"";\r
+                        }\r
+                    }\r
+                    else\r
+                    {\r
+                        string path = Path.Combine(Path.GetTempPath(), "chapters.csv");\r
+                        ChapterMarkers = " --markers=" + "\"" + path + "\"";\r
+                    }\r
                 }\r
                 else\r
                 {\r
                     string path = Path.Combine(Path.GetTempPath(), "chapters.csv");\r
-\r
                     ChapterMarkers = " --markers=" + "\"" + path + "\"";\r
-                }\r
+                } \r
             }\r
 \r
             string chapter_markers = ChapterMarkers;\r
@@ -807,12 +833,10 @@ namespace Handbrake.Functions
          * This function saves the data in the chapters tab, dataGridView into a CSV file called chapters.csv in this applications\r
          * running directory.\r
          */\r
-        private Boolean chapterCSVSave(frmMain mainWindow)\r
+        private Boolean chapterCSVSave(frmMain mainWindow, string file_path_name)\r
         {\r
             try\r
-            {\r
-                string path = Path.Combine(Path.GetTempPath(), "chapters.csv");\r
-\r
+            {      \r
                 StringBuilder csv = new StringBuilder();\r
 \r
                 foreach (DataGridViewRow row in mainWindow.data_chpt.Rows)\r
@@ -822,7 +846,7 @@ namespace Handbrake.Functions
                     csv.Append(row.Cells[1].Value.ToString());\r
                     csv.Append(Environment.NewLine);\r
                 }\r
-                StreamWriter file = new StreamWriter(path);\r
+                StreamWriter file = new StreamWriter(file_path_name);\r
                 file.Write(csv.ToString());\r
                 file.Close();\r
                 file.Dispose();\r
@@ -831,7 +855,7 @@ namespace Handbrake.Functions
             }\r
             catch (Exception exc)\r
             {\r
-                MessageBox.Show(exc.ToString(), "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
+                MessageBox.Show("Unable to save Chapter Makrers file! \nChapter marker names will NOT be saved in your encode \n\n" + exc.ToString(), "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
                 return false;\r
             }\r
         }\r
index 5f3b9464a465015b089dcb1db563d0725abf1bb7..fb5507cc2801830c5521f2d85ea1511fa6b96914 100644 (file)
@@ -32,7 +32,7 @@ namespace Handbrake
         {\r
             // Development Code Expiry.\r
             // Remember to comment out on public release!!!\r
-            if (DateTime.Now > DateTime.Parse("2008/02/25", new CultureInfo("en-US"))) { MessageBox.Show("Sorry, This development build of Handbrake has expired."); return; } \r
+            //if (DateTime.Now > DateTime.Parse("2008/02/25", new CultureInfo("en-US"))) { MessageBox.Show("Sorry, This development build of Handbrake has expired."); return; } \r
 \r
             // Check the system meets the system requirements.\r
             Boolean launch = true;\r
index 5c014d5182c7d00e9881ecd386d4df1fa234a563..a08aab3d5dd2ebeea5b21d20767f5463a0cec944 100644 (file)
@@ -37,7 +37,7 @@ namespace Handbrake
             this.components = new System.ComponentModel.Container();\r
             System.Windows.Forms.Label Label38;\r
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));\r
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();\r
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();\r
             this.DVD_Save = new System.Windows.Forms.SaveFileDialog();\r
             this.File_Save = new System.Windows.Forms.SaveFileDialog();\r
             this.ToolTip = new System.Windows.Forms.ToolTip(this.components);\r
@@ -202,6 +202,7 @@ namespace Handbrake
             this.btn_ActivityWindow = new System.Windows.Forms.ToolStripButton();\r
             this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();\r
             this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);\r
+            this.lbl_warn_chapt = new System.Windows.Forms.Label();\r
             Label38 = new System.Windows.Forms.Label();\r
             ((System.ComponentModel.ISupportInitialize)(this.slider_videoQuality)).BeginInit();\r
             ((System.ComponentModel.ISupportInitialize)(this.slider_drc)).BeginInit();\r
@@ -323,6 +324,7 @@ namespace Handbrake
             this.text_destination.Size = new System.Drawing.Size(429, 21);\r
             this.text_destination.TabIndex = 1;\r
             this.ToolTip.SetToolTip(this.text_destination, "Location where the encoded file will be saved.");\r
+            this.text_destination.TextChanged += new System.EventHandler(this.text_destination_TextChanged);\r
             // \r
             // btn_Browse\r
             // \r
@@ -1664,8 +1666,7 @@ namespace Handbrake
             "None",\r
             "Fast",\r
             "Slow",\r
-            "Slower",\r
-            "Slowest"});\r
+            "Slower"});\r
             this.drp_deInterlace_option.Location = new System.Drawing.Point(413, 190);\r
             this.drp_deInterlace_option.Name = "drp_deInterlace_option";\r
             this.drp_deInterlace_option.Size = new System.Drawing.Size(161, 21);\r
@@ -1819,6 +1820,7 @@ namespace Handbrake
             // tab_chapters\r
             // \r
             this.tab_chapters.BackColor = System.Drawing.SystemColors.ControlLight;\r
+            this.tab_chapters.Controls.Add(this.lbl_warn_chapt);\r
             this.tab_chapters.Controls.Add(this.label31);\r
             this.tab_chapters.Controls.Add(this.data_chpt);\r
             this.tab_chapters.Controls.Add(this.Check_ChapterMarkers);\r
@@ -1848,16 +1850,16 @@ namespace Handbrake
             this.data_chpt.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {\r
             this.number,\r
             this.name});\r
-            this.data_chpt.Location = new System.Drawing.Point(16, 55);\r
+            this.data_chpt.Location = new System.Drawing.Point(16, 72);\r
             this.data_chpt.Name = "data_chpt";\r
-            this.data_chpt.Size = new System.Drawing.Size(607, 199);\r
+            this.data_chpt.Size = new System.Drawing.Size(607, 182);\r
             this.data_chpt.TabIndex = 2;\r
             // \r
             // number\r
             // \r
-            dataGridViewCellStyle3.Format = "N0";\r
-            dataGridViewCellStyle3.NullValue = null;\r
-            this.number.DefaultCellStyle = dataGridViewCellStyle3;\r
+            dataGridViewCellStyle1.Format = "N0";\r
+            dataGridViewCellStyle1.NullValue = null;\r
+            this.number.DefaultCellStyle = dataGridViewCellStyle1;\r
             this.number.HeaderText = "Chapter Number";\r
             this.number.MaxInputLength = 3;\r
             this.number.Name = "number";\r
@@ -2159,6 +2161,15 @@ namespace Handbrake
             this.toolStripSeparator8.Name = "toolStripSeparator8";\r
             this.toolStripSeparator8.Size = new System.Drawing.Size(6, 39);\r
             // \r
+            // lbl_warn_chapt\r
+            // \r
+            this.lbl_warn_chapt.AutoSize = true;\r
+            this.lbl_warn_chapt.Location = new System.Drawing.Point(13, 52);\r
+            this.lbl_warn_chapt.Name = "lbl_warn_chapt";\r
+            this.lbl_warn_chapt.Size = new System.Drawing.Size(394, 13);\r
+            this.lbl_warn_chapt.TabIndex = 23;\r
+            this.lbl_warn_chapt.Text = "Please make sure you have selected a DVD tile in the \"Source\" box";\r
+            // \r
             // frmMain\r
             // \r
             this.AllowDrop = true;\r
@@ -2383,6 +2394,7 @@ namespace Handbrake
         private System.Windows.Forms.ToolStripButton btn_ActivityWindow;\r
         private System.Windows.Forms.ToolStripSeparator toolStripSeparator8;\r
         private System.Windows.Forms.ToolTip toolTip1;\r
+        private System.Windows.Forms.Label lbl_warn_chapt;\r
 \r
     }\r
 }
\ No newline at end of file
index 034a8a9d59815b3dd4b24eeb1f02eed8b91974b1..ce55b615da3bcbbceaefdd8fdea9d87eeb22fdf2 100644 (file)
@@ -1212,6 +1212,11 @@ namespace Handbrake
 \r
         #endregion\r
 \r
+        private void text_destination_TextChanged(object sender, EventArgs e)\r
+        {\r
+\r
+        }\r
+\r
 \r
 \r
         // This is the END of the road ------------------------------------------------------------------------------\r
index e4500ad200356eb838342daba8e98417f15f460b..4d4ebc0ac428dbeec5b2842f085dac661249c263 100644 (file)
@@ -189,12 +189,6 @@ Best used in conjunction with forced subtitles.</value>
   <metadata name="name.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
     <value>True</value>\r
   </metadata>\r
-  <metadata name="number.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
-    <value>True</value>\r
-  </metadata>\r
-  <metadata name="name.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
-    <value>True</value>\r
-  </metadata>\r
   <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
     <value>731, 18</value>\r
   </metadata>\r