- a->addAlert(new Snore::Alert(tr("Private Message"),tr("Private Message")));
-
- m_snore->addApplication(a);
- m_snore->applicationIsInitialized (a);
-
- m_snore->setPrimaryNotificationBackend(backend);
-}
-
-SnoreNotificationBackend::~SnoreNotificationBackend(){
- m_snore->removeApplication("Quassel");
- m_snore->deleteLater();
-}
-
-void SnoreNotificationBackend::backendChanged(const QVariant &v){
- QString backend = v.toString();
- if(backend == "SystemTray"){
- if(m_systrayBackend == NULL){
- m_systrayBackend = new SystrayNotificationBackend(this);
- QtUi::registerNotificationBackend(m_systrayBackend);
- }
- }else{
- if(m_systrayBackend != NULL){
- QtUi::unregisterNotificationBackend(m_systrayBackend);
- delete m_systrayBackend;
- m_systrayBackend = NULL;
- }
- m_snore->setPrimaryNotificationBackend(backend);
- }
+ NotificationSettings notificationSettings;
+ bool enabled = notificationSettings.value("Snore/Enabled", false).toBool();
+ setTraybackend(enabled);
+ notificationSettings.notify("Snore/Enabled", this, SLOT(setTraybackend(const QVariant &)));