-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotifier.h
37 lines (31 loc) · 1.02 KB
/
notifier.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef NOTIFIER_H
#define NOTIFIER_H
#include <QObject>
#include <string>
#include <stdlib.h>
class Notifier : public QObject
{
Q_OBJECT
public:
explicit Notifier(QObject *parent = 0){}
Q_INVOKABLE void notify(QString notification){
#ifdef Q_WS_MAEMO_5
QString s("dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:'"+notification+"'");
system(s.toStdString().c_str());
#endif
}
Q_INVOKABLE void longNotify(QString notification){
#ifdef Q_WS_MAEMO_5
QString str("dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteDialog string:'"+notification+"' uint32:0 string:'OK'");
system(str.toStdString().c_str());
#endif
}
Q_INVOKABLE void minimize(){
#ifdef Q_WS_MAEMO_5
system("dbus-send --type=signal --session /com/nokia/hildon_desktop com.nokia.hildon_desktop.exit_app_view");
#endif
}
signals:
public slots:
};
#endif // NOTIFIER_H