Merge branch 'master' of git://gitorious.org/snorenotify/snorenotify
This commit is contained in:
commit
fd7098652a
|
@ -95,6 +95,7 @@ void SnarlNetworkFrontend::handleMessages(){
|
||||||
}
|
}
|
||||||
|
|
||||||
void SnarlNetworkFrontend::callback(const SnarlNotification &sn,QString msg){
|
void SnarlNetworkFrontend::callback(const SnarlNotification &sn,QString msg){
|
||||||
|
qDebug()<<"SnarlNetwork callback:"<<sn.notification->id();
|
||||||
notifications.remove(sn.notification->id());
|
notifications.remove(sn.notification->id());
|
||||||
if(sn.clientSocket!=NULL&&!msg.isEmpty()){
|
if(sn.clientSocket!=NULL&&!msg.isEmpty()){
|
||||||
msg+=QString::number(sn.notification->id());
|
msg+=QString::number(sn.notification->id());
|
||||||
|
|
|
@ -52,9 +52,10 @@ SnoreNotify::SnoreNotify()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
load();
|
||||||
|
|
||||||
_trayIcon->initConextMenu(_snore);
|
_trayIcon->initConextMenu(_snore);
|
||||||
|
|
||||||
load();
|
|
||||||
connect(qApp,SIGNAL(aboutToQuit()),this,SLOT(exit()));
|
connect(qApp,SIGNAL(aboutToQuit()),this,SLOT(exit()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,10 @@ void TrayIcon::initConextMenu(SnoreServer *snore){
|
||||||
foreach(Notification_Backend *back,_snore->primaryNotificationBackends()){
|
foreach(Notification_Backend *back,_snore->primaryNotificationBackends()){
|
||||||
QAction *b= new QAction(back->name(),this);
|
QAction *b= new QAction(back->name(),this);
|
||||||
connect(b,SIGNAL(triggered()),this,SLOT(setPrimaryBackend()));
|
connect(b,SIGNAL(triggered()),this,SLOT(setPrimaryBackend()));
|
||||||
|
b->setCheckable(true);
|
||||||
|
if(back->name() == _snore->primaryNotificationBackend()->name())
|
||||||
|
b->setChecked(true);
|
||||||
|
_backendActions.append(b);
|
||||||
_trayMenu->addAction(b);
|
_trayMenu->addAction(b);
|
||||||
}
|
}
|
||||||
_trayMenu->addSeparator();
|
_trayMenu->addSeparator();
|
||||||
|
@ -56,6 +60,12 @@ QSystemTrayIcon* TrayIcon::trayIcon(){
|
||||||
void TrayIcon::setPrimaryBackend(){
|
void TrayIcon::setPrimaryBackend(){
|
||||||
QAction *a= dynamic_cast<QAction*>(sender());
|
QAction *a= dynamic_cast<QAction*>(sender());
|
||||||
_snore->setPrimaryNotificationBackend(_snore->primaryNotificationBackends().value(a->text()));
|
_snore->setPrimaryNotificationBackend(_snore->primaryNotificationBackends().value(a->text()));
|
||||||
|
|
||||||
|
foreach(QAction *action,_backendActions){
|
||||||
|
action->setChecked(false);
|
||||||
|
}
|
||||||
|
a->setChecked(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@ public:
|
||||||
private:
|
private:
|
||||||
class QSystemTrayIcon *_trayIcon;
|
class QSystemTrayIcon *_trayIcon;
|
||||||
class QMenu *_trayMenu;
|
class QMenu *_trayMenu;
|
||||||
|
class QList<class QAction*> _backendActions;
|
||||||
class SnoreServer *_snore;
|
class SnoreServer *_snore;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue