It's wrong to check the status of the plasmoid before closing it,
since the status is just the internal state of the plasmoid and
it's changed by actions from the plasmoid itself. So, the Passive
status doesn't indicate that the plasmoid is hidden in the system
tray, because the user can configure to always show this plasmoid.
The notification applet's config window is blank, and only shows the
auto-generated Shortcuts and About pages. This makes it not very useful,
as typically the user will want to get to the KCM instead. Other
applets with blank config windows (such as the Bluetooth and Networks
applets) make the configure button open the KCM instead and nobody has
complained about it, so let's do the same for the Notifications applet.
This has two advantages:
1. Greater consistency among applets
2. The "Clear all" action always appears visibly in the header without
getting pushed into a hamburger menu
3. A cleaner UI than the one merged in
https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/837
BUG: 433140
FIXED-IN: 5.22
This reverts commit 5893574163.
The approach taken in this commit was sub-optimal and not consistent
with what we do for other applets, so it needs to be re-thought.
The fact that the commonly-used "Clear History" action appears in a
hamburger menu has been a common user complaint about Plasma 5.21.
This happens because it's defined as an action, and the applet has two
actions ("clear history" and "open KCM") and when there is more than
one action, they all go into a hamburger menu. This makes the
commonly-used clear action more difficult to find that necessary.
A reasonable long-term solution would be to refactor the action
visibility code in plasma-framework to allow the display of more than
one action in the header without always putting them all in a hamburger
menu, or allowing the developer more control over this. However since
that would require frameworks changes, it can't be done in Plasma 5.22
because 5.22 requires Frameworks 5.82 which has already been tagged. So
let's do this simpler fix for now to fix the UX regression.
BUG: 433140
FIXED-IN: 5.22
There is no conceivable use case for turning this off, and the UI is
being removed in https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/447.
So let's remove the backend code too, or else anyone who for some reason
had turned it off would be left without a GUI method of turning it back
on again.
We ported units to use the PlasmaCore.Units singleton earlier; now it's
time to do the same thing for PlasmaCore.Theme.
There are no UI changes or regressions detected.
This allows a client to mark a notification as "resident" which means it will
not be closed by the sever when expired or an action is invoked, thus transferring
full control over notification life time to the client.
A notification popup still times out as normal (unless persistent, of course)
but the notification remains alive until the client revokes it or a user
explicitly closes it.
It is opt-in so that a client can expect the notification lifetime to be
indefinite and explicitly close it when an action is invoked on its end.
For example, show "Open with Gwenview" with its icon after downloading
an image file, and "Open with..." in case there is no associated application.
While at it also give an icon to the "Open Containing Folder" button.
Also, port it to use a `KIO::mimetypeJob` to make it asynchronous
and work on remote locations. To make for a less jarring transition (icon suddenly
appearing, causing text reflow and the dialog to resize), take an initial
guess about the mimetype using the file extension while the job is running.
Furthermore, hide the "Open" actions in case the job fails which likely means
the file doesn't exist anymore or cannot be accessed, and as as result
probably cannot be opened anyway.
The context property version is slower to access and won't be supported
in Qt6. Let's port away from it and use the singleton version instead.
Here was my full process for making this change:
1. Made the change with `find . -name '*.qml' | xargs perl -pi -e 's/units\./PlasmaCore\.Units\./g'`
2. Verified no more occurrences with `grep -r " units."`
3. Made sure this didn't change any comments in a silly way by inspecting the output of `git diff | grep "+ " | grep "//"`
4. Manually inspected the full git diff to make sure there were no other unintentional or silly changes (there were none)
5. verified that all changed files have the PlasmaCore import with the correct name with `for FILE in `git status | grep modified | cut -d ":" -f 3`; do grep -q "as PlasmaCore" $FILE || echo "$FILE needs the PlasmaCore import"; done`
The restriction on having an amount of files to be processed was to avoid
showing whatever last file had been copied as destination.
However, we already only fall back to using the "destination" label contents
when there is a single file (cf. `NotificationManager::JobPrivate::destUrl()`),
making it safe to assume destUrl is always a predicatble/useful location.
CCBUG: 408778
Ensures built-in functionality like double- and triple-clicking text works.
Also lets us get rid of the custom text selection handling, replacing it with
an even filter class.
BUG: 431398
FIXED-IN: 5.22.0
For some reason beyond me when all elements in the JobItem turn invisible,
e.g. when a job finishes (its progress bar hideS), and there are no action
buttons (e.g. when a job fails), the Loader does not collapse properly.
I find it weird that when I've just trashed some files - presumably to get rid
of them - it then offers me to open that file or the trash folder once done.
I've seen popup being null when spamming notification removal.
Perhaps when the model already yanked the item under us before the Instantiator
had a chance to update its count... Not sure about the implications, but it
silences a warning I observed.
Qt 5.14 introduced new restoreMode mandatory property. Fix warnings like this one:
QML Binding: Not restoring previous value because restoreMode has not been set.
To provide some more direct feedback that the job is paused and an easy to spot
place to click to resume.
I chose to check the button instead of changing the icon like is done in Media
Controller for more visual feedback. A job is also seldom paused so having it
more obvious when it is the case aids the user better.
Qt 5.15 introduced new syntax for defining Connections. Fix warnings like this one:
QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }