mirror of
https://github.com/status-im/snorenotify.git
synced 2025-02-26 23:10:39 +00:00
Adding generation of test message; additional connect of snotNotify to core
Signed-off-by: Max Risuhin <risuhin.max@gmail.com>
This commit is contained in:
parent
fa7f613719
commit
281517c643
@ -108,12 +108,24 @@ bool SnoreCorePrivate::setBackendIfAvailible(const QString &backend)
|
||||
}
|
||||
m_notificationBackend = b;
|
||||
m_notificationBackend->enable();
|
||||
connect(SnoreCorePrivate::instance(), &SnoreCorePrivate::notify, m_notificationBackend, &SnoreBackend::slotNotify, Qt::QueuedConnection);
|
||||
q->setSettingsValue(Constants::SettingsKeys::PrimaryBackend, backend);
|
||||
|
||||
connect(b, &SnoreBackend::error, [this, b](const QString &) {
|
||||
slotInitPrimaryNotificationBackend();
|
||||
});
|
||||
emit q->primaryNotificationBackendChanged(b->name());
|
||||
|
||||
Application app = SnoreCorePrivate::instance()->defaultApplication();
|
||||
QString text = QLatin1String("<i>") + tr("This is %1").arg(app.name()) + QLatin1String("</i><br>"
|
||||
"<b>") + tr("Everything is awesome!") + QLatin1String("</b><br>");
|
||||
if (!app.constHints().value("use-markup").toBool()) {
|
||||
text = Utils::normalizeMarkup(text, Utils::NoMarkup);
|
||||
}
|
||||
Notification noti(app, app.defaultAlert(), tr("Hello There!"), text, app.icon());
|
||||
noti.addAction(Action(1, tr("Awesome Action!")));
|
||||
|
||||
m_notificationBackend->slotNotify(noti);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user