2014-11-13 01:04:59 +02:00
|
|
|
/* This file is part of the KDE libraries
|
|
|
|
Copyright (C) 2005-2006 Olivier Goffart <ogoffart at kde.org>
|
|
|
|
|
|
|
|
code from KNotify/KNotifyClient
|
|
|
|
Copyright (c) 1997 Christian Esken (esken@kde.org)
|
|
|
|
2000 Charles Samuels (charles@kde.org)
|
|
|
|
2000 Stefan Schimanski (1Stein@gmx.de)
|
|
|
|
2000 Matthias Ettrich (ettrich@kde.org)
|
|
|
|
2000 Waldo Bastian <bastian@kde.org>
|
|
|
|
2000-2003 Carsten Pfeiffer <pfeiffer@kde.org>
|
|
|
|
2005 Allan Sandfeld Jensen <kde@carewolf.com>
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
License version 2 as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
This library 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
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public License
|
|
|
|
along with this library; see the file COPYING.LIB. If not, write to
|
|
|
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "knotification.h"
|
|
|
|
#include "knotificationmanager_p.h"
|
|
|
|
|
|
|
|
#include <kmessagebox.h>
|
|
|
|
#include <klocale.h>
|
|
|
|
#include <kiconloader.h>
|
|
|
|
#include <kconfig.h>
|
|
|
|
#include <kpassivepopup.h>
|
|
|
|
#include <kdialog.h>
|
|
|
|
#include <kwindowsystem.h>
|
|
|
|
#include <kdebug.h>
|
|
|
|
#include <kapplication.h>
|
|
|
|
|
|
|
|
#include <QTimer>
|
|
|
|
#include <QTabWidget>
|
|
|
|
#include <QDBusError>
|
|
|
|
|
|
|
|
struct KNotification::Private
|
|
|
|
{
|
|
|
|
QString eventId;
|
|
|
|
int id;
|
|
|
|
int ref;
|
|
|
|
|
|
|
|
QWidget *widget;
|
|
|
|
QString title;
|
|
|
|
QString text;
|
|
|
|
QStringList actions;
|
|
|
|
QPixmap pixmap;
|
|
|
|
ContextList contexts;
|
|
|
|
NotificationFlags flags;
|
|
|
|
KComponentData componentData;
|
|
|
|
|
|
|
|
QTimer updateTimer;
|
|
|
|
bool needUpdate;
|
|
|
|
|
|
|
|
Private() : id(0), ref(1), widget(0l), needUpdate(false) {}
|
|
|
|
/**
|
|
|
|
* recursive function that raise the widget. @p w
|
|
|
|
*
|
|
|
|
* @see raiseWidget()
|
|
|
|
*/
|
|
|
|
static void raiseWidget(QWidget *w);
|
|
|
|
};
|
|
|
|
|
2022-09-27 09:49:21 +03:00
|
|
|
KNotification::KNotification(const QString &eventId, QWidget *parent, const NotificationFlags &flags)
|
|
|
|
: QObject(parent),
|
|
|
|
d(new Private)
|
2014-11-13 01:04:59 +02:00
|
|
|
{
|
2022-09-27 09:49:21 +03:00
|
|
|
d->eventId = eventId;
|
|
|
|
d->flags = flags;
|
2015-09-22 10:34:04 +00:00
|
|
|
setWidget(parent);
|
|
|
|
connect(&d->updateTimer,SIGNAL(timeout()), this, SLOT(update()));
|
|
|
|
d->updateTimer.setSingleShot(true);
|
|
|
|
d->updateTimer.setInterval(100);
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
2022-09-27 09:49:21 +03:00
|
|
|
KNotification::KNotification( const QString& eventId, const NotificationFlags& flags, QObject *parent)
|
|
|
|
: QObject(parent),
|
|
|
|
d(new Private)
|
2014-11-13 01:04:59 +02:00
|
|
|
{
|
2022-09-27 10:10:44 +03:00
|
|
|
d->eventId = eventId;
|
2022-09-27 09:49:21 +03:00
|
|
|
d->flags = flags;
|
2015-09-22 10:34:04 +00:00
|
|
|
connect(&d->updateTimer,SIGNAL(timeout()), this, SLOT(update()));
|
|
|
|
d->updateTimer.setSingleShot(true);
|
|
|
|
d->updateTimer.setInterval(100);
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
KNotification::~KNotification()
|
|
|
|
{
|
2022-09-27 10:10:44 +03:00
|
|
|
if (d->id > 0) {
|
2022-09-27 09:49:21 +03:00
|
|
|
KNotificationManager::self()->close(d->id);
|
|
|
|
}
|
2015-09-22 10:34:04 +00:00
|
|
|
delete d;
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
QString KNotification::eventId() const
|
|
|
|
{
|
2015-09-22 10:34:04 +00:00
|
|
|
return d->eventId;
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
QString KNotification::title() const
|
|
|
|
{
|
|
|
|
return d->title;
|
|
|
|
}
|
|
|
|
|
|
|
|
QString KNotification::text() const
|
|
|
|
{
|
2015-09-22 10:34:04 +00:00
|
|
|
return d->text;
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
QWidget *KNotification::widget() const
|
|
|
|
{
|
2015-09-22 10:34:04 +00:00
|
|
|
return d->widget;
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void KNotification::setWidget(QWidget *wid)
|
|
|
|
{
|
|
|
|
d->widget = wid;
|
|
|
|
setParent(wid);
|
2022-09-27 09:49:21 +03:00
|
|
|
if (wid && (d->flags & CloseWhenWidgetActivated)) {
|
2014-11-13 01:04:59 +02:00
|
|
|
wid->installEventFilter(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void KNotification::setTitle(const QString &title)
|
|
|
|
{
|
|
|
|
d->needUpdate = true;
|
|
|
|
d->title = title;
|
2022-09-27 09:49:21 +03:00
|
|
|
if (d->id > 0) {
|
2014-11-13 01:04:59 +02:00
|
|
|
d->updateTimer.start();
|
2022-09-27 09:49:21 +03:00
|
|
|
}
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void KNotification::setText(const QString &text)
|
|
|
|
{
|
|
|
|
d->needUpdate = true;
|
2022-09-27 10:10:44 +03:00
|
|
|
d->text = text;
|
2022-09-27 09:49:21 +03:00
|
|
|
if (d->id > 0) {
|
2015-09-22 10:34:04 +00:00
|
|
|
d->updateTimer.start();
|
2022-09-27 09:49:21 +03:00
|
|
|
}
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
QPixmap KNotification::pixmap() const
|
|
|
|
{
|
2015-09-22 10:34:04 +00:00
|
|
|
return d->pixmap;
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void KNotification::setPixmap(const QPixmap &pix)
|
|
|
|
{
|
|
|
|
d->needUpdate = true;
|
2022-09-27 09:49:21 +03:00
|
|
|
d->pixmap = pix;
|
|
|
|
if (d->id > 0) {
|
2015-09-22 10:34:04 +00:00
|
|
|
d->updateTimer.start();
|
2022-09-27 09:49:21 +03:00
|
|
|
}
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
QStringList KNotification::actions() const
|
|
|
|
{
|
2015-09-22 10:34:04 +00:00
|
|
|
return d->actions;
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
2022-09-27 09:49:21 +03:00
|
|
|
void KNotification::setActions(const QStringList &as)
|
2014-11-13 01:04:59 +02:00
|
|
|
{
|
|
|
|
d->needUpdate = true;
|
2022-09-27 09:49:21 +03:00
|
|
|
d->actions = as;
|
|
|
|
if (d->id > 0) {
|
2015-09-22 10:34:04 +00:00
|
|
|
d->updateTimer.start();
|
2022-09-27 09:49:21 +03:00
|
|
|
}
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
KNotification::ContextList KNotification::contexts() const
|
|
|
|
{
|
2015-09-22 10:34:04 +00:00
|
|
|
return d->contexts;
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
2022-09-27 09:49:21 +03:00
|
|
|
void KNotification::setContexts(const KNotification::ContextList &contexts)
|
2014-11-13 01:04:59 +02:00
|
|
|
{
|
2022-09-27 09:49:21 +03:00
|
|
|
d->contexts = contexts;
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
2022-09-27 09:49:21 +03:00
|
|
|
void KNotification::addContext(const KNotification::Context &context)
|
2014-11-13 01:04:59 +02:00
|
|
|
{
|
2015-09-22 10:34:04 +00:00
|
|
|
d->contexts << context;
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
2022-09-27 09:49:21 +03:00
|
|
|
void KNotification::addContext(const QString &context_key, const QString &context_value)
|
2014-11-13 01:04:59 +02:00
|
|
|
{
|
2022-09-27 09:49:21 +03:00
|
|
|
d->contexts << qMakePair(context_key , context_value);
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
KNotification::NotificationFlags KNotification::flags() const
|
|
|
|
{
|
|
|
|
return d->flags;
|
|
|
|
}
|
|
|
|
|
2022-09-27 09:49:21 +03:00
|
|
|
void KNotification::setFlags(const NotificationFlags &flags)
|
2014-11-13 01:04:59 +02:00
|
|
|
{
|
2022-09-27 09:49:21 +03:00
|
|
|
d->flags = flags;
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void KNotification::setComponentData(const KComponentData &c)
|
|
|
|
{
|
|
|
|
d->componentData = c;
|
|
|
|
}
|
|
|
|
|
|
|
|
void KNotification::activate(unsigned int action)
|
|
|
|
{
|
2022-09-27 10:10:44 +03:00
|
|
|
switch (action) {
|
|
|
|
case 0: {
|
2014-11-13 01:04:59 +02:00
|
|
|
emit activated();
|
|
|
|
break;
|
2022-09-27 10:10:44 +03:00
|
|
|
}
|
|
|
|
case 1: {
|
2014-11-13 01:04:59 +02:00
|
|
|
emit action1Activated();
|
|
|
|
break;
|
2022-09-27 10:10:44 +03:00
|
|
|
}
|
|
|
|
case 2: {
|
2014-11-13 01:04:59 +02:00
|
|
|
emit action2Activated();
|
|
|
|
break;
|
2022-09-27 10:10:44 +03:00
|
|
|
}
|
|
|
|
case 3: {
|
2014-11-13 01:04:59 +02:00
|
|
|
emit action3Activated();
|
|
|
|
break;
|
2022-09-27 10:10:44 +03:00
|
|
|
}
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
2015-09-22 10:34:04 +00:00
|
|
|
emit activated(action);
|
2022-09-27 09:49:21 +03:00
|
|
|
if (d->id != -1) {
|
2015-09-22 10:34:04 +00:00
|
|
|
deleteLater();
|
2022-09-27 09:49:21 +03:00
|
|
|
}
|
2015-09-22 10:34:04 +00:00
|
|
|
d->id = -2;
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KNotification::close()
|
|
|
|
{
|
2022-09-27 09:49:21 +03:00
|
|
|
if (d->id >= 0) {
|
|
|
|
KNotificationManager::self()->close(d->id);
|
|
|
|
}
|
|
|
|
if (d->id != -1) { // still waiting for receiving the id
|
2015-09-22 10:34:04 +00:00
|
|
|
deleteLater();
|
2022-09-27 09:49:21 +03:00
|
|
|
}
|
2015-09-22 10:34:04 +00:00
|
|
|
d->id = -2;
|
|
|
|
emit closed();
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KNotification::raiseWidget()
|
|
|
|
{
|
2022-09-27 09:49:21 +03:00
|
|
|
if (!d->widget) {
|
2014-11-13 01:04:59 +02:00
|
|
|
return;
|
|
|
|
}
|
2022-09-27 09:49:21 +03:00
|
|
|
Private::raiseWidget(d->widget);
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void KNotification::Private::raiseWidget(QWidget *w)
|
|
|
|
{
|
2015-09-22 10:34:04 +00:00
|
|
|
//TODO this function is far from finished.
|
2022-09-27 09:49:21 +03:00
|
|
|
if (w->isTopLevel()) {
|
2015-09-22 10:34:04 +00:00
|
|
|
w->raise();
|
2022-09-27 09:49:21 +03:00
|
|
|
KWindowSystem::activateWindow(w->winId());
|
|
|
|
} else {
|
|
|
|
QWidget *pw = w->parentWidget();
|
2015-09-22 10:34:04 +00:00
|
|
|
raiseWidget(pw);
|
2014-11-13 01:04:59 +02:00
|
|
|
|
2022-09-27 09:49:21 +03:00
|
|
|
if (QTabWidget *tab_widget = qobject_cast<QTabWidget*>(pw)) {
|
2015-09-22 10:34:04 +00:00
|
|
|
tab_widget->setCurrentIndex(tab_widget->indexOf(w));
|
|
|
|
}
|
|
|
|
}
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
2023-08-23 15:53:28 +03:00
|
|
|
KNotification* KNotification::event(const QString &eventid , const QString &title, const QString &text,
|
|
|
|
const QPixmap &pixmap, QWidget *widget, const NotificationFlags &flags,
|
|
|
|
const KComponentData &componentData)
|
2014-11-13 01:04:59 +02:00
|
|
|
{
|
2022-09-27 09:49:21 +03:00
|
|
|
KNotification *notify = new KNotification(eventid, widget, flags);
|
2015-09-22 10:34:04 +00:00
|
|
|
notify->setTitle(title);
|
|
|
|
notify->setText(text);
|
|
|
|
notify->setPixmap(pixmap);
|
|
|
|
notify->setComponentData(componentData);
|
2022-09-27 09:49:21 +03:00
|
|
|
QTimer::singleShot(0, notify, SLOT(sendEvent()));
|
2015-09-22 10:34:04 +00:00
|
|
|
return notify;
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
2023-08-23 15:53:28 +03:00
|
|
|
KNotification* KNotification::event(const QString &eventid, const QString &text,
|
|
|
|
const QPixmap &pixmap, QWidget *widget, const NotificationFlags &flags,
|
|
|
|
const KComponentData &componentData)
|
2014-11-13 01:04:59 +02:00
|
|
|
{
|
2022-09-27 09:49:21 +03:00
|
|
|
return event(eventid, QString(), text, pixmap, widget, flags, componentData);
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-08-23 15:53:28 +03:00
|
|
|
KNotification* KNotification::event(StandardEvent eventid , const QString &title, const QString &text,
|
|
|
|
const QPixmap &pixmap, QWidget *widget, const NotificationFlags &flags)
|
2015-09-22 10:34:04 +00:00
|
|
|
{
|
|
|
|
QString message;
|
2022-09-27 09:49:21 +03:00
|
|
|
switch (eventid) {
|
|
|
|
case Warning: {
|
2015-09-22 10:34:04 +00:00
|
|
|
message = QLatin1String("warning");
|
|
|
|
break;
|
2022-09-27 09:49:21 +03:00
|
|
|
}
|
|
|
|
case Error: {
|
2015-09-22 10:34:04 +00:00
|
|
|
message = QLatin1String("fatalerror");
|
|
|
|
break;
|
2022-09-27 09:49:21 +03:00
|
|
|
}
|
|
|
|
case Catastrophe: {
|
2015-09-22 10:34:04 +00:00
|
|
|
message = QLatin1String("catastrophe");
|
|
|
|
break;
|
2022-09-27 09:49:21 +03:00
|
|
|
}
|
|
|
|
case Notification: { // fall through
|
2015-09-22 10:34:04 +00:00
|
|
|
default:
|
|
|
|
message = QLatin1String("notification");
|
|
|
|
break;
|
2022-09-27 09:49:21 +03:00
|
|
|
}
|
2015-09-22 10:34:04 +00:00
|
|
|
}
|
2022-09-27 09:49:21 +03:00
|
|
|
return event(message, title, text, pixmap, widget, flags | DefaultEvent);
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
2022-09-27 10:10:44 +03:00
|
|
|
KNotification *KNotification::event(StandardEvent eventid, const QString &text,
|
2023-08-23 15:53:28 +03:00
|
|
|
const QPixmap &pixmap, QWidget *widget, const NotificationFlags &flags)
|
2014-11-13 01:04:59 +02:00
|
|
|
{
|
2022-09-27 09:49:21 +03:00
|
|
|
return event(eventid, QString(), text, pixmap, widget , flags);
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void KNotification::ref()
|
|
|
|
{
|
2015-09-22 10:34:04 +00:00
|
|
|
d->ref++;
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void KNotification::deref()
|
|
|
|
{
|
2015-09-22 10:34:04 +00:00
|
|
|
d->ref--;
|
2022-09-27 09:49:21 +03:00
|
|
|
if (d->ref == 0) {
|
2015-09-22 10:34:04 +00:00
|
|
|
close();
|
2022-09-27 09:49:21 +03:00
|
|
|
}
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
2022-09-27 09:49:21 +03:00
|
|
|
void KNotification::beep(const QString &reason, QWidget *widget)
|
2014-11-13 01:04:59 +02:00
|
|
|
{
|
2022-09-27 09:49:21 +03:00
|
|
|
event(QLatin1String("beep"), reason, QPixmap(), widget, CloseOnTimeout | DefaultEvent);
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void KNotification::sendEvent()
|
|
|
|
{
|
|
|
|
d->needUpdate = false;
|
2022-09-27 09:49:21 +03:00
|
|
|
if (d->id == 0) {
|
2015-09-22 10:34:04 +00:00
|
|
|
QString appname;
|
2022-09-27 09:49:21 +03:00
|
|
|
if (d->flags & DefaultEvent) {
|
2015-09-22 10:34:04 +00:00
|
|
|
appname = QLatin1String("kde");
|
2022-09-27 09:49:21 +03:00
|
|
|
} else if(d->componentData.isValid()) {
|
2015-09-22 10:34:04 +00:00
|
|
|
appname = d->componentData.componentName();
|
|
|
|
} else {
|
|
|
|
appname = KGlobal::mainComponent().componentName();
|
|
|
|
}
|
|
|
|
|
2022-09-27 10:10:44 +03:00
|
|
|
if (KNotificationManager::self()->notify(this, d->pixmap, d->actions, d->contexts, appname)) {
|
2015-09-22 10:34:04 +00:00
|
|
|
d->id = -1;
|
2022-09-27 09:49:21 +03:00
|
|
|
}
|
|
|
|
} else if (d->id > 0) {
|
2022-09-27 10:10:44 +03:00
|
|
|
KNotificationManager::self()->reemit(this, d->id);
|
2022-09-27 09:49:21 +03:00
|
|
|
} else if (d->id == -1) {
|
2014-11-13 01:04:59 +02:00
|
|
|
//schedule an update.
|
|
|
|
d->needUpdate = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void KNotification::slotReceivedId(int id)
|
|
|
|
{
|
2022-09-27 09:49:21 +03:00
|
|
|
if (d->id == -2) { //we are already closed
|
|
|
|
KNotificationManager::self()->close(id, /*force=*/ true);
|
2015-09-22 10:34:04 +00:00
|
|
|
deleteLater();
|
|
|
|
return;
|
|
|
|
}
|
2022-09-27 09:49:21 +03:00
|
|
|
d->id = id;
|
2022-09-27 10:10:44 +03:00
|
|
|
if (d->id > 0) {
|
|
|
|
KNotificationManager::self()->insert(this, d->id);
|
|
|
|
if (d->needUpdate) {
|
2014-11-13 01:04:59 +02:00
|
|
|
sendEvent();
|
2022-09-27 10:10:44 +03:00
|
|
|
}
|
2022-09-27 09:49:21 +03:00
|
|
|
} else {
|
2015-09-22 10:34:04 +00:00
|
|
|
//if there is no presentation, delete the object
|
|
|
|
QTimer::singleShot(0, this, SLOT(deref()));
|
|
|
|
}
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
2022-09-27 09:49:21 +03:00
|
|
|
void KNotification::slotReceivedIdError(const QDBusError &error)
|
2014-11-13 01:04:59 +02:00
|
|
|
{
|
2022-09-27 09:49:21 +03:00
|
|
|
if (d->id == -2) { //we are already closed
|
2015-09-22 10:34:04 +00:00
|
|
|
deleteLater();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
kWarning(299) << "Error while contacting notify daemon" << error.message();
|
|
|
|
d->id = -3;
|
|
|
|
QTimer::singleShot(0, this, SLOT(deref()));
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KNotification::update()
|
|
|
|
{
|
2022-09-27 09:49:21 +03:00
|
|
|
KNotificationManager::self()->update(this, d->id);
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
2022-09-27 09:49:21 +03:00
|
|
|
bool KNotification::eventFilter(QObject *watched, QEvent *event)
|
2014-11-13 01:04:59 +02:00
|
|
|
{
|
2022-09-27 09:49:21 +03:00
|
|
|
if (watched == d->widget) {
|
|
|
|
if (event->type() == QEvent::WindowActivate) {
|
2022-09-27 10:10:44 +03:00
|
|
|
if (d->flags & CloseWhenWidgetActivated) {
|
2015-09-22 10:34:04 +00:00
|
|
|
QTimer::singleShot(500, this, SLOT(close()));
|
2022-09-27 09:49:21 +03:00
|
|
|
}
|
2015-09-22 10:34:04 +00:00
|
|
|
}
|
2022-09-27 09:49:21 +03:00
|
|
|
// kDebug(299) << event->type();
|
2015-09-22 10:34:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2014-11-13 01:04:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-02-27 07:40:26 +00:00
|
|
|
#include "moc_knotification.cpp"
|