Notifications in digiKam question

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Notifications in digiKam question

Dmitri Popov-2
Hello,

digiKam makes it possible to assign commands to notifications. For
example, I can run a command on the "Save file complete" notification.
But is it possible to pass the name of the file to the command?

Thanks,
Dmitri
Reply | Threaded
Open this post in threaded view
|

Re: Notifications in digiKam question

Gilles Caulier-4
yes, the in fact the event notifier is a string + metadata (optional).

It's possible to pass something like "File %1 save completed" for ex, with %1 the file name as argument. In background, QString container is used.

The code relevant for image editor is here :


and here :


DNotificationWrapper class is used and it re-route the notification to right object from the desktop depending of operating systm.

https://cgit.kde.org/digikam.git/tree/libs/notificationmanager/dnotificationwrapper.h

So, everywhere in DK, this class is used to notify an event. Patching all call can be easy to do.

Gilles Caulier

2017-04-13 16:24 GMT+02:00 Dmitri Popov <[hidden email]>:
Hello,

digiKam makes it possible to assign commands to notifications. For
example, I can run a command on the "Save file complete" notification.
But is it possible to pass the name of the file to the command?

Thanks,
Dmitri

Reply | Threaded
Open this post in threaded view
|

Re: Notifications in digiKam question

Dmitri Popov-2
Excellent! Thank you very much, Gilles!

Best,
Dmitri

On Thu, Apr 13, 2017 at 6:24 PM, Gilles Caulier
<[hidden email]> wrote:

> yes, the in fact the event notifier is a string + metadata (optional).
>
> It's possible to pass something like "File %1 save completed" for ex, with
> %1 the file name as argument. In background, QString container is used.
>
> The code relevant for image editor is here :
>
> https://cgit.kde.org/digikam.git/tree/utilities/imageeditor/main/imagewindow.cpp#n964
>
> and here :
>
> https://cgit.kde.org/digikam.git/tree/utilities/imageeditor/main/imagewindow.cpp#n1062
>
> DNotificationWrapper class is used and it re-route the notification to right
> object from the desktop depending of operating systm.
>
>
> https://cgit.kde.org/digikam.git/tree/libs/notificationmanager/dnotificationwrapper.h
>
>
> So, everywhere in DK, this class is used to notify an event. Patching all
> call can be easy to do.
>
>
> Gilles Caulier
>
>
> 2017-04-13 16:24 GMT+02:00 Dmitri Popov <[hidden email]>:
>>
>> Hello,
>>
>> digiKam makes it possible to assign commands to notifications. For
>> example, I can run a command on the "Save file complete" notification.
>> But is it possible to pass the name of the file to the command?
>>
>> Thanks,
>> Dmitri
>
>