aboutsummaryrefslogtreecommitdiff
path: root/tests/manual-test-snap.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2016-05-14 12:20:00 -0500
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-08-29 14:37:39 +0200
commit8e58bff9438f67066f72a28cfdf7b421f3345d1e (patch)
tree6d4cbf11ca9107dc021eff2699da88178a643be1 /tests/manual-test-snap.cpp
parentb639e39dc4a2aa82a40f0a6922577b65ff3dd35f (diff)
downloadayatana-indicator-datetime-8e58bff9438f67066f72a28cfdf7b421f3345d1e.tar.gz
ayatana-indicator-datetime-8e58bff9438f67066f72a28cfdf7b421f3345d1e.tar.bz2
ayatana-indicator-datetime-8e58bff9438f67066f72a28cfdf7b421f3345d1e.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.cpp17
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);