/***************************************************************************
-* 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 *
#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();
+ _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 &)));
-
- _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);
}
}
_timeout = v.toInt();
}
-SettingsPage *TaskbarNotificationBackend::configWidget() const {
- return _configWidget;
+SettingsPage *TaskbarNotificationBackend::createConfigWidget() const {
+ return new ConfigWidget();
}
/***************************************************************************/