diff options
| author | Emanoil Kotsev <deloptes@gmail.com> | 2025-11-30 22:42:29 +0000 |
|---|---|---|
| committer | Emanoil Kotsev <deloptes@gmail.com> | 2025-11-30 22:42:29 +0000 |
| commit | cbbef4ff578071e79c2359d9eefa2eb141a09e38 (patch) | |
| tree | 6601ead822172f2f75b6861ed95db36b48362e72 /src | |
| parent | f5c158f234f41d89711569f6099a4f741182a953 (diff) | |
| download | kdbusnotification-feat/with_dbus-1-tqt.tar.gz kdbusnotification-feat/with_dbus-1-tqt.zip | |
Add support for resident notifications hintfeat/with_dbus-1-tqt
Signed-off-by: Emanoil Kotsev <deloptes@gmail.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/daemon/NotificationsService.cpp | 7 | ||||
| -rw-r--r-- | src/daemon/NotifyWidget.cpp | 8 | ||||
| -rw-r--r-- | src/daemon/NotifyWidget.h | 3 |
3 files changed, 18 insertions, 0 deletions
diff --git a/src/daemon/NotificationsService.cpp b/src/daemon/NotificationsService.cpp index e91b0ed..07cd3bf 100644 --- a/src/daemon/NotificationsService.cpp +++ b/src/daemon/NotificationsService.cpp @@ -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(); diff --git a/src/daemon/NotifyWidget.cpp b/src/daemon/NotifyWidget.cpp index f80036d..d780957 100644 --- a/src/daemon/NotifyWidget.cpp +++ b/src/daemon/NotifyWidget.cpp @@ -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; } diff --git a/src/daemon/NotifyWidget.h b/src/daemon/NotifyWidget.h index 4191f1c..d80c154 100644 --- a/src/daemon/NotifyWidget.h +++ b/src/daemon/NotifyWidget.h @@ -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; |
