fixed two deprecates and added a simple test
This commit is contained in:
parent
329f36ac38
commit
f19a561799
|
@ -92,8 +92,7 @@ uint FreedesktopFrontend::Notify(const QString &app_name, uint replaces_id,
|
||||||
#endif
|
#endif
|
||||||
Application *a = new Application(app_name,appIcon);
|
Application *a = new Application(app_name,appIcon);
|
||||||
a->addAlert(new Alert("DBus Alert","DBus Alert",appIcon));
|
a->addAlert(new Alert("DBus Alert","DBus Alert",appIcon));
|
||||||
snore()->addApplication(a);
|
snore()->registerApplication(a);
|
||||||
snore()->applicationIsInitialized(a);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hints.contains("urgency")) {
|
if (hints.contains("urgency")) {
|
||||||
|
|
|
@ -71,7 +71,7 @@ void SnoreNotify::save(){
|
||||||
void SnoreNotify::exit(){
|
void SnoreNotify::exit(){
|
||||||
qDebug()<<"Saving snore settings";
|
qDebug()<<"Saving snore settings";
|
||||||
foreach(Application *a,m_snore->aplications()){
|
foreach(Application *a,m_snore->aplications()){
|
||||||
m_snore->removeApplication(a->name());
|
m_snore->deregisterApplication(a);
|
||||||
}
|
}
|
||||||
save();
|
save();
|
||||||
m_trayIcon->hide();
|
m_trayIcon->hide();
|
||||||
|
|
|
@ -40,6 +40,8 @@ void TrayIcon::initConextMenu(SnoreCore *snore){
|
||||||
_trayMenu = new QMenu("SnoreNotify");
|
_trayMenu = new QMenu("SnoreNotify");
|
||||||
_trayMenu->addAction(QString("SnoreNotify ").append(Version::version()));
|
_trayMenu->addAction(QString("SnoreNotify ").append(Version::version()));
|
||||||
_trayMenu->addSeparator();
|
_trayMenu->addSeparator();
|
||||||
|
connect(_trayMenu->addAction(QString("Test")), SIGNAL(triggered()), this, SLOT(slotTestNotification()));
|
||||||
|
_trayMenu->addSeparator();
|
||||||
foreach(const QString &back,_snore->notificationBackends()){
|
foreach(const QString &back,_snore->notificationBackends()){
|
||||||
QAction *b= new QAction(back,this);
|
QAction *b= new QAction(back,this);
|
||||||
connect(b,SIGNAL(triggered()),this,SLOT(setPrimaryBackend()));
|
connect(b,SIGNAL(triggered()),this,SLOT(setPrimaryBackend()));
|
||||||
|
@ -75,3 +77,9 @@ void TrayIcon::setPrimaryBackend(){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TrayIcon::slotTestNotification()
|
||||||
|
{
|
||||||
|
Notification n("SnoreNotify","Default","Hello World","This is Snore",Icon(":/root/snore.png"));
|
||||||
|
_snore->broadcastNotification(n);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,7 @@ private:
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setPrimaryBackend();
|
void setPrimaryBackend();
|
||||||
|
void slotTestNotification();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TRAYICON_H
|
#endif // TRAYICON_H
|
||||||
|
|
Loading…
Reference in New Issue