X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fsystraynotificationbackend.cpp;h=e9929805704c6ef49196d3d4fb5b55b7858deb15;hb=e7494078ad676d9fd14fab0396f51608a3ad46dc;hp=1c8b572554d38916cb1f6bd01e2fedf7ee1bb4a9;hpb=5c78a50fa720e5f82fcaa03c0176feab71d74c8e;p=quassel.git diff --git a/src/qtui/systraynotificationbackend.cpp b/src/qtui/systraynotificationbackend.cpp index 1c8b5725..e9929805 100644 --- a/src/qtui/systraynotificationbackend.cpp +++ b/src/qtui/systraynotificationbackend.cpp @@ -29,7 +29,9 @@ #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(); @@ -37,15 +39,10 @@ SystrayNotificationBackend::SystrayNotificationBackend(QObject *parent) : Abstra 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; -} - void SystrayNotificationBackend::notify(const Notification ¬ification) { /* fancy stuff to be implemented later: show notifications in order _notifications.append(notification); @@ -58,7 +55,7 @@ void SystrayNotificationBackend::notify(const Notification ¬ification) { if(_showBubble) { showBubble(); } - if(_animate && _notifications.count() == 1) { + if(_animate) { startAnimation(); } } @@ -86,8 +83,10 @@ void SystrayNotificationBackend::showBubble() { } void SystrayNotificationBackend::closeBubble() { - // there really seems to be no decent way to close the bubble... + // there really seems to be no sane way to close the bubble... :( +#ifdef Q_WS_X11 QtUi::mainWindow()->systemTrayIcon()->showMessage("", "", QSystemTrayIcon::NoIcon, 1); +#endif } void SystrayNotificationBackend::showBubbleChanged(const QVariant &v) { @@ -114,8 +113,8 @@ void SystrayNotificationBackend::animateChanged(const QVariant &v) { _animate = v.toBool(); } -SettingsPage *SystrayNotificationBackend::configWidget() const { - return _configWidget; +SettingsPage *SystrayNotificationBackend::createConfigWidget() const { + return new ConfigWidget(); } /***************************************************************************/