extended notificationinstance interface for icon support
This commit is contained in:
parent
74f64d9442
commit
c06e3b9739
|
@ -22,9 +22,9 @@ SnoreNotificationInstance::SnoreNotificationInstance()
|
|||
{
|
||||
}
|
||||
|
||||
SnoreNotificationInstance::SnoreNotificationInstance ( const QString &appname, SnoreServer *parent ) :
|
||||
SnoreNotificationInstance::SnoreNotificationInstance ( const QString &appname, SnoreServer *parent,const QString &icon ) :
|
||||
_appName ( appname ),
|
||||
_app ( new Application ( appname ) ),
|
||||
_app ( new Application ( appname ,icon) ),
|
||||
_snore ( parent )
|
||||
{
|
||||
setParent ( parent );
|
||||
|
@ -36,9 +36,9 @@ SnoreNotificationInstance::~SnoreNotificationInstance()
|
|||
}
|
||||
|
||||
|
||||
void SnoreNotificationInstance::addAlert ( const QString &name, const QString &title )
|
||||
void SnoreNotificationInstance::addAlert (const QString &name, const QString &title, const QString &icon)
|
||||
{
|
||||
_app->addAlert ( new Alert ( name,title.isNull() ?name:title ) );
|
||||
_app->addAlert ( new Alert ( name,title.isNull() ?name:title,icon ) );
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -25,9 +25,9 @@ class SNORE_EXPORT SnoreNotificationInstance:public QObject
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SnoreNotificationInstance ( const QString &appname,SnoreServer *parent );
|
||||
SnoreNotificationInstance ( const QString &appname, SnoreServer *parent, const QString &icon="" );
|
||||
~SnoreNotificationInstance();
|
||||
void addAlert ( const QString &name,const QString &title = 0 );
|
||||
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 );
|
||||
|
|
|
@ -53,8 +53,8 @@ void Snarl_Backend::registerApplication(Application *application){
|
|||
Snarl::SnarlInterface *snarlInterface = new Snarl::SnarlInterface();
|
||||
_applications.insert(application->name(),snarlInterface);
|
||||
|
||||
wchar_t *appName = toWchar(application->name());
|
||||
wchar_t *icon = toWchar(application->icon());
|
||||
wchar_t *appName = toWchar(application->name());
|
||||
wchar_t *icon = toWchar(application->icon());
|
||||
snarlInterface->RegisterApp(appName,icon,icon);
|
||||
|
||||
foreach(Alert *alert,application->alerts()){
|
||||
|
@ -82,7 +82,7 @@ int Snarl_Backend::notify(QSharedPointer<Notification>notification){
|
|||
int id = notification->id();
|
||||
wchar_t *title = toWchar(Notification::toPlainText(notification->title()));
|
||||
wchar_t *text = toWchar(Notification::toPlainText(notification->text()));
|
||||
wchar_t *icon = toWchar(notification->icon());
|
||||
wchar_t *icon = toWchar(notification->icon());
|
||||
|
||||
if(notification->id()==0){
|
||||
wprintf(L"Calling SnarlMessage\n"
|
||||
|
|
Loading…
Reference in New Issue