MCPcopy Create free account
hub / github.com/ElementsProject/elements / Notificator

Method Notificator

src/qt/notificator.cpp:30–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28#endif
29
30Notificator::Notificator(const QString &_programName, QSystemTrayIcon *_trayIcon, QWidget *_parent) :
31 QObject(_parent),
32 parent(_parent),
33 programName(_programName),
34 mode(None),
35 trayIcon(_trayIcon)
36#ifdef USE_DBUS
37 ,interface(nullptr)
38#endif
39{
40 if(_trayIcon && _trayIcon->supportsMessages())
41 {
42 mode = QSystemTray;
43 }
44#ifdef USE_DBUS
45 interface = new QDBusInterface("org.freedesktop.Notifications",
46 "/org/freedesktop/Notifications", "org.freedesktop.Notifications");
47 if(interface->isValid())
48 {
49 mode = Freedesktop;
50 }
51#endif
52#ifdef Q_OS_MAC
53 // check if users OS has support for NSUserNotification
54 if( MacNotificationHandler::instance()->hasUserNotificationCenterSupport()) {
55 mode = UserNotificationCenter;
56 }
57#endif
58}
59
60Notificator::~Notificator()
61{

Callers

nothing calls this directly

Calls 1

isValidMethod · 0.45

Tested by

no test coverage detected