From bb7b522ef52b240718f33f37b577bacc4fea2db6 Mon Sep 17 00:00:00 2001 From: Renato Araujo Oliveira Filho Date: Mon, 18 Apr 2016 23:42:53 -0300 Subject: Post message on messaging menu if the notification get timeout. --- src/snap.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/snap.cpp') diff --git a/src/snap.cpp b/src/snap.cpp index 259592e..5c530be 100644 --- a/src/snap.cpp +++ b/src/snap.cpp @@ -122,8 +122,9 @@ public: const auto minutes = std::chrono::minutes(m_settings->alarm_duration.get()); ain::Builder b; b.set_body (appointment.summary); - b.set_icon_name (appointment.is_ubuntu_alarm() ? "alarm-clock" : "reminder"); + b.set_icon_name (appointment.is_ubuntu_alarm() ? "alarm-clock" : "appointment"); b.add_hint (ain::Builder::HINT_NONSHAPED_ICON); + b.set_start_time (appointment.begin.to_unix()); const char * timefmt; if (is_locale_12h()) { @@ -152,6 +153,9 @@ public: b.add_hint (ain::Builder::HINT_AFFIRMATIVE_HINT); b.add_action ("ok", _("OK")); b.add_action ("snooze", _("Snooze")); + } else { + b.add_hint (ain::Builder::HINT_INTERACTIVE); + b.add_action ("ok", _("OK")); } // add 'sound', 'haptic', and 'awake' objects to the capture so @@ -161,10 +165,14 @@ public: (const std::string& action){ if (action == "snooze") snooze(appointment, alarm); - else + else if (action == "ok") ok(appointment, alarm); }); + b.set_missed_click_callback([appointment, alarm, ok](){ + ok(appointment, alarm); + }); + const auto key = m_engine->show(b); if (key) m_notifications.insert (key); -- cgit v1.2.3