Summary:
this broke somewhat recently. the new availabletranslationsmodel's
rowcount is always 0 on a completely fresh system with no language
preference set. this is because the actual available languages list is
only compiled in its ::setSelectedLanguages function. this function was
however never called. this resulted in the kcm thinking there are no
available languages and thus making it impossible to actually add one by
disabling the button and having an empty view even if the button wasn't
disabled.
previously this was a single model, from what I can see, and that was
incorrectly ported. where previously the setSelectedLanguages was only
called on one model we now need to call it on all models to properly
propagate the language information.
(the reason it works this way is because available languages kinda need to
include already selected languages for consistency; even when the kcm
technically didn't find them available)
Test Plan:
- make new user
- start kcm
- kcm DOES NOT show infobox 'no languages installed' and the add languages button is enabled
- clicking the button gives a list of languages
- adding one works as well
Reviewers: sitter
Subscribers: ngraham, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D15115
Summary:
This makes the list items draggable.
To do this, the backend model was split up into three models so
the move() method could actually move a row as the new drag handle
expects. This also makes move and remove actions a little bit
faster since there's no proxy abstractions involved. The use of
Plasma.SortFilterModel with JS callbacks for filtering has been
dropped from the QML code.
The lists now use DelegateRecycler to be speedier.
The list of available languages is now guaranteed to be sorted in
a locale-aware manner and case-insensitively, using QCollator.
This likely works better than whatever PSFM was doing with the
Qt::DisplayRole sort role before.
Also drops a stray unused KConfigGroup member from
TranslationsModel.
Reviewers: mart, davidedmundson
Reviewed By: mart
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D13194
Summary:
* Changed the overall design from two lists to one list with a modal
sheet to add more languages.
* Replaced a modal "You need to relogin for changes" dialog with a
MessageType.Positive InlineMessage.
* Reworked the way missing languages are handled: The old KCM silently
rewrote config and showed a warning. The new design shows an
informative warning and removes the missing languages on the next
save. Until then they're flagged as missing in the list.
* Manages Apply button state correctly (or rather at all ...).
This depends on D12097.
This implements T7247.
This is currently not final code. It's a WIP upload to give Marco
something to work with to fix various Kirigami and SimpleKCM problems.
Currently known issues:
* Does not save (code is from old KCM, might have been broken there)
* Disabled SwipeListItem actions do not show disabled
* Placement of actions button in SwipeListItem is wonky if the
contentItem is a RowLayout
* SwipeListItem spews errors about positionAnimation after using an
action
* SwipeListItem is awkward to use, we need a drag-reorderable list
delegate
* OverlaySheet spews numerous warnings about not being able to find
applicationWindow and activeFocusItem
* The sheet is parented to the SimpleKCM's parent since there's no
app window to be modal too
* The footer inside an OverlaySheet sometimes moves up above the
content instead of staying down
* Even though SimpleKCM is just a Kirigami.ScrollablePage like
Kirigami Gallery pages, an InlineMessage that fills the page width
gets cut off on the left and right, so wonky code to insert margins
next to them
* List has window bg color as background instead of view background
color
Reviewers: #kirigami, mart
Subscribers: rkflx, aspotashev, davidedmundson, safaalfulaij, abetts, ngraham, plasma-devel
Tags: #plasma, #kirigami
Differential Revision: https://phabricator.kde.org/D12102
Summary:
* Changed the overall design from two lists to one list with a modal
sheet to add more languages.
* Replaced a modal "You need to relogin for changes" dialog with a
MessageType.Positive InlineMessage.
* Reworked the way missing languages are handled: The old KCM silently
rewrote config and showed a warning. The new design shows an
informative warning and removes the missing languages on the next
save. Until then they're flagged as missing in the list.
* Manages Apply button state correctly (or rather at all ...).
This depends on D12097.
This implements T7247.
This is currently not final code. It's a WIP upload to give Marco
something to work with to fix various Kirigami and SimpleKCM problems.
Currently known issues:
* Does not save (code is from old KCM, might have been broken there)
* Disabled SwipeListItem actions do not show disabled
* Placement of actions button in SwipeListItem is wonky if the
contentItem is a RowLayout
* SwipeListItem spews errors about positionAnimation after using an
action
* SwipeListItem is awkward to use, we need a drag-reorderable list
delegate
* OverlaySheet spews numerous warnings about not being able to find
applicationWindow and activeFocusItem
* The sheet is parented to the SimpleKCM's parent since there's no
app window to be modal too
* The footer inside an OverlaySheet sometimes moves up above the
content instead of staying down
* Even though SimpleKCM is just a Kirigami.ScrollablePage like
Kirigami Gallery pages, an InlineMessage that fills the page width
gets cut off on the left and right, so wonky code to insert margins
next to them
* List has window bg color as background instead of view background
color
Reviewers: #kirigami, mart
Subscribers: plasma-devel
Tags: #plasma, #kirigami
Differential Revision: https://phabricator.kde.org/D12102