X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fknotificationbackend.cpp;h=64bdfdc30aa867678ea7cbf836d3572b52bf7161;hp=c55bf31c18974994562ca743066e3d344a115f8e;hb=8118229704229c33e151b3c707c8beaa0c077a86;hpb=b66b1d455e0a6c8c438cf2b8ceecdd738cbfcb04 diff --git a/src/qtui/knotificationbackend.cpp b/src/qtui/knotificationbackend.cpp index c55bf31c..64bdfdc3 100644 --- a/src/qtui/knotificationbackend.cpp +++ b/src/qtui/knotificationbackend.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 * @@ -30,6 +30,7 @@ #include "iconloader.h" #include "networkmodel.h" #include "qtui.h" +#include "systemtray.h" KNotificationBackend::KNotificationBackend(QObject *parent) : AbstractNotificationBackend(parent) { @@ -38,12 +39,19 @@ KNotificationBackend::KNotificationBackend(QObject *parent) : AbstractNotificati void KNotificationBackend::notify(const Notification &n) { //QString title = Client::networkModel()->networkName(n.bufferId) + " - " + Client::networkModel()->bufferName(n.bufferId); QString message = QString("<%1> %2").arg(n.sender, n.message); - KNotification::event("Highlight", message, DesktopIcon("dialog-information"), QtUi::mainWindow(), - KNotification::Persistent|KNotification::RaiseWidgetOnActivation|KNotification::CloseWhenWidgetActivated); + KNotification *notification = KNotification::event("Highlight", message, DesktopIcon("dialog-information"), QtUi::mainWindow(), + KNotification::Persistent|KNotification::RaiseWidgetOnActivation|KNotification::CloseWhenWidgetActivated); + connect(notification, SIGNAL(activated()), SLOT(notificationActivated())); + QtUi::mainWindow()->systemTray()->setAlert(true); } void KNotificationBackend::close(uint notificationId) { Q_UNUSED(notificationId); + QtUi::mainWindow()->systemTray()->setAlert(false); +} + +void KNotificationBackend::notificationActivated() { + emit activated(); } SettingsPage *KNotificationBackend::createConfigWidget() const {