Commit graph

92 commits

Author SHA1 Message Date
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
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