From a25cbe584397c367486884953d85b8be569bba41 Mon Sep 17 00:00:00 2001 From: niksedk Date: Sat, 7 May 2022 13:00:35 +0200 Subject: [PATCH] Fix "Merge short lines" in "Batch Conv" to use UI settings - thx maharaj12 :) Fix #5936 --- Changelog.txt | 1 + src/libse/Common/Settings.cs | 2 +- src/ui/Forms/BatchConvert.cs | 9 +++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index dd65e9505..ae1e6ae4f 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -42,6 +42,7 @@ * Do not reapeat colors in color picker - thx SDH Marven * Fix cmd line convert issue with ebu stl headerfile - thx Rumczeis * Fix image export missing error for last two lines - th Antoine + * Fix "Merge short lines" in "Batch Conv" to use UI settings - thx maharaj12 3.6.5 (19th March 2022) diff --git a/src/libse/Common/Settings.cs b/src/libse/Common/Settings.cs index 7c8ee0b30..691d82434 100644 --- a/src/libse/Common/Settings.cs +++ b/src/libse/Common/Settings.cs @@ -529,7 +529,7 @@ namespace Nikse.SubtitleEdit.Core.Common ApplyMinimumDurationLimit = true; ApplyMaximumDurationLimit = true; MergeShortLinesMaxGap = 250; - MergeShortLinesMaxChars = 50; + MergeShortLinesMaxChars = 55; MergeShortLinesOnlyContinuous = true; ColumnPasteColumn = "all"; ColumnPasteOverwriteMode = "overwrite"; diff --git a/src/ui/Forms/BatchConvert.cs b/src/ui/Forms/BatchConvert.cs index 1d29c95c2..12daf0f0f 100644 --- a/src/ui/Forms/BatchConvert.cs +++ b/src/ui/Forms/BatchConvert.cs @@ -374,17 +374,18 @@ namespace Nikse.SubtitleEdit.Forms labelMaxCharacters.Text = LanguageSettings.Current.MergedShortLines.MaximumCharacters; labelMaxMillisecondsBetweenLines.Text = LanguageSettings.Current.MergedShortLines.MaximumMillisecondsBetween; checkBoxOnlyContinuationLines.Text = LanguageSettings.Current.MergedShortLines.OnlyMergeContinuationLines; - if (Configuration.Settings.General.SubtitleLineMaximumLength > numericUpDownMaxCharacters.Maximum) + + if (Configuration.Settings.Tools.MergeShortLinesMaxChars > numericUpDownMaxCharacters.Maximum) { numericUpDownMaxCharacters.Value = numericUpDownMaxCharacters.Maximum; } - else if (Configuration.Settings.General.SubtitleLineMaximumLength < numericUpDownMaxCharacters.Minimum) + else if (Configuration.Settings.Tools.MergeShortLinesMaxChars < numericUpDownMaxCharacters.Minimum) { numericUpDownMaxCharacters.Value = numericUpDownMaxCharacters.Minimum; } else { - numericUpDownMaxCharacters.Value = Configuration.Settings.General.SubtitleLineMaximumLength; + numericUpDownMaxCharacters.Value = Configuration.Settings.Tools.MergeShortLinesMaxChars; } if (Configuration.Settings.Tools.MergeShortLinesMaxGap >= numericUpDownMaxMillisecondsBetweenLines.Minimum && @@ -1635,7 +1636,7 @@ namespace Nikse.SubtitleEdit.Forms if (IsActionEnabled(CommandLineConverter.BatchAction.MergeShortLines)) { - var mergedShortLinesSub = MergeShortLinesUtils.MergeShortLinesInSubtitle(sub, Configuration.Settings.Tools.MergeShortLinesMaxGap, Configuration.Settings.General.SubtitleLineMaximumLength, Configuration.Settings.Tools.MergeShortLinesOnlyContinuous); + var mergedShortLinesSub = MergeShortLinesUtils.MergeShortLinesInSubtitle(sub, (int)numericUpDownMaxMillisecondsBetweenLines.Value, (int)numericUpDownMaxCharacters.Value, checkBoxOnlyContinuationLines.Checked); if (mergedShortLinesSub.Paragraphs.Count != sub.Paragraphs.Count) { sub.Paragraphs.Clear();