diff --git a/Changelog.txt b/Changelog.txt index ab6a68d9a..7b767cc80 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -5,6 +5,7 @@ * Add Whisper CPP model "small.en-q5_1.bin" * Add shortcut for "Translate selected lines" * Add Gemini translate (beta, not all regions) - thx darnn + * Add sorting of rules in "Multiple replace" - thx caioeverest * IMPROVED: * Update Korean translation - thx domddol * Update Portuguese translation - thx hugok79 diff --git a/src/ui/Forms/MultipleReplace.cs b/src/ui/Forms/MultipleReplace.cs index af85b216a..b2c1a0700 100644 --- a/src/ui/Forms/MultipleReplace.cs +++ b/src/ui/Forms/MultipleReplace.cs @@ -31,6 +31,7 @@ namespace Nikse.SubtitleEdit.Forms private Subtitle _subtitle; private IReloadSubtitle _reloadSubtitle; private Subtitle _original; + private bool _sortAscending; public Subtitle FixedSubtitle { get; private set; } public int FixCount { get; private set; } public List DeleteIndices { get; } @@ -1536,7 +1537,9 @@ namespace Nikse.SubtitleEdit.Forms private void SortItems(int column) { - var items = new List(); + List items; + + _sortAscending = !_sortAscending; switch (column) { @@ -1548,6 +1551,11 @@ namespace Nikse.SubtitleEdit.Forms default: items = _currentGroup.Rules.OrderBy(i => i.FindWhat).ToList(); break; } + if (!_sortAscending) + { + items.Reverse(); + } + _currentGroup.Rules.Clear(); _currentGroup.Rules.AddRange(items); UpdateViewFromModel(Configuration.Settings.MultipleSearchAndReplaceGroups, _currentGroup);