From bc7955f02c23b7b0d74daf10e5f315379984b173 Mon Sep 17 00:00:00 2001 From: Patrick von Reth Date: Wed, 20 Jul 2011 01:53:04 +0200 Subject: [PATCH] added action support to notificationinstance --- src/core/snorenotificationinstance.cpp | 8 ++++++-- src/core/snorenotificationinstance.h | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/core/snorenotificationinstance.cpp b/src/core/snorenotificationinstance.cpp index 8fea18d..d15d3c0 100644 --- a/src/core/snorenotificationinstance.cpp +++ b/src/core/snorenotificationinstance.cpp @@ -50,9 +50,13 @@ void SnoreNotificationInstance::unregisterWithBackends() _snore->removeApplication ( _app->name() ); } -int SnoreNotificationInstance::notify ( const QString &alert, const QString &title, const QString &text, const QString &icon, int timeout,Notification::prioritys priority ) +int SnoreNotificationInstance::notify ( const QString &alert, const QString &title, const QString &text, const QString &icon, int timeout,Notification::prioritys priority,const QList *actions ) { - return _snore->broadcastNotification ( Notification( this,_app->name(),alert,title,text,icon,timeout,0,priority ) ); + Notification notification = Notification( this,_app->name(),alert,title,text,icon,timeout,0,priority ); + foreach(Action *a,actions){ + notification.addAction(a); + } + return _snore->broadcastNotification ( notification ); } void SnoreNotificationInstance::actionInvoked ( Notification notification ){ diff --git a/src/core/snorenotificationinstance.h b/src/core/snorenotificationinstance.h index 23e39b2..715aa1f 100644 --- a/src/core/snorenotificationinstance.h +++ b/src/core/snorenotificationinstance.h @@ -31,7 +31,7 @@ public: void addAlert ( const QString &name,const QString &title = 0, const QString &icon="" ); void registerWithBackends(); void unregisterWithBackends(); - int notify ( const QString &alert,const QString &title,const QString &text,const QString &icon = 0,int timeout = 10, Notification::prioritys priority = Notification::NORMAL); + int notify ( const QString &alert,const QString &title,const QString &text,const QString &icon = 0,int timeout = 10, Notification::prioritys priority = Notification::NORMAL,const QList *actions = NULL); void actionInvoked ( Notification notification ); void notificationClosed ( Notification notification );