void HarmattanPlatformUtil::scheduleAlarm(const QString &title, int alarmInSeconds) { // Mostly copied from example given by Cristi Boian here: http://www.cristiboian.com/2012/05/setting-alarms-in-harmattan-nokia-n9.html IFDEBUG(qDebug() << "HarmattanPlatformUtil::scheduleAlarm title" << title << "alarmInSeconds" << alarmInSeconds); Maemo::Timed::Event event; event.setAttribute("APPLICATION", "ProfileMatic"); event.setAttribute("TITLE", title); event.setAttribute("PLUGIN", "libclockalarm"); event.setBootFlag(); event.setAlarmFlag(); event.setReminderFlag(); // Try to hide the snooze button - does not work event.hideSnoozeButton1(); // Hard code snooze for 10 minutes - does not work event.setTimeoutSnooze(10 * 60); // set the alarm in given amount of seconds from now - at least this seems to work event.setTicker(QDateTime::currentDateTime().toTime_t() + alarmInSeconds); // timed interface setup Maemo::Timed::Interface timedIface; if(!timedIface.isValid()) { IFDEBUG(qDebug() << "HarmattanPlatformUtil::scheduleAlarm Invalid timed interface:" << timedIface.lastError()); return; } // add the event QDBusReply<uint> reply = timedIface.add_event_sync(event); if(!reply.isValid()) { IFDEBUG(qDebug() << "HarmattanPlatformUtil::scheduleAlarm Adding event failed:" << reply.error().message()); return; } IFDEBUG(qDebug() << "HarmattanPlatformUtil::scheduleAlarm Added event with cookie" << reply.value()); }