diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2016-05-14 12:20:00 -0500 |
---|---|---|
committer | Robert Tari <robert@tari.in> | 2021-07-07 02:20:43 +0200 |
commit | 5556233b478145158f12b1a81e87bb20a7b5cff7 (patch) | |
tree | b18068bef7d8c42c8812081c8edadb5401575d22 /tests/manual-test-snap.cpp | |
parent | 8c7997ad86cffd8fb0b1578e2bc632395744d0b8 (diff) | |
download | ayatana-indicator-datetime-5556233b478145158f12b1a81e87bb20a7b5cff7.tar.gz ayatana-indicator-datetime-5556233b478145158f12b1a81e87bb20a7b5cff7.tar.bz2 ayatana-indicator-datetime-5556233b478145158f12b1a81e87bb20a7b5cff7.zip |
sync tests with previous commit's Snap::Response change
Diffstat (limited to 'tests/manual-test-snap.cpp')
-rw-r--r-- | tests/manual-test-snap.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/manual-test-snap.cpp b/tests/manual-test-snap.cpp index a0f80f2..02cbb9f 100644 --- a/tests/manual-test-snap.cpp +++ b/tests/manual-test-snap.cpp @@ -74,12 +74,14 @@ int main(int argc, const char* argv[]) a.alarms.push_back(Alarm{"Alarm Text", "", a.begin}); auto loop = g_main_loop_new(nullptr, false); - 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&, const Alarm&){ - g_message("You clicked 'OK'"); + auto on_response = [loop](const Appointment& appt, const Alarm&, const Snap::Response& response){ + const char* str {""}; + switch(response) { + case Snap::Response::ShowApp: str = "show-app"; break; + case Snap::Response::Snooze: str = "snooze"; break; + case Snap::Response::None: str = "no-action"; break; + }; + g_message("You clicked '%s' for appt url '%s'", str, appt.summary.c_str()); g_idle_add(quit_idle, loop); }; @@ -92,8 +94,9 @@ int main(int argc, const char* argv[]) settings->alarm_volume.set(volume); auto notification_engine = std::make_shared<ain::Engine>("ayatana-indicator-datetime-service"); + auto sound_builder = std::make_shared<ain::DefaultSoundBuilder>(); Snap snap (notification_engine, settings); - snap(a, a.alarms.front(), on_snooze, on_ok); + snap(a, a.alarms.front(), on_response); g_main_loop_run(loop); g_main_loop_unref(loop); |