Changeset View
Changeset View
Standalone View
Standalone View
kded/notification.cpp
Show All 24 Lines | |||||
25 | #include "notification.h" | 25 | #include "notification.h" | ||
26 | 26 | | |||
27 | #include <uiutils.h> | 27 | #include <uiutils.h> | ||
28 | 28 | | |||
29 | #include <NetworkManagerQt/Manager> | 29 | #include <NetworkManagerQt/Manager> | ||
30 | 30 | | |||
31 | #include <KLocalizedString> | 31 | #include <KLocalizedString> | ||
32 | #include <KNotification> | 32 | #include <KNotification> | ||
33 | #include <KIconLoader> | | |||
34 | 33 | | |||
35 | #include <QDBusConnection> | 34 | #include <QDBusConnection> | ||
36 | #include <QIcon> | 35 | #include <QIcon> | ||
37 | #include <QTimer> | 36 | #include <QTimer> | ||
38 | 37 | | |||
39 | Notification::Notification(QObject *parent) : | 38 | Notification::Notification(QObject *parent) : | ||
40 | QObject(parent) | 39 | QObject(parent) | ||
41 | { | 40 | { | ||
▲ Show 20 Lines • Show All 289 Lines • ▼ Show 20 Line(s) | 329 | if (m_notifications.contains(device->uni())) { | |||
331 | KNotification *notify = m_notifications.value(device->uni()); | 330 | KNotification *notify = m_notifications.value(device->uni()); | ||
332 | notify->setText(text); | 331 | notify->setText(text); | ||
333 | notify->update(); | 332 | notify->update(); | ||
334 | } else { | 333 | } else { | ||
335 | KNotification *notify = new KNotification(QStringLiteral("DeviceFailed"), KNotification::CloseOnTimeout, this); | 334 | KNotification *notify = new KNotification(QStringLiteral("DeviceFailed"), KNotification::CloseOnTimeout, this); | ||
336 | connect(notify, &KNotification::closed, this, &Notification::notificationClosed); | 335 | connect(notify, &KNotification::closed, this, &Notification::notificationClosed); | ||
337 | notify->setProperty("uni", device->uni()); | 336 | notify->setProperty("uni", device->uni()); | ||
338 | notify->setComponentName(QStringLiteral("networkmanagement")); | 337 | notify->setComponentName(QStringLiteral("networkmanagement")); | ||
339 | notify->setPixmap(QIcon::fromTheme(QStringLiteral("dialog-warning")).pixmap(KIconLoader::SizeHuge)); | 338 | notify->setIconName(QStringLiteral("dialog-warning")); | ||
340 | notify->setTitle(identifier); | 339 | notify->setTitle(identifier); | ||
341 | notify->setText(text); | 340 | notify->setText(text); | ||
342 | notify->sendEvent(); | 341 | notify->sendEvent(); | ||
343 | if (notify->id() != -1) { | 342 | if (notify->id() != -1) { | ||
344 | m_notifications[device->uni()] = notify; | 343 | m_notifications[device->uni()] = notify; | ||
345 | } | 344 | } | ||
346 | } | 345 | } | ||
347 | } | 346 | } | ||
▲ Show 20 Lines • Show All 250 Lines • Show Last 20 Lines |