X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fsystraynotificationbackend.cpp;h=c97860caf85d24c791b8a4dd9135c68d9b37f425;hp=296372cbbb39b6bfcca9df9527bd53eebe2f0ef5;hb=453ccab6ade4a21c7aa3c331af893c91468250a4;hpb=27798ca9c7fe5b89961e787a94d81f615f2e0d3a diff --git a/src/qtui/systraynotificationbackend.cpp b/src/qtui/systraynotificationbackend.cpp index 296372cb..c97860ca 100644 --- a/src/qtui/systraynotificationbackend.cpp +++ b/src/qtui/systraynotificationbackend.cpp @@ -1,5 +1,5 @@ /*************************************************************************** -* 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 * @@ -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,13 +39,9 @@ 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; + connect(QtUi::mainWindow()->systemTrayIcon(), SIGNAL(messageClicked()), this, SIGNAL(activated())); } void SystrayNotificationBackend::notify(const Notification ¬ification) { @@ -86,8 +84,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 +114,8 @@ void SystrayNotificationBackend::animateChanged(const QVariant &v) { _animate = v.toBool(); } -SettingsPage *SystrayNotificationBackend::configWidget() const { - return _configWidget; +SettingsPage *SystrayNotificationBackend::createConfigWidget() const { + return new ConfigWidget(); } /***************************************************************************/