Commit graph

80 commits

Author SHA1 Message Date
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
Ivailo Monev
535ac857be kdeui: do not prefix the KDBusMenuImporter virtual method calls
otherwise the (possible) reimplementation is not called

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-21 18:56:43 +03:00
Ivailo Monev
37f9ea4dba kdeui: do not swap the order of the image bits in KStatusNotifierItemPrivate::imageToStruct()
does nothing but slow down the image serialization on little endian really,
the image data is not ment to be saved and passed around to other host

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-12 01:34:42 +03:00
Ivailo Monev
dc208c52fd generic: update references to shared data directory
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-18 00:20:22 +03:00
Ivailo Monev
2c730832c1 kdeui: remove unused KDBusMenuExporter and KDBusMenuImporter API
the methods and signals were implemenented for compat with libdbusmenu-qt
but KStatusNotifierItem tracks status by itself for example, internal menu
synchronization (e.g. triggering importer action when exporter action is
triggered) can be implemented via the D-Bus adaptor and interface but is
currently not required

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-05-29 21:19:47 +03:00
Ivailo Monev
6a99e23068 kdeui: fix parameter shadowing in KDBusMenuAdaptor::actions()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-05-29 04:03:14 +03:00
Ivailo Monev
d92f080806 kdeui: document KDBusMenuExporter and KDBusMenuImporter
the finishing touch

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-05-29 01:55:05 +03:00
Ivailo Monev
675881c624 kdeui: KDBusMenuExporter and KDBusMenuImporter optimizations
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-05-29 01:54:19 +03:00
Ivailo Monev
4bf945c574 kdeui: new static function to de-duplicate KDBusMenuImporter code
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-05-29 00:13:23 +03:00
Ivailo Monev
9a86368853 kdeui: implement sub-menu export/import for D-Bus menus
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-05-28 23:58:56 +03:00
Ivailo Monev
b54ba45a5a kdeui: create the QMenu only once from KDBusMenuImporter::updateMenu()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-05-28 21:16:45 +03:00
Ivailo Monev
819cca1e41 kdeui: replace libdbusmenu-qt dependency with custom classes
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-05-28 20:56:05 +03:00
Ivailo Monev
3db230c695 kdeui: remove redundant KDBusMenuExporter class
KIcon constructed from QIcon is just a QIcon (does not do icon lookup,
loading of icon, etc.)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-05-27 19:39:05 +03:00
Ivailo Monev
4dbb501d25 generic: drop text-to-speech support
Katana (or any interface designed around key and mouse events) is not
for blind people, trying to slap text-to-speech on top of it was the
wrong thing to do to begin with

side note: speech-dispatcher tends to hang if the output device is not
configured properly (i.e. editing /etc/speech-dispatcher/speechd.conf
manually)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-12-18 15:56:59 +02:00
Ivailo Monev
6784f51d58 kdeui: tweak KNotificationManager and KGlobalAccel for automatic service activation
KGlobalAccelPrivate uses service watcher and the interface is invalid until
the service is activated (either by the first call of the interface or some
other lazy-initialization method), however KNotificationManager does
connect to signals immediately (which should work regardless) but the error
may have been logged before

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-12-09 12:00:23 +02:00
Ivailo Monev
0e980c95cc kdeui: remove redundant attempts to start D-Bus services
creating QDBusInterface should start the services, in case the services
cannot be started tho delays may be experienced (such as the UI freezing
while waiting for D-Bus reply to finish) thus logging error

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-12-09 03:40:07 +02:00
Ivailo Monev
0cafb27096 kdeui: do not detach the QImage object in KStatusNotifierItemPrivate::imageToStruct()
it cannot be detached even if not copied (as done when it is not in
QImage::Format_ARGB32 format) because image is constant reference but if it
is converted it will be actually detached, also QByteArray takes ownership
of the data

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-24 20:23:56 +02:00
Ivailo Monev
90928e8320 generic: store package found definitions in config header
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-10-30 05:41:21 +02:00
Ivailo Monev
406bd42a7e kdeui: change the org.kde.StatusNotifierItem WindowId property type to qlonglong
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-10-02 12:32:10 +03:00
Ivailo Monev
f5c0cc05ee kdeui: use static_cast<T>() to cast the WId type in KStatusNotifierItemDBus::WindowId()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-10-02 12:06:29 +03:00
Ivailo Monev
23d7852213 kdeui: remove invalid property in org.kde.StatusNotifierItem D-Bus interface file
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-09-28 17:01:52 +03:00
Ivailo Monev
51ec59c95e kdeui: move the static protocol version constant out of KStatusNotifierItemPrivate class
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-09-27 10:12:00 +03:00
Ivailo Monev
51a8d308a1 kdeui: format notification source and header files
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-09-27 10:10:44 +03:00
Ivailo Monev
71a479f48c kdeui: use typedef from KNotification class in KNotificationManager
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-09-27 09:52:25 +03:00
Ivailo Monev
36472304d8 kdeui: format knotification source file
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-09-27 09:49:21 +03:00
Ivailo Monev
26d0aa0859 kdeui: get rid of KNotificationManager::Private struct
KNotificationManager is private class

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-09-27 09:49:03 +03:00