aboutsummaryrefslogtreecommitdiff
path: root/src/snap.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-09-02 11:16:01 -0500
committerCharles Kerr <charles.kerr@canonical.com>2014-09-02 11:16:01 -0500
commit000f91caf98706d21868e0b41e42388ef68fc9e5 (patch)
tree27b30578020a25ecbbbfb09fe3af682c9028e8f0 /src/snap.cpp
parent63493709a92c76169ad065cc3804b13dbd786537 (diff)
downloadayatana-indicator-datetime-000f91caf98706d21868e0b41e42388ef68fc9e5.tar.gz
ayatana-indicator-datetime-000f91caf98706d21868e0b41e42388ef68fc9e5.tar.bz2
ayatana-indicator-datetime-000f91caf98706d21868e0b41e42388ef68fc9e5.zip
update Snap Decisions to include snooze
Diffstat (limited to 'src/snap.cpp')
-rw-r--r--src/snap.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/snap.cpp b/src/snap.cpp
index 0b2322a..2a0fb5b 100644
--- a/src/snap.cpp
+++ b/src/snap.cpp
@@ -59,12 +59,12 @@ public:
}
void operator()(const Appointment& appointment,
- appointment_func show,
- appointment_func dismiss)
+ appointment_func snooze,
+ appointment_func ok)
{
if (!appointment.has_alarms)
{
- dismiss(appointment);
+ ok(appointment);
return;
}
@@ -98,26 +98,24 @@ public:
g_free (title);
b.set_timeout (std::chrono::duration_cast<std::chrono::seconds>(minutes));
if (interactive) {
- b.add_action ("show", _("Show"));
- b.add_action ("dismiss", _("Dismiss"));
+ b.add_action ("snooze", _("Snooze"));
+ b.add_action ("ok", _("OK"));
}
// add 'sound', 'haptic', and 'awake' objects to the capture so
// they stay alive until the closed callback is called; i.e.,
// for the lifespan of the notficiation
- b.set_closed_callback([appointment, show, dismiss, sound, awake, haptic]
+ b.set_closed_callback([appointment, snooze, ok, sound, awake, haptic]
(const std::string& action){
- if (action == "show")
- show(appointment);
+ if (action == "snooze")
+ snooze(appointment);
else
- dismiss(appointment);
+ ok(appointment);
});
const auto key = m_engine->show(b);
if (key)
m_notifications.insert (key);
- else
- show(appointment);
}
private:
@@ -177,9 +175,9 @@ Snap::~Snap()
void
Snap::operator()(const Appointment& appointment,
appointment_func show,
- appointment_func dismiss)
+ appointment_func ok)
{
- (*impl)(appointment, show, dismiss);
+ (*impl)(appointment, show, ok);
}
/***