aboutsummaryrefslogtreecommitdiff
path: root/src/snap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/snap.cpp')
-rw-r--r--src/snap.cpp12
1 files changed, 10 insertions, 2 deletions
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);