2 #include <QMaemo5InformationBox>
4 #include <libnotify/notify.h>
7 #include "genericnotify.h"
15 /* Init libnotify library */
16 notify_init(APPLICATION_NAME);
20 void notify::notify(const QString& msg)
24 // SETUP_NOTIFICATION_TIMEOUT is in seconds
25 int timeout = 1000 * settings.value(SETUP_NOTIFICATION_TIMEOUT, SETUP_NOTIFICATION_TIMEOUT_DEFAULT).toInt();
28 QMaemo5InformationBox::information(0, msg, timeout);
30 /* Create notification */
31 NotifyNotification *notification = notify_notification_new(APPLICATION_NAME, qPrintable(msg), 0, 0);
34 notify_notification_set_timeout(notification, timeout);
36 /* Schedule notification for showing */
37 if (!notify_notification_show(notification, NULL)) {
38 qDebug("Failed to show notification");
41 /* Clean up the memory */
42 g_object_unref(notification);
44 qDebug("Failed to create notification");
48 qDebug(qPrintable(msg));