aboutsummaryrefslogtreecommitdiff
path: root/src/snap.cpp
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@canonical.com>2016-04-18 23:42:53 -0300
committerRobert Tari <robert@tari.in>2021-07-06 02:02:52 +0200
commit13978702ac61845927889986310085e8f90821da (patch)
tree52206cc20546f4f1e8bf707e8463ad52f012c8e8 /src/snap.cpp
parent442818a849f468649121d19adfc0d3589387dda0 (diff)
downloadayatana-indicator-datetime-13978702ac61845927889986310085e8f90821da.tar.gz
ayatana-indicator-datetime-13978702ac61845927889986310085e8f90821da.tar.bz2
ayatana-indicator-datetime-13978702ac61845927889986310085e8f90821da.zip
Post message on messaging menu if the notification get timeout.
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);