Changeset View
Changeset View
Standalone View
Standalone View
src/knotification.cpp
Show All 23 Lines | 1 | /* This file is part of the KDE libraries | |||
---|---|---|---|---|---|
24 | along with this library; see the file COPYING.LIB. If not, write to | 24 | along with this library; see the file COPYING.LIB. If not, write to | ||
25 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 25 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
26 | Boston, MA 02110-1301, USA. | 26 | Boston, MA 02110-1301, USA. | ||
27 | */ | 27 | */ | ||
28 | 28 | | |||
29 | #include "knotification.h" | 29 | #include "knotification.h" | ||
30 | #include "knotificationmanager_p.h" | 30 | #include "knotificationmanager_p.h" | ||
31 | 31 | | |||
32 | #include <kwindowsystem.h> | | |||
33 | | ||||
34 | #include <QCoreApplication> | 32 | #include <QCoreApplication> | ||
35 | 33 | | |||
36 | #include <QPixmap> | 34 | #include <QPixmap> | ||
37 | #include <QTimer> | 35 | #include <QTimer> | ||
38 | #include <QTabWidget> | 36 | #include <QTabWidget> | ||
39 | #include <QStringList> | 37 | #include <QStringList> | ||
40 | #include <QUrl> | 38 | #include <QUrl> | ||
41 | 39 | | |||
▲ Show 20 Lines • Show All 309 Lines • ▼ Show 20 Line(s) | 344 | { | |||
351 | Private::raiseWidget(d->widget); | 349 | Private::raiseWidget(d->widget); | ||
352 | } | 350 | } | ||
353 | 351 | | |||
354 | void KNotification::Private::raiseWidget(QWidget *w) | 352 | void KNotification::Private::raiseWidget(QWidget *w) | ||
355 | { | 353 | { | ||
356 | //TODO this function is far from finished. | 354 | //TODO this function is far from finished. | ||
357 | if (w->isTopLevel()) { | 355 | if (w->isTopLevel()) { | ||
358 | w->raise(); | 356 | w->raise(); | ||
359 | KWindowSystem::activateWindow(w->winId()); | | |||
360 | #if defined(Q_OS_MACOS) | | |||
361 | w->activateWindow(); | 357 | w->activateWindow(); | ||
362 | #endif | | |||
363 | } else { | 358 | } else { | ||
364 | QWidget *pw = w->parentWidget(); | 359 | QWidget *pw = w->parentWidget(); | ||
365 | raiseWidget(pw); | 360 | raiseWidget(pw); | ||
366 | 361 | | |||
367 | if (QTabWidget *tab_widget = qobject_cast<QTabWidget *>(pw)) { | 362 | if (QTabWidget *tab_widget = qobject_cast<QTabWidget *>(pw)) { | ||
368 | tab_widget->setCurrentIndex(tab_widget->indexOf(w)); | 363 | tab_widget->setCurrentIndex(tab_widget->indexOf(w)); | ||
369 | } | 364 | } | ||
370 | } | 365 | } | ||
▲ Show 20 Lines • Show All 205 Lines • Show Last 20 Lines |