Commit graph

105 commits

Author SHA1 Message Date
Ivailo Monev
2bfcabb4a4 kdeui: remove unused header inclusion
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-24 13:31:59 +03:00
Ivailo Monev
f9d58bcec1 kdeui: send notifications to plasma-windowed from KNotificationManager
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-24 13:30:03 +03:00
Ivailo Monev
704967c1b7 kdeui: remove unused KPlasmaJobTracker and KNotification data
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-30 06:42:36 +03:00
Ivailo Monev
a613f682f9 kdeui: correct connection in KNotificationManager::send()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-29 06:11:18 +03:00
Ivailo Monev
8869b0c019 kdeui: do not send configurable data from KNotification
it can safely be assumed that events send via KNotification are
configurable now

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-08 20:04:18 +03:00
Ivailo Monev
4b1f8441b9 kdeui: update KNotification documentation
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-08 19:59:29 +03:00
Ivailo Monev
a4724b9d3a kdeui: do not send timeout data to the plasma applet
it is not matter of timeout, it is matter of the KNotification instance
being around for the actions. once it is not the notification actions
become non-operational. other than that notification stay indefinetly
in the notification area

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-08 19:50:02 +03:00
Ivailo Monev
99b8103de8 kdeui: cache some KNotification string objects
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-08 13:04:23 +03:00
Ivailo Monev
c46a4464b5 kdeui: break once notification is found in KNotificationManager
assuming pointers to KNotification are unique then there should be only
one entry

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-08 12:56:42 +03:00
Ivailo Monev
0ac04f8e9f kdeui: rework notification to use custom interface
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-08 10:15:29 +03:00
Ivailo Monev
75b9cfddd3 generic: const-ify private data pointers where copying is disabled
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-03-23 06:49:59 +02:00
Ivailo Monev
3ce3fcf34b kdeui: drop KNotificationRestrictions class
most of the functionality is not implemented, the rest can be done via
Solid::PowerManagement::beginSuppressingScreenPowerManagement() and
Solid::PowerManagement::stopSuppressingScreenPowerManagement()

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-03-22 13:53:40 +02:00
Ivailo Monev
095fd83c9b kdeui: increase automatic KNotification close delay to 1sec
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-03-15 05:27:18 +02:00
Ivailo Monev
20c1130788 kdeui: clear pending changes from KNotificationConfigWidget::setNotification()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-03-15 00:14:13 +02:00
Ivailo Monev
fbfb374b9c generic: drop scripting and tray support
after changes to multiple sub-projects (Katie, kdelibs, kde-workspace
and kde-extraapps) that finally happened, can write lots about it but I
will keep it short - by rewriting parts that were using js/qml (e.g. the
plasma applets) the desktop startup was reduced to half, also the legacy
tray thing shall be no more (anything that needs tray icon shall be a
plasma applet now) thus some applications and features will be dropped
aswell. see all repositories for the changes done

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-10-21 08:06:58 +03:00
Ivailo Monev
bc8e0c451e kdeui: fix KNotification sound notification feature
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-19 19:53:55 +03:00
Ivailo Monev
dd88037d22 kdeui: resize all but the first KNotificationConfigWidget column to its contents
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-01 18:01:07 +03:00
Ivailo Monev
6ed94914fe generic: get QImage and QPixmap objects width and height via the specialized methods
QImage::size() and QPixmap::size() construct QSize object from the internal
width and height members

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-30 03:45:25 +03:00
Ivailo Monev
cc6903476e kdecore: new KDirWatch methods to get and set the poll interval
requires the following commit from the Katie repo:
4795a577bff4f9db89c77195df763575a602bcc3

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-28 20:58:06 +03:00
Ivailo Monev
8703b0b0d5 kdeui: plug KNotificationManager memory leak
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-28 19:48:24 +03:00
Ivailo Monev
d6e335dbc6 kdeui: watch the notification configs for changes and lock KNotificationManager for thread-safety
in the old implementation KNotificationManager was not locked but it is
global static so it is subject to thread-safety issues thus it has to be
mutex-locked

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-28 19:41:37 +03:00
Ivailo Monev
bdd45bac0e kdeui: filter sound files with unknown extension in KNotificationConfigWidget::setNotification()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-28 19:08:35 +03:00
Ivailo Monev
e99b1b6e32 kdeui: round-trip to the event loop from KNotification::event() again
compat for ksmserver..

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-27 02:03:29 +03:00
Ivailo Monev
eef26737e5 kdeui: use the global group comment as application name for the notification
questionable but the old implementation was doing it, as for why it is
questionable - it is more like a description rather than application name
(e.g. "Crash notifier" rather than "kcrash")

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-27 01:20:16 +03:00
Ivailo Monev
ed513261b3 kdeui: correct x-kde-appname notification hint
while in most cases it is the same as the main component name the always
correct value (now anyway) is the main group which is part of the event ID

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-27 01:05:14 +03:00
Ivailo Monev
2c0a265496 kdeui: set initial size for the KNotificationConfigWidget dialog
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-26 22:08:56 +03:00
Ivailo Monev
bd07b86156 kdeui: do not return the created KNotification from KNotification::event()
to prevent stupidity, fixing issues is piece of cake when compatibility is
not concern

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-26 20:55:22 +03:00
Ivailo Monev
288d07c31d kdeui: delay the automatic deletion of non-persistent notifications by 500ms
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-26 20:41:03 +03:00
Ivailo Monev
95d6bcb64b kdeui: const-ify variable in KNotificationConfigWidget::save()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-26 17:15:15 +03:00
Ivailo Monev
a1ff789266 kdeui: save and restore the size of the KNotificationConfigWidget dialog
another thing that was not done in the old implementation

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-26 16:32:54 +03:00
Ivailo Monev
4444517cfd kdeui: sort the sounds list in KNotificationConfigWidget::setNotification()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-26 16:25:09 +03:00
Ivailo Monev
079825586f kdeui: setup internal KNotificationConfigWidget widget header once
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-26 08:31:28 +03:00
Ivailo Monev
37a2c8db4a kdeui: implement option to select any standard sound file for notifications
because the old KNotification implementation did not look for sounds
recursively it was not possible to set a relative sound file that is
supposed to not be in one of the main sound directories (e.g a sound in a
sub-directory like /usr/share/sounds/freedesktop/stereo/message.oga, for
such files the full path had to be set in the notification config but no
more)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-26 07:55:22 +03:00
Ivailo Monev
a65161f7b0 kdeui: mark the sound action as unavailable when no sound has been specified
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-26 04:11:05 +03:00
Ivailo Monev
16bc82add7 kdeui: ensure the initial event ID is zero in KNotificationManager::send()
knowing how memory randomization and initialization works..

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-26 03:20:28 +03:00
Ivailo Monev
d3133731f5 kdeui: remove unused variable in KNotificationConfigWidget::setNotification()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-26 02:21:37 +03:00
Ivailo Monev
4285a34acf kdeui: stretch the event header index of KNotificationConfigWidget
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-26 02:07:56 +03:00
Ivailo Monev
a7a8eab1a6 kdeui: typo
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-25 23:48:26 +03:00
Ivailo Monev
031cc87d96 kdeui: implement save for KNotificationConfigWidget
another rewrite of bits dating back to 1997 done:
https://ibb.co/5GKtQT1

while working on it the idea of writing custom widget that will act as
checkbox but look something like a slider and using that instead of tables
popped up (the widget design itself is not new but using the widget in new
UIs will be).

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-25 23:12:14 +03:00
Ivailo Monev
5d5087023c kdeui: use the default player ID for KNotification sounds
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-25 22:10:53 +03:00
Ivailo Monev
9a8f057278 kdeui: semi-working KNotificationConfigWidget
read-only, save not implemented yet

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-25 22:06:17 +03:00
Ivailo Monev
54bacc25d2 kdeui: stub KNotificationConfigWidget UI
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-25 19:11:07 +03:00
Ivailo Monev
450120097d kdeui: reimplement KNotification
cleaning up the mess, everything but KNotificationConfigWidget is
implemented.

not only does it not require additional D-Bus service (knotify) to
function but also does not transmit pixmaps over D-Bus, the features
to execute command or log to file are dropped and will not be
implemented.

also about markup support in notifications - if the server does not
support markup then it is supposed to strip it, see the spec:
https://specifications.freedesktop.org/notification-spec/notification-spec-latest.html#backwards-compat
meaning nothing should be done by KNotification itself because it is not
a server, it is just a proxy.

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-25 09:01:39 +03:00
Ivailo Monev
35871587b5 kdeui: remove unused and redundant KStatusNotifierItem::showMessage() method
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-24 04:56:03 +03:00
Ivailo Monev
c5521e791f kdeui: add scaled-down pixmap from KStatusNotifierItemPrivate::iconToVector() as fallback
because the status notifier data engine (see
kde-workspace/plasma/dataengines/statusnotifieritem/statusnotifieritemsource.cpp)
assumes that pixmaps are not larger than KIconLoader::SizeLarge

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-23 21:12:24 +03:00
Ivailo Monev
efe1b03f30 kdeui: format and indent
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-23 16:10:08 +03:00
Ivailo Monev
f672dcd69c kdeui: format and indent
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-23 16:02:24 +03:00
Ivailo Monev
d51ed7beb4 kdeui: format and indent
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-23 15:53:28 +03:00
Ivailo Monev
fa0eed0087 kdeui: do not set icons for separators from KDBusMenuImporter
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-23 00:57:07 +03:00
Ivailo Monev
ba2d781573 kdeui: implement availableSizes() for KIcon
it is actually implemented in the underlaying icon engine (KIconEngine)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-22 20:50:09 +03:00