Remember combobox line split mode in "Import plain text" - thx Leon :)

Fix #7743
This commit is contained in:
Nikolaj Olsson 2023-12-16 13:07:28 +01:00
parent f6f7f77d5c
commit 0e45b8aee7
2 changed files with 22 additions and 0 deletions

View File

@ -330,6 +330,7 @@ namespace Nikse.SubtitleEdit.Core.Common
public bool FixCommonErrorsFixOverlapAllowEqualEndStart { get; set; }
public bool FixCommonErrorsSkipStepOne { get; set; }
public string ImportTextSplitting { get; set; }
public string ImportTextSplittingLineMode { get; set; }
public string ImportTextLineBreak { get; set; }
public bool ImportTextMergeShortLines { get; set; }
public bool ImportTextRemoveEmptyLines { get; set; }
@ -6151,6 +6152,12 @@ $HorzAlign = Center
settings.Tools.ImportTextSplitting = subNode.InnerText;
}
subNode = node.SelectSingleNode("ImportTextSplittingLineMode");
if (subNode != null)
{
settings.Tools.ImportTextSplittingLineMode = subNode.InnerText;
}
subNode = node.SelectSingleNode("ImportTextMergeShortLines");
if (subNode != null)
{
@ -11795,6 +11802,7 @@ $HorzAlign = Center
textWriter.WriteElementString("FixCommonErrorsFixOverlapAllowEqualEndStart", settings.Tools.FixCommonErrorsFixOverlapAllowEqualEndStart.ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("FixCommonErrorsSkipStepOne", settings.Tools.FixCommonErrorsSkipStepOne.ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("ImportTextSplitting", settings.Tools.ImportTextSplitting);
textWriter.WriteElementString("ImportTextSplittingLineMode", settings.Tools.ImportTextSplittingLineMode);
textWriter.WriteElementString("ImportTextMergeShortLines", settings.Tools.ImportTextMergeShortLines.ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("ImportTextLineBreak", settings.Tools.ImportTextLineBreak);
textWriter.WriteElementString("ImportTextRemoveEmptyLines", settings.Tools.ImportTextRemoveEmptyLines.ToString(CultureInfo.InvariantCulture));

View File

@ -45,6 +45,11 @@ namespace Nikse.SubtitleEdit.Forms
comboBoxLineMode.Items.Add(LanguageSettings.Current.ImportText.OneLineIsOneSubtitle);
comboBoxLineMode.Items.Add(LanguageSettings.Current.ImportText.TwoLinesAreOneSubtitle);
comboBoxLineMode.SelectedIndex = 0;
if (Configuration.Settings.Tools.ImportTextSplittingLineMode == "TwoLinesAreOneSubtitle")
{
comboBoxLineMode.SelectedIndex = 1;
}
labelLineBreak.Text = LanguageSettings.Current.ImportText.LineBreak;
columnHeaderFName.Text = LanguageSettings.Current.JoinSubtitles.FileName;
columnHeaderSize.Text = LanguageSettings.Current.General.Size;
@ -1200,6 +1205,15 @@ namespace Nikse.SubtitleEdit.Forms
Configuration.Settings.Tools.ImportTextAutoSplitNumberOfLines = numericUpDownAutoSplitMaxLines.Value;
Configuration.Settings.Tools.ImportTextAutoSplitAtBlank = checkBoxAutoSplitAtBlankLines.Checked;
if (comboBoxLineMode.SelectedIndex == 0)
{
Configuration.Settings.Tools.ImportTextSplittingLineMode = "OneLineIsOneSubtitle";
}
else
{
Configuration.Settings.Tools.ImportTextSplittingLineMode = "TwoLinesAreOneSubtitle";
}
if (radioButtonAutoSplit.Checked)
{
Configuration.Settings.Tools.ImportTextRemoveLinesNoLetters = checkBoxAutoSplitRemoveLinesNoLetters.Checked;