aboutsummaryrefslogtreecommitdiff
path: root/tests/manual-test-snap.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2015-03-31 18:54:04 -0500
committerCharles Kerr <charles.kerr@canonical.com>2015-03-31 18:54:04 -0500
commitfff19d70649589b81a896e4deb032a7bd4bdca1e (patch)
tree3b1db77981d5561aaec31c308c69c6dbbf9ded68 /tests/manual-test-snap.cpp
parent3c5eda144d9d83be1aef24afaa307999975ec617 (diff)
downloadayatana-indicator-datetime-fff19d70649589b81a896e4deb032a7bd4bdca1e.tar.gz
ayatana-indicator-datetime-fff19d70649589b81a896e4deb032a7bd4bdca1e.tar.bz2
ayatana-indicator-datetime-fff19d70649589b81a896e4deb032a7bd4bdca1e.zip
add an Alarm class to represent ical valarm components; change the Appointment class to hold an arbitrary number of Alarms.
Diffstat (limited to 'tests/manual-test-snap.cpp')
-rw-r--r--tests/manual-test-snap.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/manual-test-snap.cpp b/tests/manual-test-snap.cpp
index 22ef137..cbe79cd 100644
--- a/tests/manual-test-snap.cpp
+++ b/tests/manual-test-snap.cpp
@@ -67,18 +67,18 @@ int main(int argc, const char* argv[])
Appointment a;
a.color = "green";
a.summary = "Alarm";
- a.url = "alarm:///hello-world";
a.uid = "D4B57D50247291478ED31DED17FF0A9838DED402";
a.type = Appointment::UBUNTU_ALARM;
a.begin = DateTime::Local(2014, 12, 25, 0, 0, 0);
a.end = a.begin.end_of_day();
+ a.alarms.push_back(Alarm{"Alarm Text", "", a.begin, std::chrono::seconds::zero()});
auto loop = g_main_loop_new(nullptr, false);
- auto on_snooze = [loop](const Appointment& appt){
- g_message("You clicked 'Snooze' for appt url '%s'", appt.url.c_str());
+ auto on_snooze = [loop](const Appointment& appt, const Alarm&){
+ g_message("You clicked 'Snooze' for appt url '%s'", appt.summary.c_str());
g_idle_add(quit_idle, loop);
};
- auto on_ok = [loop](const Appointment&){
+ auto on_ok = [loop](const Appointment&, const Alarm&){
g_message("You clicked 'OK'");
g_idle_add(quit_idle, loop);
};
@@ -93,7 +93,7 @@ int main(int argc, const char* argv[])
auto notification_engine = std::make_shared<uin::Engine>("indicator-datetime-service");
Snap snap (notification_engine, settings);
- snap(a, on_snooze, on_ok);
+ snap(a, a.alarms.front(), on_snooze, on_ok);
g_main_loop_run(loop);
g_main_loop_unref(loop);