X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Ftaskbarnotificationbackend.cpp;h=96060128a554fe315d4b1ce165d427fc88dfdb28;hp=9b2e2be162db60c42ebb0d1d630b576250b30f31;hb=526eccc444029c5a0d80694487c3aec6707cbeda;hpb=c80ab2e825ff9125c1c7e8e829487a4b1c118579 diff --git a/src/qtui/taskbarnotificationbackend.cpp b/src/qtui/taskbarnotificationbackend.cpp index 9b2e2be1..96060128 100644 --- a/src/qtui/taskbarnotificationbackend.cpp +++ b/src/qtui/taskbarnotificationbackend.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 * @@ -26,24 +26,19 @@ #include "mainwin.h" #include "qtui.h" -TaskbarNotificationBackend::TaskbarNotificationBackend(QObject *parent) : AbstractNotificationBackend(parent) { +TaskbarNotificationBackend::TaskbarNotificationBackend(QObject *parent) + : AbstractNotificationBackend(parent) +{ NotificationSettings notificationSettings; _enabled = notificationSettings.value("Taskbar/Enabled", true).toBool(); _timeout = notificationSettings.value("Taskbar/Timeout", 0).toBool(); notificationSettings.notify("Taskbar/Enabled", this, SLOT(enabledChanged(const QVariant &))); notificationSettings.notify("Taskbar/Timeout", this, SLOT(timeoutChanged(const QVariant &))); - - _configWidget = new ConfigWidget(); -} - -TaskbarNotificationBackend::~TaskbarNotificationBackend() { - delete _configWidget; } void TaskbarNotificationBackend::notify(const Notification ¬ification) { - Q_UNUSED(notification) - if(_enabled) { + if(_enabled && (notification.type == Highlight || notification.type == PrivMsg)) { QApplication::alert(QtUi::mainWindow(), _timeout); } } @@ -60,8 +55,8 @@ void TaskbarNotificationBackend::timeoutChanged(const QVariant &v) { _timeout = v.toInt(); } -SettingsPage *TaskbarNotificationBackend::configWidget() const { - return _configWidget; +SettingsPage *TaskbarNotificationBackend::createConfigWidget() const { + return new ConfigWidget(); } /***************************************************************************/