diff --git a/LanguageMaster.xml b/LanguageMaster.xml index 8095ad298..e0bdbbd54 100644 --- a/LanguageMaster.xml +++ b/LanguageMaster.xml @@ -2142,6 +2142,8 @@ can edit in same subtitle file (collaboration) None, dots for pauses Dots (trailing only) Dots + Ellipsis + None, ellipsis for pauses Dash Dash, but dots for pauses Music symbol diff --git a/src/libse/Common/ContinuationUtilities.cs b/src/libse/Common/ContinuationUtilities.cs index 78becd37e..2658d012d 100644 --- a/src/libse/Common/ContinuationUtilities.cs +++ b/src/libse/Common/ContinuationUtilities.cs @@ -318,13 +318,13 @@ namespace Nikse.SubtitleEdit.Core.Common } // Get last word - string lastWord = GetLastWord(text); - string newLastWord = lastWord; + var lastWord = GetLastWord(text); + var newLastWord = lastWord; if (gap && profile.UseDifferentStyleGap) { // Make new last word - string gapAddEnd = (profile.GapSuffixAddSpace ? " " : "") + profile.GapSuffix; + var gapAddEnd = (profile.GapSuffixAddSpace ? " " : "") + profile.GapSuffix; if (gapAddEnd.Length == 0 || !newLastWord.EndsWith(gapAddEnd, StringComparison.Ordinal)) { @@ -334,7 +334,7 @@ namespace Nikse.SubtitleEdit.Core.Common else { // Make new last word - string addEnd = (profile.SuffixAddSpace ? " " : "") + profile.Suffix; + var addEnd = (profile.SuffixAddSpace ? " " : "") + profile.Suffix; if (addEnd.Length == 0 || !newLastWord.EndsWith(addEnd, StringComparison.Ordinal)) { @@ -446,7 +446,7 @@ namespace Nikse.SubtitleEdit.Core.Common } } - string text = removeDashesDuringSanitization ? textWithoutDash : textWithDash; + var text = removeDashesDuringSanitization ? textWithoutDash : textWithDash; // Return if empty string if (string.IsNullOrEmpty(text)) @@ -461,13 +461,13 @@ namespace Nikse.SubtitleEdit.Core.Common } // Get first word of the paragraph - string firstWord = GetFirstWord(text); - string newFirstWord = firstWord; + var firstWord = GetFirstWord(text); + var newFirstWord = firstWord; if (gap && profile.UseDifferentStyleGap) { // Make new first word - string gapAddStart = profile.GapPrefix + (profile.GapPrefixAddSpace ? " " : ""); + var gapAddStart = profile.GapPrefix + (profile.GapPrefixAddSpace ? " " : ""); if (gapAddStart.Length == 0 || !newFirstWord.StartsWith(gapAddStart, StringComparison.Ordinal)) { @@ -477,8 +477,7 @@ namespace Nikse.SubtitleEdit.Core.Common else { // Make new first word - string addStart = profile.Prefix + (profile.PrefixAddSpace ? " " : ""); - + var addStart = profile.Prefix + (profile.PrefixAddSpace ? " " : ""); if (addStart.Length == 0 || !newFirstWord.StartsWith(addStart, StringComparison.Ordinal)) { newFirstWord = addStart + newFirstWord; @@ -490,9 +489,8 @@ namespace Nikse.SubtitleEdit.Core.Common var wordIndex = originalText.IndexOf(firstWord, StringComparison.Ordinal); if (wordIndex >= 1) { - bool needsInsertion = false; - int currentIndex = wordIndex - 1; - + var needsInsertion = false; + var currentIndex = wordIndex - 1; if (currentIndex >= 0 && ExplanationQuotes.Contains(originalText[currentIndex]) && !IsFullLineQuote(originalText, currentIndex + 1, originalText[currentIndex], QuotePairs[originalText[currentIndex]])) { @@ -542,9 +540,8 @@ namespace Nikse.SubtitleEdit.Core.Common } // Get last word - string lastWord = GetLastWord(text); - string newLastWord = lastWord; - + var lastWord = GetLastWord(text); + var newLastWord = lastWord; foreach (string suffix in Suffixes.Union(additionalSuffixes)) { if (newLastWord.EndsWith(suffix, StringComparison.Ordinal) && !newLastWord.EndsWith(Environment.NewLine + suffix, StringComparison.Ordinal)) @@ -596,8 +593,8 @@ namespace Nikse.SubtitleEdit.Core.Common public static string RemovePrefix(string originalText, ContinuationProfile profile, bool shouldRemoveDashesDuringSanitization, bool gap) { // Decide if we need to remove dashes - string textWithDash = SanitizeString(originalText, false); - string textWithoutDash = SanitizeString(originalText, true); + var textWithDash = SanitizeString(originalText, false); + var textWithoutDash = SanitizeString(originalText, true); string leadingDialogDash = null; bool removeDashesDuringSanitization = shouldRemoveDashesDuringSanitization; @@ -1280,6 +1277,10 @@ namespace Nikse.SubtitleEdit.Core.Common return 5; case ContinuationStyle.LeadingTrailingDashDots: return 6; + case ContinuationStyle.LeadingTrailingEllipsis: + return 7; + case ContinuationStyle.NoneEllipsisForPauses: + return 8; default: return 0; } @@ -1301,6 +1302,10 @@ namespace Nikse.SubtitleEdit.Core.Common return ContinuationStyle.LeadingTrailingDash; case 6: return ContinuationStyle.LeadingTrailingDashDots; + case 7: + return ContinuationStyle.LeadingTrailingEllipsis; + case 8: + return ContinuationStyle.NoneEllipsisForPauses; default: return ContinuationStyle.None; } @@ -1344,6 +1349,23 @@ namespace Nikse.SubtitleEdit.Core.Common GapPrefix = "", GapPrefixAddSpace = false }; + case ContinuationStyle.NoneEllipsisForPauses: + return new ContinuationProfile + { + Suffix = "", + SuffixApplyIfComma = false, + SuffixAddSpace = false, + SuffixReplaceComma = false, + Prefix = "", + PrefixAddSpace = false, + UseDifferentStyleGap = true, + GapSuffix = "…", + GapSuffixApplyIfComma = true, + GapSuffixAddSpace = false, + GapSuffixReplaceComma = true, + GapPrefix = "", + GapPrefixAddSpace = false + }; case ContinuationStyle.NoneLeadingTrailingDots: return new ContinuationProfile { @@ -1383,6 +1405,17 @@ namespace Nikse.SubtitleEdit.Core.Common PrefixAddSpace = false, UseDifferentStyleGap = false }; + case ContinuationStyle.LeadingTrailingEllipsis: + return new ContinuationProfile + { + Suffix = "…", + SuffixApplyIfComma = true, + SuffixAddSpace = false, + SuffixReplaceComma = true, + Prefix = "…", + PrefixAddSpace = false, + UseDifferentStyleGap = false + }; case ContinuationStyle.LeadingTrailingDash: return new ContinuationProfile { diff --git a/src/libse/Common/Settings.cs b/src/libse/Common/Settings.cs index b4bb20c37..a6434bf3f 100644 --- a/src/libse/Common/Settings.cs +++ b/src/libse/Common/Settings.cs @@ -1366,7 +1366,7 @@ $HorzAlign = Center CpsIncludesSpace = true, MinimumMillisecondsBetweenLines = 84, // 2 frames for 23.976 fps videos DialogStyle = DialogType.DashBothLinesWithoutSpace, - ContinuationStyle = ContinuationStyle.NoneTrailingDots + ContinuationStyle = ContinuationStyle.NoneEllipsisForPauses }); profiles.Add(new RulesProfile { @@ -1382,7 +1382,7 @@ $HorzAlign = Center CpsIncludesSpace = true, MinimumMillisecondsBetweenLines = 84, // 2 frames for 23.976 fps videos DialogStyle = DialogType.DashBothLinesWithSpace, - ContinuationStyle = ContinuationStyle.NoneTrailingDots + ContinuationStyle = ContinuationStyle.NoneEllipsisForPauses }); profiles.Add(new RulesProfile { @@ -1398,7 +1398,71 @@ $HorzAlign = Center CpsIncludesSpace = true, MinimumMillisecondsBetweenLines = 84, // 2 frames for 23.976 fps videos DialogStyle = DialogType.DashSecondLineWithoutSpace, - ContinuationStyle = ContinuationStyle.LeadingTrailingDots + ContinuationStyle = ContinuationStyle.LeadingTrailingEllipsis + }); + profiles.Add(new RulesProfile + { + Name = "Amazon Prime (English/Spanish/French)", + SubtitleLineMaximumLength = 42, + MaxNumberOfLines = 2, + MergeLinesShorterThan = 40, + SubtitleMaximumCharactersPerSeconds = 17, + SubtitleOptimalCharactersPerSeconds = 12, + SubtitleMaximumDisplayMilliseconds = 7000, + SubtitleMinimumDisplayMilliseconds = 1000, + SubtitleMaximumWordsPerMinute = 300, + CpsIncludesSpace = true, + MinimumMillisecondsBetweenLines = 84, // 2 frames for 23.976 fps videos + DialogStyle = DialogType.DashBothLinesWithSpace, + ContinuationStyle = ContinuationStyle.NoneEllipsisForPauses, + }); + profiles.Add(new RulesProfile + { + Name = "Amazon Prime (Arabic)", + SubtitleLineMaximumLength = 42, + MaxNumberOfLines = 2, + MergeLinesShorterThan = 40, + SubtitleMaximumCharactersPerSeconds = 20, + SubtitleOptimalCharactersPerSeconds = 12, + SubtitleMaximumDisplayMilliseconds = 7000, + SubtitleMinimumDisplayMilliseconds = 1000, + SubtitleMaximumWordsPerMinute = 300, + CpsIncludesSpace = true, + MinimumMillisecondsBetweenLines = 84, // 2 frames for 23.976 fps videos + DialogStyle = DialogType.DashBothLinesWithSpace, + ContinuationStyle = ContinuationStyle.NoneEllipsisForPauses, + }); + profiles.Add(new RulesProfile + { + Name = "Amazon Prime (Danish)", + SubtitleLineMaximumLength = 42, + MaxNumberOfLines = 2, + MergeLinesShorterThan = 40, + SubtitleMaximumCharactersPerSeconds = 17, + SubtitleOptimalCharactersPerSeconds = 12, + SubtitleMaximumDisplayMilliseconds = 7000, + SubtitleMinimumDisplayMilliseconds = 1000, + SubtitleMaximumWordsPerMinute = 300, + CpsIncludesSpace = true, + MinimumMillisecondsBetweenLines = 84, // 2 frames for 23.976 fps videos + DialogStyle = DialogType.DashBothLinesWithoutSpace, + ContinuationStyle = ContinuationStyle.NoneEllipsisForPauses, + }); + profiles.Add(new RulesProfile + { + Name = "Amazon Prime (Dutch)", + SubtitleLineMaximumLength = 42, + MaxNumberOfLines = 2, + MergeLinesShorterThan = 40, + SubtitleMaximumCharactersPerSeconds = 17, + SubtitleOptimalCharactersPerSeconds = 12, + SubtitleMaximumDisplayMilliseconds = 7000, + SubtitleMinimumDisplayMilliseconds = 1000, + SubtitleMaximumWordsPerMinute = 300, + CpsIncludesSpace = true, + MinimumMillisecondsBetweenLines = 84, // 2 frames for 23.976 fps videos + DialogStyle = DialogType.DashSecondLineWithoutSpace, + ContinuationStyle = ContinuationStyle.NoneEllipsisForPauses, }); profiles.Add(new RulesProfile { diff --git a/src/libse/Common/StringExtensions.cs b/src/libse/Common/StringExtensions.cs index 246fecdbb..b92715dbf 100644 --- a/src/libse/Common/StringExtensions.cs +++ b/src/libse/Common/StringExtensions.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Globalization; +using System.Linq; using System.Text; namespace Nikse.SubtitleEdit.Core.Common @@ -352,7 +353,7 @@ namespace Nikse.SubtitleEdit.Core.Common for (int index = 0; index < max; index++) { var ch = s[index]; - if (!char.IsControl(ch) && !char.IsWhiteSpace(ch)) + if (!char.IsControl(ch) && !char.IsWhiteSpace(ch) && !UnicodeControlChars.Contains(ch)) { return false; } diff --git a/src/libse/Enums/ContinuationStyle.cs b/src/libse/Enums/ContinuationStyle.cs index 823482e48..69679dd93 100644 --- a/src/libse/Enums/ContinuationStyle.cs +++ b/src/libse/Enums/ContinuationStyle.cs @@ -4,9 +4,11 @@ { None, NoneTrailingDots, + NoneEllipsisForPauses, NoneLeadingTrailingDots, OnlyTrailingDots, LeadingTrailingDots, + LeadingTrailingEllipsis, LeadingTrailingDash, LeadingTrailingDashDots, } diff --git a/src/libse/Forms/FixCommonErrors/FixContinuationStyle.cs b/src/libse/Forms/FixCommonErrors/FixContinuationStyle.cs index 2a25e4451..6d5447aa2 100644 --- a/src/libse/Forms/FixCommonErrors/FixContinuationStyle.cs +++ b/src/libse/Forms/FixCommonErrors/FixContinuationStyle.cs @@ -16,7 +16,7 @@ namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors private ContinuationUtilities.ContinuationProfile _continuationProfile; private List _names; - public string FixAction { get; set; } + public string FixAction { get; set; } public void Fix(Subtitle subtitle, IFixCallbacks callbacks) { @@ -36,12 +36,12 @@ namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors _continuationProfile.SuffixApplyIfComma = false; _continuationProfile.GapSuffixApplyIfComma = false; - if (_continuationProfile.Prefix == "...") + if (_continuationProfile.Prefix == "..." || _continuationProfile.Prefix == "…") { _continuationProfile.PrefixAddSpace = true; } - if (_continuationProfile.GapPrefix == "...") + if (_continuationProfile.GapPrefix == "..." || _continuationProfile.GapPrefix == "…") { _continuationProfile.GapPrefixAddSpace = true; } @@ -52,11 +52,10 @@ namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors bool inSentence = false; bool? inItalicSentence = null; - // Loop paragraphs for (int i = 0; i < subtitle.Paragraphs.Count - 1; i++) { - Paragraph p = subtitle.Paragraphs[i]; - Paragraph pNext = subtitle.Paragraphs[i + 1]; + var p = subtitle.Paragraphs[i]; + var pNext = subtitle.Paragraphs[i + 1]; var oldText = p.Text; var oldTextNext = pNext.Text; var text = ContinuationUtilities.SanitizeString(p.Text); @@ -279,13 +278,13 @@ namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors { if (_names == null) { - NameList nameList = new NameList(Configuration.DictionariesDirectory, language, Configuration.Settings.WordLists.UseOnlineNames, Configuration.Settings.WordLists.NamesUrl); + var nameList = new NameList(Configuration.DictionariesDirectory, language, Configuration.Settings.WordLists.UseOnlineNames, Configuration.Settings.WordLists.NamesUrl); _names = nameList.GetAllNames(); } if (_names != null) { - foreach (string name in _names) + foreach (var name in _names) { if (input.StartsWith(name + " ", StringComparison.Ordinal) || input.StartsWith(name + ",", StringComparison.Ordinal) || input.StartsWith(name + ":", StringComparison.Ordinal)) { diff --git a/src/ui/Forms/Options/Settings.Designer.cs b/src/ui/Forms/Options/Settings.Designer.cs index 7c9ebde34..cca59c364 100644 --- a/src/ui/Forms/Options/Settings.Designer.cs +++ b/src/ui/Forms/Options/Settings.Designer.cs @@ -97,21 +97,16 @@ this.labelDefaultFrameRate = new System.Windows.Forms.Label(); this.panelSubtitleFormats = new System.Windows.Forms.Panel(); this.groupBoxSubtitleFormats = new System.Windows.Forms.GroupBox(); - this.labelDefaultSubtitleFormat = new System.Windows.Forms.Label(); - this.comboBoxSubtitleFormats = new System.Windows.Forms.ComboBox(); - this.labelDefaultSaveAsFormat = new System.Windows.Forms.Label(); - this.comboBoxSubtitleSaveAsFormats = new System.Windows.Forms.ComboBox(); this.groupBoxFavoriteSubtitleFormats = new System.Windows.Forms.GroupBox(); - this.labelFavoriteFormats = new System.Windows.Forms.Label(); - this.listBoxFavoriteSubtitleFormats = new System.Windows.Forms.ListBox(); - this.buttonMoveToFavoriteFormats = new System.Windows.Forms.Button(); - this.buttonRemoveFromFavoriteFormats = new System.Windows.Forms.Button(); - this.labelFormats = new System.Windows.Forms.Label(); - this.labelFormatsSearch = new System.Windows.Forms.Label(); - this.textBoxFormatsSearch = new System.Windows.Forms.TextBox(); - this.buttonFormatsSearchClear = new System.Windows.Forms.Button(); - this.listBoxSubtitleFormats = new System.Windows.Forms.ListBox(); this.labelFavoriteSubtitleFormatsNote = new System.Windows.Forms.Label(); + this.listBoxSubtitleFormats = new System.Windows.Forms.ListBox(); + this.buttonFormatsSearchClear = new System.Windows.Forms.Button(); + this.textBoxFormatsSearch = new System.Windows.Forms.TextBox(); + this.labelFormatsSearch = new System.Windows.Forms.Label(); + this.labelFormats = new System.Windows.Forms.Label(); + this.buttonRemoveFromFavoriteFormats = new System.Windows.Forms.Button(); + this.buttonMoveToFavoriteFormats = new System.Windows.Forms.Button(); + this.listBoxFavoriteSubtitleFormats = new System.Windows.Forms.ListBox(); this.contextMenuStripFavoriteFormats = new System.Windows.Forms.ContextMenuStrip(this.components); this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.deleteAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -120,6 +115,11 @@ this.moveDownToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.moveToTopToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.moveToBottomToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.labelFavoriteFormats = new System.Windows.Forms.Label(); + this.comboBoxSubtitleSaveAsFormats = new System.Windows.Forms.ComboBox(); + this.labelDefaultSaveAsFormat = new System.Windows.Forms.Label(); + this.comboBoxSubtitleFormats = new System.Windows.Forms.ComboBox(); + this.labelDefaultSubtitleFormat = new System.Windows.Forms.Label(); this.panelShortcuts = new System.Windows.Forms.Panel(); this.groupBoxShortcuts = new System.Windows.Forms.GroupBox(); this.buttonShortcutsClear = new System.Windows.Forms.Button(); @@ -1336,7 +1336,7 @@ // groupBoxSubtitleFormats // this.groupBoxSubtitleFormats.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.groupBoxSubtitleFormats.Controls.Add(this.groupBoxFavoriteSubtitleFormats); this.groupBoxSubtitleFormats.Controls.Add(this.comboBoxSubtitleSaveAsFormats); @@ -1350,45 +1350,10 @@ this.groupBoxSubtitleFormats.TabStop = false; this.groupBoxSubtitleFormats.Text = "Subtitle formats"; // - // labelDefaultSubtitleFormat - // - this.labelDefaultSubtitleFormat.AutoSize = true; - this.labelDefaultSubtitleFormat.Location = new System.Drawing.Point(8, 30); - this.labelDefaultSubtitleFormat.Name = "labelDefaultSubtitleFormat"; - this.labelDefaultSubtitleFormat.Size = new System.Drawing.Size(86, 13); - this.labelDefaultSubtitleFormat.TabIndex = 0; - this.labelDefaultSubtitleFormat.Text = "Default format"; - // - // comboBoxSubtitleFormats - // - this.comboBoxSubtitleFormats.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.comboBoxSubtitleFormats.FormattingEnabled = true; - this.comboBoxSubtitleFormats.Location = new System.Drawing.Point(100, 26); - this.comboBoxSubtitleFormats.Name = "comboBoxSubtitleFormats"; - this.comboBoxSubtitleFormats.Size = new System.Drawing.Size(200, 21); - this.comboBoxSubtitleFormats.TabIndex = 1; - // - // labelDefaultSaveAsFormat - // - this.labelDefaultSaveAsFormat.AutoSize = true; - this.labelDefaultSaveAsFormat.Location = new System.Drawing.Point(8, 64); - this.labelDefaultSaveAsFormat.Name = "labelDefaultSaveAsFormat"; - this.labelDefaultSaveAsFormat.Size = new System.Drawing.Size(86, 13); - this.labelDefaultSaveAsFormat.TabIndex = 2; - this.labelDefaultSaveAsFormat.Text = "Default save as format"; - // - // comboBoxSubtitleSaveAsFormats - // - this.comboBoxSubtitleSaveAsFormats.FormattingEnabled = true; - this.comboBoxSubtitleSaveAsFormats.Location = new System.Drawing.Point(100, 60); - this.comboBoxSubtitleSaveAsFormats.Name = "comboBoxSubtitleSaveAsFormats"; - this.comboBoxSubtitleSaveAsFormats.Size = new System.Drawing.Size(200, 21); - this.comboBoxSubtitleSaveAsFormats.TabIndex = 3; - // // groupBoxFavoriteSubtitleFormats // - this.groupBoxFavoriteSubtitleFormats.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) + this.groupBoxFavoriteSubtitleFormats.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.groupBoxFavoriteSubtitleFormats.Controls.Add(this.labelFavoriteSubtitleFormatsNote); this.groupBoxFavoriteSubtitleFormats.Controls.Add(this.listBoxSubtitleFormats); @@ -1407,76 +1372,26 @@ this.groupBoxFavoriteSubtitleFormats.TabStop = false; this.groupBoxFavoriteSubtitleFormats.Text = "Favorites"; // - // labelFavoriteFormats + // labelFavoriteSubtitleFormatsNote // - this.labelFavoriteFormats.AutoSize = true; - this.labelFavoriteFormats.Location = new System.Drawing.Point(48, 34); - this.labelFavoriteFormats.Name = "labelFavoriteFormats"; - this.labelFavoriteFormats.Size = new System.Drawing.Size(86, 13); - this.labelFavoriteFormats.TabIndex = 0; - this.labelFavoriteFormats.Text = "Favorite formats"; + this.labelFavoriteSubtitleFormatsNote.AutoSize = true; + this.labelFavoriteSubtitleFormatsNote.Location = new System.Drawing.Point(10, 367); + this.labelFavoriteSubtitleFormatsNote.Name = "labelFavoriteSubtitleFormatsNote"; + this.labelFavoriteSubtitleFormatsNote.Size = new System.Drawing.Size(540, 13); + this.labelFavoriteSubtitleFormatsNote.TabIndex = 9; + this.labelFavoriteSubtitleFormatsNote.Text = "Note: favorite formats will be shown first when selecting a format, the default f" + + "ormat will always be shown first"; // - // listBoxFavoriteSubtitleFormats + // listBoxSubtitleFormats // - this.listBoxFavoriteSubtitleFormats.ContextMenuStrip = contextMenuStripFavoriteFormats; - this.listBoxFavoriteSubtitleFormats.FormattingEnabled = true; - this.listBoxFavoriteSubtitleFormats.ItemHeight = 16; - this.listBoxFavoriteSubtitleFormats.Location = new System.Drawing.Point(48, 50); - this.listBoxFavoriteSubtitleFormats.Name = "listBoxFavoriteSubtitleFormats"; - this.listBoxFavoriteSubtitleFormats.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended; - this.listBoxFavoriteSubtitleFormats.Size = new System.Drawing.Size(300, 277); - this.listBoxFavoriteSubtitleFormats.TabIndex = 1; - this.listBoxFavoriteSubtitleFormats.SelectedIndexChanged += new System.EventHandler(this.listBoxFavoriteSubtitleFormats_SelectedIndexChanged); - this.listBoxFavoriteSubtitleFormats.KeyDown += new System.Windows.Forms.KeyEventHandler(this.listBoxFavoriteSubtitleFormats_KeyDown); - this.listBoxFavoriteSubtitleFormats.LostFocus += new System.EventHandler(listBoxFavoriteSubtitleFormats_LostFocus); - // - // buttonMoveToFavoriteFormats - // - this.buttonMoveToFavoriteFormats.Enabled = false; - this.buttonMoveToFavoriteFormats.Location = new System.Drawing.Point(363, 153); - this.buttonMoveToFavoriteFormats.Name = "buttonMoveToFavoriteFormats"; - this.buttonMoveToFavoriteFormats.Size = new System.Drawing.Size(111, 23); - this.buttonMoveToFavoriteFormats.TabIndex = 2; - this.buttonMoveToFavoriteFormats.Text = " < "; - this.buttonMoveToFavoriteFormats.UseVisualStyleBackColor = true; - this.buttonMoveToFavoriteFormats.Click += new System.EventHandler(this.buttonMoveToFavorites_Click); - // - // buttonRemoveFromFavoriteFormats - // - this.buttonRemoveFromFavoriteFormats.Enabled = false; - this.buttonRemoveFromFavoriteFormats.Location = new System.Drawing.Point(363, 202); - this.buttonRemoveFromFavoriteFormats.Name = "buttonRemoveFromFavoriteFormats"; - this.buttonRemoveFromFavoriteFormats.Size = new System.Drawing.Size(111, 23); - this.buttonRemoveFromFavoriteFormats.TabIndex = 3; - this.buttonRemoveFromFavoriteFormats.Text = "Remove"; - this.buttonRemoveFromFavoriteFormats.UseVisualStyleBackColor = true; - this.buttonRemoveFromFavoriteFormats.Click += new System.EventHandler(this.buttonRemoveFromFavoriteFormats_Click); - // - // labelFormats - // - this.labelFormats.AutoSize = true; - this.labelFormats.Location = new System.Drawing.Point(489, 34); - this.labelFormats.Name = "labelFormats"; - this.labelFormats.Size = new System.Drawing.Size(86, 13); - this.labelFormats.TabIndex = 4; - this.labelFormats.Text = "Formats"; - // - // labelFormatsSearch - // - this.labelFormatsSearch.AutoSize = true; - this.labelFormatsSearch.Location = new System.Drawing.Point(489, 56); - this.labelFormatsSearch.Name = "labelFormatsSearch"; - this.labelFormatsSearch.Size = new System.Drawing.Size(40, 13); - this.labelFormatsSearch.TabIndex = 5; - this.labelFormatsSearch.Text = "Search"; - // - // textBoxFormatsSearch - // - this.textBoxFormatsSearch.Location = new System.Drawing.Point(529, 52); - this.textBoxFormatsSearch.Name = "textBoxShortcutSearch"; - this.textBoxFormatsSearch.Size = new System.Drawing.Size(151, 21); - this.textBoxFormatsSearch.TabIndex = 6; - this.textBoxFormatsSearch.TextChanged += new System.EventHandler(this.textBoxFormatsSearch_TextChanged); + this.listBoxSubtitleFormats.FormattingEnabled = true; + this.listBoxSubtitleFormats.Location = new System.Drawing.Point(489, 76); + this.listBoxSubtitleFormats.Name = "listBoxSubtitleFormats"; + this.listBoxSubtitleFormats.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended; + this.listBoxSubtitleFormats.Size = new System.Drawing.Size(300, 251); + this.listBoxSubtitleFormats.TabIndex = 8; + this.listBoxSubtitleFormats.SelectedIndexChanged += new System.EventHandler(this.listBoxSubtitleFormats_SelectedIndexChanged); + this.listBoxSubtitleFormats.LostFocus += new System.EventHandler(this.listBoxSubtitleFormats_LostFocus); // // buttonFormatsSearchClear // @@ -1489,31 +1404,71 @@ this.buttonFormatsSearchClear.UseVisualStyleBackColor = true; this.buttonFormatsSearchClear.Click += new System.EventHandler(this.buttonFormatsSearchClear_Click); // - // listBoxSubtitleFormats + // textBoxFormatsSearch // - this.listBoxSubtitleFormats.FormattingEnabled = true; - this.listBoxSubtitleFormats.ItemHeight = 16; - this.listBoxSubtitleFormats.Location = new System.Drawing.Point(489, 76); - this.listBoxSubtitleFormats.Name = "listBoxSubtitleFormats"; - this.listBoxSubtitleFormats.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended; - this.listBoxSubtitleFormats.Size = new System.Drawing.Size(300, 260); - this.listBoxSubtitleFormats.TabIndex = 8; - this.listBoxSubtitleFormats.SelectedIndexChanged += new System.EventHandler(this.listBoxSubtitleFormats_SelectedIndexChanged); - this.listBoxSubtitleFormats.LostFocus += new System.EventHandler(this.listBoxSubtitleFormats_LostFocus); + this.textBoxFormatsSearch.Location = new System.Drawing.Point(529, 52); + this.textBoxFormatsSearch.Name = "textBoxFormatsSearch"; + this.textBoxFormatsSearch.Size = new System.Drawing.Size(151, 21); + this.textBoxFormatsSearch.TabIndex = 6; + this.textBoxFormatsSearch.TextChanged += new System.EventHandler(this.textBoxFormatsSearch_TextChanged); // - // labelFavoriteSubtitleFormatsNote + // labelFormatsSearch // - this.labelFavoriteSubtitleFormatsNote.AutoSize = true; - this.labelFavoriteSubtitleFormatsNote.Location = new System.Drawing.Point(10, 367); - this.labelFavoriteSubtitleFormatsNote.Name = "labelFavoriteSubtitleFormatsNote"; - this.labelFavoriteSubtitleFormatsNote.Size = new System.Drawing.Size(278, 13); - this.labelFavoriteSubtitleFormatsNote.TabIndex = 9; - this.labelFavoriteSubtitleFormatsNote.Text = "Note: favorite formats will be shown first when selecting a format, the default format will always be shown first"; + this.labelFormatsSearch.AutoSize = true; + this.labelFormatsSearch.Location = new System.Drawing.Point(489, 56); + this.labelFormatsSearch.Name = "labelFormatsSearch"; + this.labelFormatsSearch.Size = new System.Drawing.Size(40, 13); + this.labelFormatsSearch.TabIndex = 5; + this.labelFormatsSearch.Text = "Search"; + // + // labelFormats + // + this.labelFormats.AutoSize = true; + this.labelFormats.Location = new System.Drawing.Point(489, 34); + this.labelFormats.Name = "labelFormats"; + this.labelFormats.Size = new System.Drawing.Size(46, 13); + this.labelFormats.TabIndex = 4; + this.labelFormats.Text = "Formats"; + // + // buttonRemoveFromFavoriteFormats + // + this.buttonRemoveFromFavoriteFormats.Enabled = false; + this.buttonRemoveFromFavoriteFormats.Location = new System.Drawing.Point(363, 202); + this.buttonRemoveFromFavoriteFormats.Name = "buttonRemoveFromFavoriteFormats"; + this.buttonRemoveFromFavoriteFormats.Size = new System.Drawing.Size(111, 23); + this.buttonRemoveFromFavoriteFormats.TabIndex = 3; + this.buttonRemoveFromFavoriteFormats.Text = "Remove"; + this.buttonRemoveFromFavoriteFormats.UseVisualStyleBackColor = true; + this.buttonRemoveFromFavoriteFormats.Click += new System.EventHandler(this.buttonRemoveFromFavoriteFormats_Click); + // + // buttonMoveToFavoriteFormats + // + this.buttonMoveToFavoriteFormats.Enabled = false; + this.buttonMoveToFavoriteFormats.Location = new System.Drawing.Point(363, 153); + this.buttonMoveToFavoriteFormats.Name = "buttonMoveToFavoriteFormats"; + this.buttonMoveToFavoriteFormats.Size = new System.Drawing.Size(111, 23); + this.buttonMoveToFavoriteFormats.TabIndex = 2; + this.buttonMoveToFavoriteFormats.Text = " < "; + this.buttonMoveToFavoriteFormats.UseVisualStyleBackColor = true; + this.buttonMoveToFavoriteFormats.Click += new System.EventHandler(this.buttonMoveToFavorites_Click); + // + // listBoxFavoriteSubtitleFormats + // + this.listBoxFavoriteSubtitleFormats.ContextMenuStrip = this.contextMenuStripFavoriteFormats; + this.listBoxFavoriteSubtitleFormats.FormattingEnabled = true; + this.listBoxFavoriteSubtitleFormats.Location = new System.Drawing.Point(48, 50); + this.listBoxFavoriteSubtitleFormats.Name = "listBoxFavoriteSubtitleFormats"; + this.listBoxFavoriteSubtitleFormats.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended; + this.listBoxFavoriteSubtitleFormats.Size = new System.Drawing.Size(300, 277); + this.listBoxFavoriteSubtitleFormats.TabIndex = 1; + this.listBoxFavoriteSubtitleFormats.SelectedIndexChanged += new System.EventHandler(this.listBoxFavoriteSubtitleFormats_SelectedIndexChanged); + this.listBoxFavoriteSubtitleFormats.KeyDown += new System.Windows.Forms.KeyEventHandler(this.listBoxFavoriteSubtitleFormats_KeyDown); + this.listBoxFavoriteSubtitleFormats.LostFocus += new System.EventHandler(this.listBoxFavoriteSubtitleFormats_LostFocus); // // contextMenuStripFavoriteFormats // this.contextMenuStripFavoriteFormats.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.deleteToolStripMenuItem, + this.deleteToolStripMenuItem, this.deleteAllToolStripMenuItem, this.toolStripSeparator, this.moveUpToolStripMenuItem, @@ -1521,7 +1476,7 @@ this.moveToTopToolStripMenuItem, this.moveToBottomToolStripMenuItem}); this.contextMenuStripFavoriteFormats.Name = "contextMenuStripFavoriteFormats"; - this.contextMenuStripFavoriteFormats.Size = new System.Drawing.Size(216, 214); + this.contextMenuStripFavoriteFormats.Size = new System.Drawing.Size(216, 142); this.contextMenuStripFavoriteFormats.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStripFavoriteFormats_Opening); // // deleteToolStripMenuItem @@ -1576,6 +1531,49 @@ this.moveToBottomToolStripMenuItem.Text = "Move to bottom"; this.moveToBottomToolStripMenuItem.Click += new System.EventHandler(this.moveToBottomToolStripMenuItem_Click); // + // labelFavoriteFormats + // + this.labelFavoriteFormats.AutoSize = true; + this.labelFavoriteFormats.Location = new System.Drawing.Point(48, 34); + this.labelFavoriteFormats.Name = "labelFavoriteFormats"; + this.labelFavoriteFormats.Size = new System.Drawing.Size(87, 13); + this.labelFavoriteFormats.TabIndex = 0; + this.labelFavoriteFormats.Text = "Favorite formats"; + // + // comboBoxSubtitleSaveAsFormats + // + this.comboBoxSubtitleSaveAsFormats.FormattingEnabled = true; + this.comboBoxSubtitleSaveAsFormats.Location = new System.Drawing.Point(100, 60); + this.comboBoxSubtitleSaveAsFormats.Name = "comboBoxSubtitleSaveAsFormats"; + this.comboBoxSubtitleSaveAsFormats.Size = new System.Drawing.Size(200, 21); + this.comboBoxSubtitleSaveAsFormats.TabIndex = 3; + // + // labelDefaultSaveAsFormat + // + this.labelDefaultSaveAsFormat.AutoSize = true; + this.labelDefaultSaveAsFormat.Location = new System.Drawing.Point(8, 64); + this.labelDefaultSaveAsFormat.Name = "labelDefaultSaveAsFormat"; + this.labelDefaultSaveAsFormat.Size = new System.Drawing.Size(117, 13); + this.labelDefaultSaveAsFormat.TabIndex = 2; + this.labelDefaultSaveAsFormat.Text = "Default save as format"; + // + // comboBoxSubtitleFormats + // + this.comboBoxSubtitleFormats.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxSubtitleFormats.FormattingEnabled = true; + this.comboBoxSubtitleFormats.Location = new System.Drawing.Point(100, 26); + this.comboBoxSubtitleFormats.Name = "comboBoxSubtitleFormats"; + this.comboBoxSubtitleFormats.Size = new System.Drawing.Size(200, 21); + this.comboBoxSubtitleFormats.TabIndex = 1; + // + // labelDefaultSubtitleFormat + // + this.labelDefaultSubtitleFormat.AutoSize = true; + this.labelDefaultSubtitleFormat.Location = new System.Drawing.Point(8, 30); + this.labelDefaultSubtitleFormat.Name = "labelDefaultSubtitleFormat"; + this.labelDefaultSubtitleFormat.Size = new System.Drawing.Size(77, 13); + this.labelDefaultSubtitleFormat.TabIndex = 0; + this.labelDefaultSubtitleFormat.Text = "Default format"; // // panelShortcuts // @@ -4919,10 +4917,10 @@ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1092, 574); + this.Controls.Add(this.panelGeneral); this.Controls.Add(this.panelFont); this.Controls.Add(this.panelNetwork); this.Controls.Add(this.panelSubtitleFormats); - this.Controls.Add(this.panelGeneral); this.Controls.Add(this.panelVideoPlayer); this.Controls.Add(this.panelWordLists); this.Controls.Add(this.panelTools); diff --git a/src/ui/Forms/Options/Settings.cs b/src/ui/Forms/Options/Settings.cs index c837347d0..0183e364f 100644 --- a/src/ui/Forms/Options/Settings.cs +++ b/src/ui/Forms/Options/Settings.cs @@ -1169,6 +1169,8 @@ namespace Nikse.SubtitleEdit.Forms.Options comboBoxContinuationStyle.Items.Add(LanguageSettings.Current.Settings.ContinuationStyleLeadingTrailingDots); comboBoxContinuationStyle.Items.Add(LanguageSettings.Current.Settings.ContinuationStyleLeadingTrailingDash); comboBoxContinuationStyle.Items.Add(LanguageSettings.Current.Settings.ContinuationStyleLeadingTrailingDashDots); + comboBoxContinuationStyle.Items.Add(LanguageSettings.Current.Settings.ContinuationStyleLeadingTrailingEllipsis); + comboBoxContinuationStyle.Items.Add(LanguageSettings.Current.Settings.ContinuationStyleNoneTrailingEllipsis); comboBoxContinuationStyle.SelectedIndex = 0; toolTipContinuationPreview.RemoveAll(); toolTipContinuationPreview.SetToolTip(comboBoxContinuationStyle, ContinuationUtilities.GetContinuationStylePreview(continuationStyle)); diff --git a/src/ui/Forms/Options/Settings.resx b/src/ui/Forms/Options/Settings.resx index 683a8b0b8..b551e3d64 100644 --- a/src/ui/Forms/Options/Settings.resx +++ b/src/ui/Forms/Options/Settings.resx @@ -117,19 +117,22 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 464, 17 - - + 17, 17 + + 592, 17 + + + 253, 17 + - 287, 17 + 415, 17 - 664, 17 + 792, 17 - 867, 17 + 17, 56 \ No newline at end of file diff --git a/src/ui/Logic/Language.cs b/src/ui/Logic/Language.cs index 064e903e6..af73bab1c 100644 --- a/src/ui/Logic/Language.cs +++ b/src/ui/Logic/Language.cs @@ -2451,8 +2451,10 @@ can edit in same subtitle file (collaboration)", ContinuationStyleNone = "None", ContinuationStyleNoneTrailingDots = "None, dots for pauses (trailing only)", ContinuationStyleNoneLeadingTrailingDots = "None, dots for pauses", + ContinuationStyleNoneTrailingEllipsis = "None, ellipsis for pauses", ContinuationStyleOnlyTrailingDots = "Dots (trailing only)", ContinuationStyleLeadingTrailingDots = "Dots", + ContinuationStyleLeadingTrailingEllipsis = "Ellipsis", ContinuationStyleLeadingTrailingDash = "Dash", ContinuationStyleLeadingTrailingDashDots = "Dash, but dots for pauses", MusicSymbol = "Music symbol", diff --git a/src/ui/Logic/LanguageDeserializer.cs b/src/ui/Logic/LanguageDeserializer.cs index 6ae9db479..e18f680d0 100644 --- a/src/ui/Logic/LanguageDeserializer.cs +++ b/src/ui/Logic/LanguageDeserializer.cs @@ -5836,6 +5836,12 @@ namespace Nikse.SubtitleEdit.Logic case "Settings/ContinuationStyleLeadingTrailingDots": language.Settings.ContinuationStyleLeadingTrailingDots = reader.Value; break; + case "Settings/ContinuationStyleLeadingTrailingEllipsis": + language.Settings.ContinuationStyleLeadingTrailingEllipsis = reader.Value; + break; + case "Settings/ContinuationStyleNoneTrailingEllipsis": + language.Settings.ContinuationStyleNoneTrailingEllipsis = reader.Value; + break; case "Settings/ContinuationStyleLeadingTrailingDash": language.Settings.ContinuationStyleLeadingTrailingDash = reader.Value; break; diff --git a/src/ui/Logic/LanguageStructure.cs b/src/ui/Logic/LanguageStructure.cs index e15b1cece..7329eb031 100644 --- a/src/ui/Logic/LanguageStructure.cs +++ b/src/ui/Logic/LanguageStructure.cs @@ -2312,6 +2312,8 @@ public string ContinuationStyleNoneLeadingTrailingDots { get; set; } public string ContinuationStyleOnlyTrailingDots { get; set; } public string ContinuationStyleLeadingTrailingDots { get; set; } + public string ContinuationStyleLeadingTrailingEllipsis { get; set; } + public string ContinuationStyleNoneTrailingEllipsis { get; set; } public string ContinuationStyleLeadingTrailingDash { get; set; } public string ContinuationStyleLeadingTrailingDashDots { get; set; } public string MusicSymbol { get; set; } diff --git a/src/ui/Logic/UiUtil.cs b/src/ui/Logic/UiUtil.cs index f13e8b7a7..876ea2bb3 100644 --- a/src/ui/Logic/UiUtil.cs +++ b/src/ui/Logic/UiUtil.cs @@ -1350,6 +1350,10 @@ namespace Nikse.SubtitleEdit.Logic return LanguageSettings.Current.Settings.ContinuationStyleLeadingTrailingDash; case ContinuationStyle.LeadingTrailingDashDots: return LanguageSettings.Current.Settings.ContinuationStyleLeadingTrailingDashDots; + case ContinuationStyle.LeadingTrailingEllipsis: + return LanguageSettings.Current.Settings.ContinuationStyleLeadingTrailingEllipsis; + case ContinuationStyle.NoneEllipsisForPauses: + return LanguageSettings.Current.Settings.ContinuationStyleNoneTrailingEllipsis; default: return LanguageSettings.Current.Settings.ContinuationStyleNone; }