]> granicus.if.org Git - handbrake/commitdiff
WinGui: Fixes to the Burned/Default flags being set incorrectly on the subtitle tab...
authorsr55 <sr55.hb@outlook.com>
Thu, 17 Nov 2011 22:05:34 +0000 (22:05 +0000)
committersr55 <sr55.hb@outlook.com>
Thu, 17 Nov 2011 22:05:34 +0000 (22:05 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4356 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/Controls/Subtitles.cs

index 654c99fdc8ba122e08bf5005788acfe7e014d078..4a5bc5fd55124ded26fb08bcd2bdd25a1daf3522 100644 (file)
@@ -363,15 +363,17 @@ namespace Handbrake.Controls
             }\r
 \r
             // Logic\r
-            string forcedVal = check_forced.CheckState == CheckState.Checked ? "Yes" : "No";\r
-            string defaultSub = check_default.CheckState == CheckState.Checked ? "Yes" : "No";\r
-            string burnedVal = check_burned.CheckState == CheckState.Checked &&\r
-                               (drp_subtitleTracks.Text.Contains("(VOBSUB)") || drp_subtitleTracks.Text.Contains("(SSA)"))\r
-                                   ? "Yes"\r
-                                   : "No";\r
             string srtCode = "-", srtLangVal = "-", srtPath = "-", srtFile = "-";\r
             int srtOffsetMs = 0;\r
 \r
+            // Make sure we only have 1 burned track. We'll always give the latest track added burned in.\r
+            if (check_burned.Checked)\r
+                this.SetBurnedToOffForAllTracks();\r
+\r
+            // Make sure we only have 1 default track\r
+            if (check_default.Checked)\r
+                this.SetDefaultToOffForAllTracks();\r
+\r
             if (drp_subtitleTracks.SelectedItem.ToString().Contains(".srt"))\r
             {\r
                 srtFiles.TryGetValue(drp_subtitleTracks.SelectedItem.ToString(), out srtPath);\r
@@ -379,12 +381,6 @@ namespace Handbrake.Controls
                 srtLangVal = srt_lang.SelectedItem.ToString();\r
                 srtCode = srt_charcode.SelectedItem.ToString();\r
                 srtOffsetMs = (int)srt_offset.Value;\r
-                if (defaultSub == "Yes") this.SetDefaultToOffForAllSRTTracks();\r
-            }\r
-            else\r
-            {\r
-                if (defaultSub == "Yes") this.SetDefaultToOffForAllTracks();\r
-                if (burnedVal == "Yes") this.SetBurnedToOffForAllTracks();\r
             }\r
 \r
             string trackName = (drp_subtitleTracks.SelectedItem.ToString().Contains(".srt"))\r
@@ -666,10 +662,7 @@ namespace Handbrake.Controls
             if (lv_subList.Items.Count == 0 || lv_subList.SelectedIndices.Count == 0) return;\r
 \r
             if (check_default.Checked) // Make sure we only have 1 default track\r
-                if (lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[0].Text.Contains(".srt"))\r
-                    this.SetDefaultToOffForAllSRTTracks();\r
-                else\r
-                    this.SetDefaultToOffForAllTracks();\r
+                this.SetDefaultToOffForAllTracks();\r
 \r
             lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[3].Text = check_default.Checked ? "Yes" : "No";\r
             lv_subList.Select();\r
@@ -823,33 +816,10 @@ namespace Handbrake.Controls
             int c = 0;\r
             foreach (ListViewItem item in lv_subList.Items)\r
             {\r
-                if (subList[c].SrtPath == "-")\r
-                {\r
-                    if (item.SubItems[3].Text == "Yes")\r
-                    {\r
-                        item.SubItems[3].Text = "No";\r
-                        subList[c].Default = false;\r
-                    }\r
-                }\r
-                c++;\r
-            }\r
-        }\r
-\r
-        /// <summary>\r
-        /// Set all subtitle tracks so that they have no default.\r
-        /// </summary>\r
-        private void SetDefaultToOffForAllSRTTracks()\r
-        {\r
-            int c = 0;\r
-            foreach (ListViewItem item in lv_subList.Items)\r
-            {\r
-                if (!subList[c].IsSrtSubtitle)\r
+                if (item.SubItems[3].Text == "Yes")\r
                 {\r
-                    if (item.SubItems[3].Text == "Yes")\r
-                    {\r
-                        item.SubItems[3].Text = "No";\r
-                        subList[c].Default = false;\r
-                    }\r
+                    item.SubItems[3].Text = "No";\r
+                    subList[c].Default = false;\r
                 }\r
                 c++;\r
             }\r