| Summary: | After filtering, next/prev/first/last entry remain disabled even if the current entry is no longer on the edge of the new filtered list | ||
|---|---|---|---|
| Product: | [Applications] lokalize | Reporter: | Kisaragi Hiu <mail> |
| Component: | editor | Assignee: | Finley Watson <fin-w> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | aacid, sdepiets, shafff |
| Priority: | NOR | ||
| Version First Reported In: | 25.08.0 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/sdk/lokalize/-/commit/a1fd780b719dbd460d6aef07607808423c89e27c | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
|
Description
Kisaragi Hiu
2025-08-18 17:31:42 UTC
Git commit a1fd780b719dbd460d6aef07607808423c89e27c by Kisaragi Hiu. Committed on 29/08/2025 at 10:43. Pushed by moonlight into branch 'master'. Fix changing catalog filter/sort leaving some navigation actions disabled When reaching the first entry in the catalog view (translation units list), the Previous Entry and First Entry actions become disabled. And when navigating to another entry, they become enabled again if the selected entry is not the first entry. But this is not the only way the currently selected entry could stop being the first entry. The other ways are: 1. If the filter text is changed, the currently selected entry would most likely stop being the first entry in the list, but the actions are not updated to reflect that. 2. The filter options could also be updated. 3. The sort method and order could also be updated. 4. dynamicSortFilter could be turned on, then when sorting by msgstr and the msgstr is changed the same could also happen. Before this change, these would all cause the Previous Entry and First Entry actions to remain disabled even though there are now entries before the current one. (The same is also true for the Next Entry and Last Entry actions when reaching the last entry.) Additionally, the actions would also not be disabled properly when there are no entries matching the current filter. --- This commit addresses each of the cases: - (1, 2, 4) Filter text and filter option changing, as well as msgstr changing while dynamicSortFilter is on, are all addressed by connecting CatalogTreeFilterModel::rowsInserted and CatalogTreeFilterModel::rowsRemoved to a new signal, CatalogView::entryProxiedPositionChanged. - Then this signal is hooked up in EditorTab to call a new function, EditorTab::updateFirstOrLastDisplayed, to check and signal to the actions whether to be disabled or enabled. (The existing place where this was previously done in EditorTab::gotoEntry is modified to use this function.) - (3) The sort method and order changing are addressed by emitting the above signal on CatalogTreeFilterModel::layoutChanged. - Disabling the actions when there are no entries matching the current filter is done within the new EditorTab::updateFirstOrLastDisplayed. This should address all cases (as far as I know) where Next Entry / Previous Entry (and First/Last Entry) mysteriously stop working after changing filtering/sort options. M +9 -0 src/cataloglistview/cataloglistview.cpp M +2 -0 src/cataloglistview/cataloglistview.h M +19 -2 src/editortab.cpp M +2 -0 src/editortab.h https://invent.kde.org/sdk/lokalize/-/commit/a1fd780b719dbd460d6aef07607808423c89e27c |