Add support for resident notifications hint

Signed-off-by: Emanoil Kotsev <deloptes@gmail.com>
feat/with_dbus-1-tqt
Emanoil Kotsev 1 month ago
parent f5c158f234
commit cbbef4ff57
No known key found for this signature in database
GPG Key ID: F1EEB8CD9FB16A50

@ -165,6 +165,11 @@ void NotificationsService::NotifyAsync(
mNotificationMap[nId]->setSuppressSound(it.data().value.toBool(&ok));
if(!ok) errStr += " suppress-sound";
}
else if (it.key()=="resident")
{
mNotificationMap[nId]->setResident(it.data().value.toBool(&ok));
if(!ok) errStr += " resident";
}
else if (it.key()=="transient")
{
mNotificationMap[nId]->setTransient(it.data().value.toBool(&ok));
@ -191,6 +196,8 @@ void NotificationsService::NotifyAsync(
mNotificationMap[nId]->setActions(actions);
if(mNotificationMap[nId]->isTransient() && timeout == 0)
timeout = -1; // use server defined timeout (transient bypasses persistence on the server)
if(mNotificationMap[nId]->isResident() && timeout != 0)
timeout = 0; // resident takes advantage of persistence)
mNotificationMap[nId]->setTimeout(timeout);
mNotificationMap[nId]->adjustSize();
mNotificationMap[nId]->raise();

@ -189,6 +189,14 @@ void NotifyWidget::setSuppressSound(bool s) {
mSuppressSound = s;
}
void NotifyWidget::setResident(bool r) {
mResident = r;
}
bool NotifyWidget::isResident() {
return mResident;
}
void NotifyWidget::setTransient(bool t) {
mTransient = t;
}

@ -87,6 +87,8 @@ Categories are in class.specific form. class specifies the generic type of notif
void setSoundFile(const TQString&);
void setSoundName(const TQString&);
void setSuppressSound(bool);
void setResident(bool);
bool isResident();
void setTransient(bool);
bool isTransient();
void setUrgency(TQ_UINT8);
@ -145,6 +147,7 @@ private:
TQString mSoundName;
bool mPersistence;
bool mSuppressSound;
bool mResident;
bool mTransient;
TQ_INT64 mSenderPid;

Loading…
Cancel
Save