mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-27 22:42:38 +01:00
Refactoring, add "None, only trailing dots for pauses" style for NF
This commit is contained in:
parent
069cd2dbfa
commit
254575ab82
@ -1968,6 +1968,7 @@ can edit in same subtitle file (collaboration)</Information>
|
|||||||
<DialogStyleDashSecondLineWithoutSpace>Dash second line without space</DialogStyleDashSecondLineWithoutSpace>
|
<DialogStyleDashSecondLineWithoutSpace>Dash second line without space</DialogStyleDashSecondLineWithoutSpace>
|
||||||
<ContinuationStyle>Continuation style</ContinuationStyle>
|
<ContinuationStyle>Continuation style</ContinuationStyle>
|
||||||
<ContinuationStyleNone>None</ContinuationStyleNone>
|
<ContinuationStyleNone>None</ContinuationStyleNone>
|
||||||
|
<ContinuationStyleNoneTrailingDots>None, dots for pauses (trailing only)</ContinuationStyleNoneTrailingDots>
|
||||||
<ContinuationStyleNoneLeadingTrailingDots>None, dots for pauses</ContinuationStyleNoneLeadingTrailingDots>
|
<ContinuationStyleNoneLeadingTrailingDots>None, dots for pauses</ContinuationStyleNoneLeadingTrailingDots>
|
||||||
<ContinuationStyleOnlyTrailingDots>Dots (trailing only)</ContinuationStyleOnlyTrailingDots>
|
<ContinuationStyleOnlyTrailingDots>Dots (trailing only)</ContinuationStyleOnlyTrailingDots>
|
||||||
<ContinuationStyleLeadingTrailingDots>Dots</ContinuationStyleLeadingTrailingDots>
|
<ContinuationStyleLeadingTrailingDots>Dots</ContinuationStyleLeadingTrailingDots>
|
||||||
|
@ -319,51 +319,7 @@ namespace Nikse.SubtitleEdit.Core
|
|||||||
return DialogType.DashBothLinesWithSpace;
|
return DialogType.DashBothLinesWithSpace;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ContinuationStyle GetContinuationStyleFromIndex(int index)
|
|
||||||
{
|
|
||||||
switch (index)
|
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
return ContinuationStyle.NoneLeadingTrailingDots;
|
|
||||||
case 2:
|
|
||||||
return ContinuationStyle.OnlyTrailingDots;
|
|
||||||
case 3:
|
|
||||||
return ContinuationStyle.LeadingTrailingDots;
|
|
||||||
case 4:
|
|
||||||
return ContinuationStyle.LeadingTrailingDash;
|
|
||||||
case 5:
|
|
||||||
return ContinuationStyle.LeadingTrailingDashDots;
|
|
||||||
default:
|
|
||||||
return ContinuationStyle.None;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetContinuationStylePreview(ContinuationStyle continuationStyle)
|
|
||||||
{
|
|
||||||
string line1 = "Lorem ipsum dolor sit amet\nconsectetur adipiscing elit";
|
|
||||||
string line2 = "donec eget turpis consequat\nturpis commodo hendrerit";
|
|
||||||
string line3 = "praesent vel velit rutrum tellus\npharetra tristique vel non orci";
|
|
||||||
string linePause = "(...)";
|
|
||||||
string line4 = "mauris mollis consectetur nibh,\nnec congue est viverra quis.";
|
|
||||||
|
|
||||||
switch (continuationStyle)
|
|
||||||
{
|
|
||||||
case ContinuationStyle.NoneLeadingTrailingDots:
|
|
||||||
return line1 + ",\n\n" + line2 + "\n\n" + line3 + "...\n\n" + linePause + "\n\n..." + line4;
|
|
||||||
case ContinuationStyle.OnlyTrailingDots:
|
|
||||||
return line1 + "...\n\n" + line2 + "...\n\n" + line3 + "...\n\n" + linePause + "\n\n" + line4;
|
|
||||||
case ContinuationStyle.LeadingTrailingDots:
|
|
||||||
return line1 + "...\n\n..." + line2 + "...\n\n..." + line3 + "...\n\n" + linePause + "\n\n..." + line4;
|
|
||||||
case ContinuationStyle.LeadingTrailingDash:
|
|
||||||
return line1 + " -\n\n- " + line2 + " -\n\n- " + line3 + " -\n\n" + linePause + "\n\n- " + line4;
|
|
||||||
case ContinuationStyle.LeadingTrailingDashDots:
|
|
||||||
return line1 + " -\n\n- " + line2 + " -\n\n- " + line3 + "...\n\n" + linePause + "\n\n..." + line4;
|
|
||||||
default:
|
|
||||||
return line1 + ",\n\n" + line2 + "\n\n" + line3 + "\n\n" + linePause + "\n\n" + line4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string GetStartTags(string input)
|
private static string GetStartTags(string input)
|
||||||
{
|
{
|
||||||
var pre = new StringBuilder();
|
var pre = new StringBuilder();
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
public enum ContinuationStyle
|
public enum ContinuationStyle
|
||||||
{
|
{
|
||||||
None,
|
None,
|
||||||
|
NoneTrailingDots,
|
||||||
NoneLeadingTrailingDots,
|
NoneLeadingTrailingDots,
|
||||||
OnlyTrailingDots,
|
OnlyTrailingDots,
|
||||||
LeadingTrailingDots,
|
LeadingTrailingDots,
|
||||||
|
@ -2262,6 +2262,7 @@ can edit in same subtitle file (collaboration)",
|
|||||||
DialogStyleDashSecondLineWithoutSpace = "Dash second line without space",
|
DialogStyleDashSecondLineWithoutSpace = "Dash second line without space",
|
||||||
ContinuationStyle = "Continuation style",
|
ContinuationStyle = "Continuation style",
|
||||||
ContinuationStyleNone = "None",
|
ContinuationStyleNone = "None",
|
||||||
|
ContinuationStyleNoneTrailingDots = "None, dots for pauses (trailing only)",
|
||||||
ContinuationStyleNoneLeadingTrailingDots = "None, dots for pauses",
|
ContinuationStyleNoneLeadingTrailingDots = "None, dots for pauses",
|
||||||
ContinuationStyleOnlyTrailingDots = "Dots (trailing only)",
|
ContinuationStyleOnlyTrailingDots = "Dots (trailing only)",
|
||||||
ContinuationStyleLeadingTrailingDots = "Dots",
|
ContinuationStyleLeadingTrailingDots = "Dots",
|
||||||
|
@ -5326,6 +5326,9 @@ namespace Nikse.SubtitleEdit.Core
|
|||||||
case "Settings/ContinuationStyleNone":
|
case "Settings/ContinuationStyleNone":
|
||||||
language.Settings.ContinuationStyleNone = reader.Value;
|
language.Settings.ContinuationStyleNone = reader.Value;
|
||||||
break;
|
break;
|
||||||
|
case "Settings/ContinuationStyleNoneTrailingDots":
|
||||||
|
language.Settings.ContinuationStyleNoneTrailingDots = reader.Value;
|
||||||
|
break;
|
||||||
case "Settings/ContinuationStyleNoneLeadingTrailingDots":
|
case "Settings/ContinuationStyleNoneLeadingTrailingDots":
|
||||||
language.Settings.ContinuationStyleNoneLeadingTrailingDots = reader.Value;
|
language.Settings.ContinuationStyleNoneLeadingTrailingDots = reader.Value;
|
||||||
break;
|
break;
|
||||||
|
@ -2133,6 +2133,7 @@
|
|||||||
public string DialogStyleDashSecondLineWithoutSpace { get; set; }
|
public string DialogStyleDashSecondLineWithoutSpace { get; set; }
|
||||||
public string ContinuationStyle { get; set; }
|
public string ContinuationStyle { get; set; }
|
||||||
public string ContinuationStyleNone { get; set; }
|
public string ContinuationStyleNone { get; set; }
|
||||||
|
public string ContinuationStyleNoneTrailingDots { get; set; }
|
||||||
public string ContinuationStyleNoneLeadingTrailingDots { get; set; }
|
public string ContinuationStyleNoneLeadingTrailingDots { get; set; }
|
||||||
public string ContinuationStyleOnlyTrailingDots { get; set; }
|
public string ContinuationStyleOnlyTrailingDots { get; set; }
|
||||||
public string ContinuationStyleLeadingTrailingDots { get; set; }
|
public string ContinuationStyleLeadingTrailingDots { get; set; }
|
||||||
|
@ -1020,7 +1020,7 @@ $HorzAlign = Center
|
|||||||
CpsIncludesSpace = true,
|
CpsIncludesSpace = true,
|
||||||
MinimumMillisecondsBetweenLines = 84, // 2 frames for 23.976 fps videos
|
MinimumMillisecondsBetweenLines = 84, // 2 frames for 23.976 fps videos
|
||||||
DialogStyle = DialogType.DashBothLinesWithoutSpace,
|
DialogStyle = DialogType.DashBothLinesWithoutSpace,
|
||||||
ContinuationStyle = ContinuationStyle.NoneLeadingTrailingDots
|
ContinuationStyle = ContinuationStyle.NoneTrailingDots
|
||||||
});
|
});
|
||||||
profiles.Add(new RulesProfile
|
profiles.Add(new RulesProfile
|
||||||
{
|
{
|
||||||
@ -1036,7 +1036,7 @@ $HorzAlign = Center
|
|||||||
CpsIncludesSpace = true,
|
CpsIncludesSpace = true,
|
||||||
MinimumMillisecondsBetweenLines = 84, // 2 frames for 23.976 fps videos
|
MinimumMillisecondsBetweenLines = 84, // 2 frames for 23.976 fps videos
|
||||||
DialogStyle = DialogType.DashBothLinesWithSpace,
|
DialogStyle = DialogType.DashBothLinesWithSpace,
|
||||||
ContinuationStyle = ContinuationStyle.NoneLeadingTrailingDots
|
ContinuationStyle = ContinuationStyle.NoneTrailingDots
|
||||||
});
|
});
|
||||||
profiles.Add(new RulesProfile
|
profiles.Add(new RulesProfile
|
||||||
{
|
{
|
||||||
|
@ -2871,13 +2871,18 @@ namespace Nikse.SubtitleEdit.Core
|
|||||||
// Remove single-char quotes from the ending
|
// Remove single-char quotes from the ending
|
||||||
if (quotes.Contains(checkString[checkString.Length - 1]))
|
if (quotes.Contains(checkString[checkString.Length - 1]))
|
||||||
{
|
{
|
||||||
if (singleQuotes.Contains(checkString[checkString.Length - 1]))
|
if (checkString[checkString.Length - 1] == '\'' && checkString.EndsWith("in'") && Char.IsLetter(checkString[checkString.Length - 4]))
|
||||||
{
|
{
|
||||||
// Could be something like: nothin'
|
// nothin' -- Don't remove
|
||||||
// TODO
|
}
|
||||||
|
else if (checkString[checkString.Length - 1] == '\'' && (checkString.EndsWith("déj'") || checkString.EndsWith("bon ap'") || checkString.EndsWith("bon app'")))
|
||||||
|
{
|
||||||
|
// déj' -- Don't remove
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
checkString = checkString.Substring(0, checkString.Length - 1).Trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
checkString = checkString.Substring(0, checkString.Length - 1).Trim();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove double-char quotes from the ending
|
// Remove double-char quotes from the ending
|
||||||
@ -3292,6 +3297,8 @@ namespace Nikse.SubtitleEdit.Core
|
|||||||
{
|
{
|
||||||
switch (continuationStyle)
|
switch (continuationStyle)
|
||||||
{
|
{
|
||||||
|
case ContinuationStyle.NoneTrailingDots:
|
||||||
|
return Configuration.Settings.Language.Settings.ContinuationStyleNoneTrailingDots;
|
||||||
case ContinuationStyle.NoneLeadingTrailingDots:
|
case ContinuationStyle.NoneLeadingTrailingDots:
|
||||||
return Configuration.Settings.Language.Settings.ContinuationStyleNoneLeadingTrailingDots;
|
return Configuration.Settings.Language.Settings.ContinuationStyleNoneLeadingTrailingDots;
|
||||||
case ContinuationStyle.OnlyTrailingDots:
|
case ContinuationStyle.OnlyTrailingDots:
|
||||||
@ -3307,10 +3314,84 @@ namespace Nikse.SubtitleEdit.Core
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int GetIndexFromContinuationStyle(ContinuationStyle continuationStyle)
|
||||||
|
{
|
||||||
|
switch (continuationStyle)
|
||||||
|
{
|
||||||
|
case ContinuationStyle.NoneTrailingDots:
|
||||||
|
return 1;
|
||||||
|
case ContinuationStyle.NoneLeadingTrailingDots:
|
||||||
|
return 2;
|
||||||
|
case ContinuationStyle.OnlyTrailingDots:
|
||||||
|
return 3;
|
||||||
|
case ContinuationStyle.LeadingTrailingDots:
|
||||||
|
return 4;
|
||||||
|
case ContinuationStyle.LeadingTrailingDash:
|
||||||
|
return 5;
|
||||||
|
case ContinuationStyle.LeadingTrailingDashDots:
|
||||||
|
return 6;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ContinuationStyle GetContinuationStyleFromIndex(int index)
|
||||||
|
{
|
||||||
|
switch (index)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
return ContinuationStyle.NoneTrailingDots;
|
||||||
|
case 2:
|
||||||
|
return ContinuationStyle.NoneLeadingTrailingDots;
|
||||||
|
case 3:
|
||||||
|
return ContinuationStyle.OnlyTrailingDots;
|
||||||
|
case 4:
|
||||||
|
return ContinuationStyle.LeadingTrailingDots;
|
||||||
|
case 5:
|
||||||
|
return ContinuationStyle.LeadingTrailingDash;
|
||||||
|
case 6:
|
||||||
|
return ContinuationStyle.LeadingTrailingDashDots;
|
||||||
|
default:
|
||||||
|
return ContinuationStyle.None;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string GetContinuationStylePreview(ContinuationStyle continuationStyle)
|
||||||
|
{
|
||||||
|
string line1 = "Lorem ipsum dolor sit amet\nconsectetur adipiscing elit";
|
||||||
|
string line2 = "donec eget turpis consequat\nturpis commodo hendrerit";
|
||||||
|
string line3 = "praesent vel velit rutrum tellus\npharetra tristique vel non orci";
|
||||||
|
string linePause = "(...)";
|
||||||
|
string line4 = "mauris mollis consectetur nibh,\nnec congue est viverra quis.";
|
||||||
|
|
||||||
|
var profile = GetContinuationProfile(continuationStyle);
|
||||||
|
|
||||||
|
return AddSuffixIfNeeded(line1, profile, false) + "\n\n"
|
||||||
|
+ AddSuffixIfNeeded(AddPrefixIfNeeded(line2, profile, false), profile, false) + "\n\n"
|
||||||
|
+ AddSuffixIfNeeded(AddPrefixIfNeeded(line3, profile, false), profile, true) + "\n\n"
|
||||||
|
+ linePause + "\n\n"
|
||||||
|
+ AddPrefixIfNeeded(line4, profile, false);
|
||||||
|
}
|
||||||
|
|
||||||
public static ContinuationProfile GetContinuationProfile(ContinuationStyle continuationStyle)
|
public static ContinuationProfile GetContinuationProfile(ContinuationStyle continuationStyle)
|
||||||
{
|
{
|
||||||
switch (continuationStyle)
|
switch (continuationStyle)
|
||||||
{
|
{
|
||||||
|
case ContinuationStyle.NoneTrailingDots:
|
||||||
|
return new ContinuationProfile
|
||||||
|
{
|
||||||
|
Suffix = "",
|
||||||
|
SuffixAddSpace = false,
|
||||||
|
SuffixReplaceComma = false,
|
||||||
|
Prefix = "",
|
||||||
|
PrefixAddSpace = false,
|
||||||
|
UseDifferentStyleGap = true,
|
||||||
|
GapSuffix = "...",
|
||||||
|
GapSuffixAddSpace = false,
|
||||||
|
GapSuffixReplaceComma = true,
|
||||||
|
GapPrefix = "",
|
||||||
|
GapPrefixAddSpace = false
|
||||||
|
};
|
||||||
case ContinuationStyle.NoneLeadingTrailingDots:
|
case ContinuationStyle.NoneLeadingTrailingDots:
|
||||||
return new ContinuationProfile
|
return new ContinuationProfile
|
||||||
{
|
{
|
||||||
|
@ -998,6 +998,7 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
{
|
{
|
||||||
comboBoxContinuationStyle.Items.Clear();
|
comboBoxContinuationStyle.Items.Clear();
|
||||||
comboBoxContinuationStyle.Items.Add(Configuration.Settings.Language.Settings.ContinuationStyleNone);
|
comboBoxContinuationStyle.Items.Add(Configuration.Settings.Language.Settings.ContinuationStyleNone);
|
||||||
|
comboBoxContinuationStyle.Items.Add(Configuration.Settings.Language.Settings.ContinuationStyleNoneTrailingDots);
|
||||||
comboBoxContinuationStyle.Items.Add(Configuration.Settings.Language.Settings.ContinuationStyleNoneLeadingTrailingDots);
|
comboBoxContinuationStyle.Items.Add(Configuration.Settings.Language.Settings.ContinuationStyleNoneLeadingTrailingDots);
|
||||||
comboBoxContinuationStyle.Items.Add(Configuration.Settings.Language.Settings.ContinuationStyleOnlyTrailingDots);
|
comboBoxContinuationStyle.Items.Add(Configuration.Settings.Language.Settings.ContinuationStyleOnlyTrailingDots);
|
||||||
comboBoxContinuationStyle.Items.Add(Configuration.Settings.Language.Settings.ContinuationStyleLeadingTrailingDots);
|
comboBoxContinuationStyle.Items.Add(Configuration.Settings.Language.Settings.ContinuationStyleLeadingTrailingDots);
|
||||||
@ -1005,28 +1006,8 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
comboBoxContinuationStyle.Items.Add(Configuration.Settings.Language.Settings.ContinuationStyleLeadingTrailingDashDots);
|
comboBoxContinuationStyle.Items.Add(Configuration.Settings.Language.Settings.ContinuationStyleLeadingTrailingDashDots);
|
||||||
comboBoxContinuationStyle.SelectedIndex = 0;
|
comboBoxContinuationStyle.SelectedIndex = 0;
|
||||||
toolTipContinuationPreview.RemoveAll();
|
toolTipContinuationPreview.RemoveAll();
|
||||||
toolTipContinuationPreview.SetToolTip(comboBoxContinuationStyle, DialogSplitMerge.GetContinuationStylePreview(continuationStyle));
|
toolTipContinuationPreview.SetToolTip(comboBoxContinuationStyle, ContinuationUtilities.GetContinuationStylePreview(continuationStyle));
|
||||||
switch (continuationStyle)
|
comboBoxContinuationStyle.SelectedIndex = ContinuationUtilities.GetIndexFromContinuationStyle(continuationStyle);
|
||||||
{
|
|
||||||
case ContinuationStyle.None:
|
|
||||||
comboBoxContinuationStyle.SelectedIndex = 0;
|
|
||||||
break;
|
|
||||||
case ContinuationStyle.NoneLeadingTrailingDots:
|
|
||||||
comboBoxContinuationStyle.SelectedIndex = 1;
|
|
||||||
break;
|
|
||||||
case ContinuationStyle.OnlyTrailingDots:
|
|
||||||
comboBoxContinuationStyle.SelectedIndex = 2;
|
|
||||||
break;
|
|
||||||
case ContinuationStyle.LeadingTrailingDots:
|
|
||||||
comboBoxContinuationStyle.SelectedIndex = 3;
|
|
||||||
break;
|
|
||||||
case ContinuationStyle.LeadingTrailingDash:
|
|
||||||
comboBoxContinuationStyle.SelectedIndex = 4;
|
|
||||||
break;
|
|
||||||
case ContinuationStyle.LeadingTrailingDashDots:
|
|
||||||
comboBoxContinuationStyle.SelectedIndex = 5;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Guid _oldProfileId = Guid.Empty;
|
private Guid _oldProfileId = Guid.Empty;
|
||||||
@ -1733,7 +1714,7 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
}
|
}
|
||||||
|
|
||||||
gs.DialogStyle = DialogSplitMerge.GetDialogStyleFromIndex(comboBoxDialogStyle.SelectedIndex);
|
gs.DialogStyle = DialogSplitMerge.GetDialogStyleFromIndex(comboBoxDialogStyle.SelectedIndex);
|
||||||
gs.ContinuationStyle = DialogSplitMerge.GetContinuationStyleFromIndex(comboBoxContinuationStyle.SelectedIndex);
|
gs.ContinuationStyle = ContinuationUtilities.GetContinuationStyleFromIndex(comboBoxContinuationStyle.SelectedIndex);
|
||||||
|
|
||||||
toolsSettings.MusicSymbol = comboBoxToolsMusicSymbol.SelectedItem.ToString();
|
toolsSettings.MusicSymbol = comboBoxToolsMusicSymbol.SelectedItem.ToString();
|
||||||
toolsSettings.MusicSymbolReplace = textBoxMusicSymbolsToReplace.Text;
|
toolsSettings.MusicSymbolReplace = textBoxMusicSymbolsToReplace.Text;
|
||||||
@ -3231,10 +3212,10 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
_rulesProfiles[idx].CpsIncludesSpace = checkBoxCpsIncludeWhiteSpace.Checked;
|
_rulesProfiles[idx].CpsIncludesSpace = checkBoxCpsIncludeWhiteSpace.Checked;
|
||||||
_rulesProfiles[idx].MergeLinesShorterThan = comboBoxMergeShortLineLength.SelectedIndex + 5;
|
_rulesProfiles[idx].MergeLinesShorterThan = comboBoxMergeShortLineLength.SelectedIndex + 5;
|
||||||
_rulesProfiles[idx].DialogStyle = DialogSplitMerge.GetDialogStyleFromIndex(comboBoxDialogStyle.SelectedIndex);
|
_rulesProfiles[idx].DialogStyle = DialogSplitMerge.GetDialogStyleFromIndex(comboBoxDialogStyle.SelectedIndex);
|
||||||
_rulesProfiles[idx].ContinuationStyle = DialogSplitMerge.GetContinuationStyleFromIndex(comboBoxContinuationStyle.SelectedIndex);
|
_rulesProfiles[idx].ContinuationStyle = ContinuationUtilities.GetContinuationStyleFromIndex(comboBoxContinuationStyle.SelectedIndex);
|
||||||
|
|
||||||
toolTipContinuationPreview.RemoveAll();
|
toolTipContinuationPreview.RemoveAll();
|
||||||
toolTipContinuationPreview.SetToolTip(comboBoxContinuationStyle, DialogSplitMerge.GetContinuationStylePreview(_rulesProfiles[idx].ContinuationStyle));
|
toolTipContinuationPreview.SetToolTip(comboBoxContinuationStyle, ContinuationUtilities.GetContinuationStylePreview(_rulesProfiles[idx].ContinuationStyle));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkBoxToolsBreakByPixelWidth_CheckedChanged(object sender, EventArgs e)
|
private void checkBoxToolsBreakByPixelWidth_CheckedChanged(object sender, EventArgs e)
|
||||||
|
@ -196,11 +196,11 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
RulesProfiles[idx].CpsIncludesSpace = checkBoxCpsIncludeWhiteSpace.Checked;
|
RulesProfiles[idx].CpsIncludesSpace = checkBoxCpsIncludeWhiteSpace.Checked;
|
||||||
RulesProfiles[idx].MergeLinesShorterThan = comboBoxMergeShortLineLength.SelectedIndex + 10;
|
RulesProfiles[idx].MergeLinesShorterThan = comboBoxMergeShortLineLength.SelectedIndex + 10;
|
||||||
RulesProfiles[idx].DialogStyle = DialogSplitMerge.GetDialogStyleFromIndex(comboBoxDialogStyle.SelectedIndex);
|
RulesProfiles[idx].DialogStyle = DialogSplitMerge.GetDialogStyleFromIndex(comboBoxDialogStyle.SelectedIndex);
|
||||||
RulesProfiles[idx].ContinuationStyle = DialogSplitMerge.GetContinuationStyleFromIndex(comboBoxContinuationStyle.SelectedIndex);
|
RulesProfiles[idx].ContinuationStyle = ContinuationUtilities.GetContinuationStyleFromIndex(comboBoxContinuationStyle.SelectedIndex);
|
||||||
UpdateRulesProfilesLine(idx);
|
UpdateRulesProfilesLine(idx);
|
||||||
|
|
||||||
toolTipContinuationPreview.RemoveAll();
|
toolTipContinuationPreview.RemoveAll();
|
||||||
toolTipContinuationPreview.SetToolTip(comboBoxContinuationStyle, DialogSplitMerge.GetContinuationStylePreview(RulesProfiles[idx].ContinuationStyle));
|
toolTipContinuationPreview.SetToolTip(comboBoxContinuationStyle, ContinuationUtilities.GetContinuationStylePreview(RulesProfiles[idx].ContinuationStyle));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void listViewProfiles_SelectedIndexChanged(object sender, EventArgs e)
|
private void listViewProfiles_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
@ -286,6 +286,7 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
|
|
||||||
comboBoxContinuationStyle.Items.Clear();
|
comboBoxContinuationStyle.Items.Clear();
|
||||||
comboBoxContinuationStyle.Items.Add(Configuration.Settings.Language.Settings.ContinuationStyleNone);
|
comboBoxContinuationStyle.Items.Add(Configuration.Settings.Language.Settings.ContinuationStyleNone);
|
||||||
|
comboBoxContinuationStyle.Items.Add(Configuration.Settings.Language.Settings.ContinuationStyleNoneTrailingDots);
|
||||||
comboBoxContinuationStyle.Items.Add(Configuration.Settings.Language.Settings.ContinuationStyleNoneLeadingTrailingDots);
|
comboBoxContinuationStyle.Items.Add(Configuration.Settings.Language.Settings.ContinuationStyleNoneLeadingTrailingDots);
|
||||||
comboBoxContinuationStyle.Items.Add(Configuration.Settings.Language.Settings.ContinuationStyleOnlyTrailingDots);
|
comboBoxContinuationStyle.Items.Add(Configuration.Settings.Language.Settings.ContinuationStyleOnlyTrailingDots);
|
||||||
comboBoxContinuationStyle.Items.Add(Configuration.Settings.Language.Settings.ContinuationStyleLeadingTrailingDots);
|
comboBoxContinuationStyle.Items.Add(Configuration.Settings.Language.Settings.ContinuationStyleLeadingTrailingDots);
|
||||||
@ -293,30 +294,8 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
comboBoxContinuationStyle.Items.Add(Configuration.Settings.Language.Settings.ContinuationStyleLeadingTrailingDashDots);
|
comboBoxContinuationStyle.Items.Add(Configuration.Settings.Language.Settings.ContinuationStyleLeadingTrailingDashDots);
|
||||||
comboBoxContinuationStyle.SelectedIndex = 0;
|
comboBoxContinuationStyle.SelectedIndex = 0;
|
||||||
toolTipContinuationPreview.RemoveAll();
|
toolTipContinuationPreview.RemoveAll();
|
||||||
toolTipContinuationPreview.SetToolTip(comboBoxContinuationStyle, DialogSplitMerge.GetContinuationStylePreview(RulesProfiles[idx].ContinuationStyle));
|
toolTipContinuationPreview.SetToolTip(comboBoxContinuationStyle, ContinuationUtilities.GetContinuationStylePreview(RulesProfiles[idx].ContinuationStyle));
|
||||||
switch (RulesProfiles[idx].ContinuationStyle)
|
comboBoxContinuationStyle.SelectedIndex = ContinuationUtilities.GetIndexFromContinuationStyle(RulesProfiles[idx].ContinuationStyle);
|
||||||
{
|
|
||||||
case ContinuationStyle.None:
|
|
||||||
comboBoxContinuationStyle.SelectedIndex = 0;
|
|
||||||
break;
|
|
||||||
case ContinuationStyle.NoneLeadingTrailingDots:
|
|
||||||
comboBoxContinuationStyle.SelectedIndex = 1;
|
|
||||||
break;
|
|
||||||
case ContinuationStyle.OnlyTrailingDots:
|
|
||||||
comboBoxContinuationStyle.SelectedIndex = 2;
|
|
||||||
break;
|
|
||||||
case ContinuationStyle.LeadingTrailingDots:
|
|
||||||
comboBoxContinuationStyle.SelectedIndex = 3;
|
|
||||||
break;
|
|
||||||
case ContinuationStyle.LeadingTrailingDash:
|
|
||||||
comboBoxContinuationStyle.SelectedIndex = 4;
|
|
||||||
break;
|
|
||||||
case ContinuationStyle.LeadingTrailingDashDots:
|
|
||||||
comboBoxContinuationStyle.SelectedIndex = 5;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new ArgumentOutOfRangeException();
|
|
||||||
}
|
|
||||||
|
|
||||||
_editOn = oldEditOn;
|
_editOn = oldEditOn;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user