/***************************************************************************
-* Copyright (C) 2005-08 by the Quassel Project *
+* Copyright (C) 2005-09 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
#include "networkmodel.h"
#include "qtui.h"
-SystrayNotificationBackend::SystrayNotificationBackend(QObject *parent) : AbstractNotificationBackend(parent) {
+SystrayNotificationBackend::SystrayNotificationBackend(QObject *parent)
+ : AbstractNotificationBackend(parent)
+{
NotificationSettings notificationSettings;
_showBubble = notificationSettings.value("Systray/ShowBubble", true).toBool();
_animate = notificationSettings.value("Systray/Animate", true).toBool();
notificationSettings.notify("Systray/ShowBubble", this, SLOT(showBubbleChanged(const QVariant &)));
notificationSettings.notify("Systray/Animate", this, SLOT(animateChanged(const QVariant &)));
- _configWidget = new ConfigWidget();
_iconActive = false;
connect(&_animationTimer, SIGNAL(timeout()), SLOT(blink()));
-}
-
-SystrayNotificationBackend::~SystrayNotificationBackend() {
- delete _configWidget;
+ connect(QtUi::mainWindow()->systemTrayIcon(), SIGNAL(messageClicked()), this, SIGNAL(activated()));
}
void SystrayNotificationBackend::notify(const Notification ¬ification) {
}
void SystrayNotificationBackend::closeBubble() {
- // there really seems to be no decent way to close the bubble...
- // in addition, windows ignores the timeout -_-
-#ifndef Q_WS_WIN
+ // there really seems to be no sane way to close the bubble... :(
+#ifdef Q_WS_X11
QtUi::mainWindow()->systemTrayIcon()->showMessage("", "", QSystemTrayIcon::NoIcon, 1);
#endif
}
_animate = v.toBool();
}
-SettingsPage *SystrayNotificationBackend::configWidget() const {
- return _configWidget;
+SettingsPage *SystrayNotificationBackend::createConfigWidget() const {
+ return new ConfigWidget();
}
/***************************************************************************/