diff options
Diffstat (limited to 'src/daemon/NotificationsService.cpp')
| -rw-r--r-- | src/daemon/NotificationsService.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/daemon/NotificationsService.cpp b/src/daemon/NotificationsService.cpp index e91b0ed..eef2435 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)); @@ -184,17 +189,18 @@ void NotificationsService::NotifyAsync( if(! errStr.isNull() ) tqDebug("There was an error converting some of the hint values: " + errStr); } - else - tqDebug("hints is empty "); mNotificationMap[nId]->setText("<b>" + app_name + ": " + summary + "</b><p>" + body + "</p>"); 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 + if(mNotificationMap[nId]->getUrgency() == 2) + timeout = 0; // critical notifications should never expire mNotificationMap[nId]->setTimeout(timeout); mNotificationMap[nId]->adjustSize(); mNotificationMap[nId]->raise(); - mNotificationMap[nId]->show(); mNotificationMap[nId]->setActiveWindow(); // make sure we display the new notification above the older one @@ -210,6 +216,7 @@ void NotificationsService::NotifyAsync( mNotificationMap[nId]->move( d->width()-mNotificationMap[nId]->width(), d->height()-mNotificationMap[nId]->height()); } + mNotificationMap[nId]->show(); NotifyAsyncReply(asyncCallId, nId); } |
