X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Ftaskbarnotificationbackend.cpp;h=46e562b3372de3e78136cf6135f312a0c8451d9e;hp=9fda55b683372608e1ac04e5ae401983c81a0b61;hb=4ae8f86c1ce452582d6fe576956c7c1bc1460adf;hpb=f824db0e31b54969e0b7fa0b5405b1e9173d482c diff --git a/src/qtui/taskbarnotificationbackend.cpp b/src/qtui/taskbarnotificationbackend.cpp index 9fda55b6..46e562b3 100644 --- a/src/qtui/taskbarnotificationbackend.cpp +++ b/src/qtui/taskbarnotificationbackend.cpp @@ -1,28 +1,32 @@ /*************************************************************************** -* Copyright (C) 2005-09 by the Quassel Project * -* devel@quassel-irc.org * -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) version 3. * -* * -* This program is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -* GNU General Public License for more details. * -* * -* You should have received a copy of the GNU General Public License * -* along with this program; if not, write to the * -* Free Software Foundation, Inc., * -* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * -***************************************************************************/ + * Copyright (C) 2005-2012 by the Quassel Project * + * devel@quassel-irc.org * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) version 3. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include +#include +#include #include "taskbarnotificationbackend.h" -#include - #include "clientsettings.h" +#include "iconloader.h" #include "mainwin.h" #include "qtui.h" @@ -31,15 +35,14 @@ TaskbarNotificationBackend::TaskbarNotificationBackend(QObject *parent) { NotificationSettings notificationSettings; _enabled = notificationSettings.value("Taskbar/Enabled", true).toBool(); - _timeout = notificationSettings.value("Taskbar/Timeout", 0).toBool(); + _timeout = notificationSettings.value("Taskbar/Timeout", 0).toInt(); notificationSettings.notify("Taskbar/Enabled", this, SLOT(enabledChanged(const QVariant &))); notificationSettings.notify("Taskbar/Timeout", this, SLOT(timeoutChanged(const QVariant &))); } void TaskbarNotificationBackend::notify(const Notification ¬ification) { - Q_UNUSED(notification) - if(_enabled) { + if(_enabled && (notification.type == Highlight || notification.type == PrivMsg)) { QApplication::alert(QtUi::mainWindow(), _timeout); } } @@ -69,15 +72,19 @@ TaskbarNotificationBackend::ConfigWidget::ConfigWidget(QWidget *parent) : Settin #else layout->addWidget(enabledBox = new QCheckBox(tr("Mark taskbar entry, timeout:"), this)); #endif + enabledBox->setIcon(SmallIcon("flag-blue")); + enabledBox->setEnabled(true); + timeoutBox = new QSpinBox(this); - timeoutBox->setMinimum(0); + timeoutBox->setMinimum(1); timeoutBox->setMaximum(99); timeoutBox->setSpecialValueText(tr("Unlimited")); - timeoutBox->setSuffix(tr(" s")); + timeoutBox->setSuffix(tr(" seconds")); layout->addWidget(timeoutBox); - layout->addStretch(1); + layout->addStretch(20); connect(enabledBox, SIGNAL(toggled(bool)), SLOT(widgetChanged())); + connect(enabledBox, SIGNAL(toggled(bool)), timeoutBox, SLOT(setEnabled(bool))); connect(timeoutBox, SIGNAL(valueChanged(int)), SLOT(widgetChanged())); }