YIO-Remote / remote-software

💎 YIO Remote Software repository
GNU General Public License v3.0
164 stars 21 forks source link

Notifications needs to be updated due to updated UI backend #311

Closed martonborzak closed 4 years ago

martonborzak commented 4 years ago

@YIO-Remote/team-yio It would be great to pass a function when creating a notification, that later can be called when pressing on the button.

For example: Q_INVOKABLE void add (const bool &type, const QString &text, const QString &actionlabel, const QVariant &action); When an integration disconnects, it should create a notification that it's disconnected. Next to the "Dismiss" button there is an "Action" button. The label can be defined on the button and would be great if we could also define what function would be called when clicked. For example: obj.connect(); to initiate a reconnect.

In some cases this would be a lambda function:

Notifications::getInstance()->add(true, "Failed to load " + QString(pluginName), "Test", [](){
            qDebug() << "TEST";
        });

This function can be a c++ or java function. Do you have any ideas how to approach this? Thanks!