diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-10-28 08:20:13 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-10-28 08:20:13 +0200 |
commit | 97cc3bfbcba9cbbf612f4c7e04b974816adae3e2 (patch) | |
tree | d35fc8583d82f4825a5da9fd0ebc4a7dc9e6bb70 | |
parent | 2a52d61b410b9d294c479ad53a06fb6f830b9605 (diff) | |
parent | 0492e95dbf6a1f6285a4701379adb6b7d8553d6b (diff) | |
download | ayatana-indicator-datetime-97cc3bfbcba9cbbf612f4c7e04b974816adae3e2.tar.gz ayatana-indicator-datetime-97cc3bfbcba9cbbf612f4c7e04b974816adae3e2.tar.bz2 ayatana-indicator-datetime-97cc3bfbcba9cbbf612f4c7e04b974816adae3e2.zip |
Merge branch 'tari01-pr/ubuntu-alarm'
Attributes GH PR #64: https://github.com/AyatanaIndicators/ayatana-indicator-datetime/pull/64
-rw-r--r-- | include/datetime/appointment.h | 6 | ||||
-rw-r--r-- | include/datetime/engine-eds.h | 4 | ||||
-rw-r--r-- | include/datetime/engine-mock.h | 4 | ||||
-rw-r--r-- | include/datetime/engine.h | 4 | ||||
-rw-r--r-- | src/actions-live.cpp | 4 | ||||
-rw-r--r-- | src/engine-eds.cpp | 12 | ||||
-rw-r--r-- | src/main.cpp | 4 | ||||
-rw-r--r-- | src/menu.cpp | 10 | ||||
-rw-r--r-- | src/snap.cpp | 30 | ||||
-rw-r--r-- | tests/manual-test-snap.cpp | 4 | ||||
-rw-r--r-- | tests/notification-fixture.h | 6 | ||||
-rw-r--r-- | tests/test-actions.cpp | 4 | ||||
-rw-r--r-- | tests/test-alarm-queue.cpp | 6 | ||||
-rw-r--r-- | tests/test-eds-ics-missing-trigger.cpp | 2 | ||||
-rw-r--r-- | tests/test-live-actions.cpp | 4 | ||||
-rw-r--r-- | tests/test-menu-appointments.cpp | 12 | ||||
-rw-r--r-- | tests/test-menus.cpp | 8 | ||||
-rw-r--r-- | tests/test-notification.cpp | 10 |
18 files changed, 83 insertions, 51 deletions
diff --git a/include/datetime/appointment.h b/include/datetime/appointment.h index faf8a18..c563f33 100644 --- a/include/datetime/appointment.h +++ b/include/datetime/appointment.h @@ -1,5 +1,6 @@ /* * Copyright 2013 Canonical Ltd. + * Copyright 2021 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -15,6 +16,7 @@ * * Authors: * Charles Kerr <charles.kerr@canonical.com> + * Robert Tari <robert@tari.in> */ #ifndef INDICATOR_DATETIME_APPOINTMENT_H @@ -51,9 +53,9 @@ struct Alarm struct Appointment { public: - enum Type { EVENT, UBUNTU_ALARM }; + enum Type { EVENT, ALARM }; Type type = EVENT; - bool is_ubuntu_alarm() const { return type == UBUNTU_ALARM; } + bool is_alarm() const { return type == ALARM; } std::string uid; std::string source_uid; diff --git a/include/datetime/engine-eds.h b/include/datetime/engine-eds.h index 96b0f76..b4a9df6 100644 --- a/include/datetime/engine-eds.h +++ b/include/datetime/engine-eds.h @@ -1,5 +1,6 @@ /* * Copyright 2014 Canonical Ltd. + * Copyright 2021 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -15,6 +16,7 @@ * * Authors: * Charles Kerr <charles.kerr@canonical.com> + * Robert Tari <robert@tari.in> */ #ifndef INDICATOR_DATETIME_ENGINE_EDS_H @@ -54,7 +56,7 @@ public: const DateTime& end, const Timezone& default_timezone, std::function<void(const std::vector<Appointment>&)> appointment_func) override; - void disable_ubuntu_alarm(const Appointment&) override; + void disable_alarm(const Appointment&) override; core::Signal<>& changed() override; diff --git a/include/datetime/engine-mock.h b/include/datetime/engine-mock.h index 0bee29c..8ffe8bd 100644 --- a/include/datetime/engine-mock.h +++ b/include/datetime/engine-mock.h @@ -1,5 +1,6 @@ /* * Copyright 2014 Canonical Ltd. + * Copyright 2021 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -15,6 +16,7 @@ * * Authors: * Charles Kerr <charles.kerr@canonical.com> + * Robert Tari <robert@tari.in> */ #ifndef INDICATOR_DATETIME_ENGINE_MOCK_H @@ -52,7 +54,7 @@ public: return m_changed; } - void disable_ubuntu_alarm(const Appointment&) override { + void disable_alarm(const Appointment&) override { } private: diff --git a/include/datetime/engine.h b/include/datetime/engine.h index 91145fa..efbfcbf 100644 --- a/include/datetime/engine.h +++ b/include/datetime/engine.h @@ -1,5 +1,6 @@ /* * Copyright 2014 Canonical Ltd. + * Copyright 2021 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -15,6 +16,7 @@ * * Authors: * Charles Kerr <charles.kerr@canonical.com> + * Robert Tari <robert@tari.in> */ #ifndef INDICATOR_DATETIME_ENGINE_H @@ -50,7 +52,7 @@ public: const DateTime& end, const Timezone& default_timezone, std::function<void(const std::vector<Appointment>&)> appointment_func) =0; - virtual void disable_ubuntu_alarm(const Appointment&) =0; + virtual void disable_alarm(const Appointment&) =0; virtual core::Signal<>& changed() =0; diff --git a/src/actions-live.cpp b/src/actions-live.cpp index 50add68..81bdb70 100644 --- a/src/actions-live.cpp +++ b/src/actions-live.cpp @@ -1,5 +1,6 @@ /* * Copyright 2013 Canonical Ltd. + * Copyright 2021 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -15,6 +16,7 @@ * * Authors: * Charles Kerr <charles.kerr@canonical.com> + * Robert Tari <robert@tari.in> */ #include <datetime/dbus-shared.h> @@ -155,7 +157,7 @@ std::string LiveActions::open_appointment(const Appointment& appt, const DateTim } else switch (appt.type) { - case Appointment::UBUNTU_ALARM: + case Appointment::ALARM: sReturn = open_alarm_app(); break; diff --git a/src/engine-eds.cpp b/src/engine-eds.cpp index af11f7f..b0a1a0d 100644 --- a/src/engine-eds.cpp +++ b/src/engine-eds.cpp @@ -139,9 +139,9 @@ public: } } - void disable_ubuntu_alarm(const Appointment& appointment) + void disable_alarm(const Appointment& appointment) { - if (appointment.is_ubuntu_alarm()) + if (appointment.is_alarm()) { for (auto& kv : m_clients) // find the matching icalcomponent { @@ -1081,7 +1081,7 @@ private: for (GSList * l=categ_list; l!=nullptr; l=l->next) { auto tag = static_cast<const char*>(l->data); if (!g_strcmp0(tag, TAG_ALARM)) - baseline.type = Appointment::UBUNTU_ALARM; + baseline.type = Appointment::ALARM; } g_slist_free_full(categ_list, g_free); @@ -1141,7 +1141,7 @@ private: alarm.text = get_alarm_text(a); if (alarm.audio_url.empty()) - alarm.audio_url = get_alarm_sound_url(a, (baseline.is_ubuntu_alarm() ? + alarm.audio_url = get_alarm_sound_url(a, (baseline.is_alarm() ? "file://" ALARM_DEFAULT_SOUND : "file://" CALENDAR_DEFAULT_SOUND)); @@ -1280,9 +1280,9 @@ void EdsEngine::get_appointments(const DateTime& begin, p->get_appointments(begin, end, tz, func); } -void EdsEngine::disable_ubuntu_alarm(const Appointment& appointment) +void EdsEngine::disable_alarm(const Appointment& appointment) { - p->disable_ubuntu_alarm(appointment); + p->disable_alarm(appointment); } /*** diff --git a/src/main.cpp b/src/main.cpp index 255b62c..279d7be 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,8 +1,10 @@ /* * Copyright 2013 Canonical Ltd. + * Copyright 2021 Robert Tari * * Authors: * Charles Kerr <charles.kerr@canonical.com> + * Robert Tari <robert@tari.in> * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -168,7 +170,7 @@ main(int /*argc*/, char** /*argv*/) }; auto on_alarm_reached = [&engine, &snap, &on_response](const Appointment& appointment, const Alarm& alarm) { (*snap)(appointment, alarm, on_response); - engine->disable_ubuntu_alarm(appointment); + engine->disable_alarm(appointment); }; alarm_queue->alarm_reached().connect(on_alarm_reached); #endif diff --git a/src/menu.cpp b/src/menu.cpp index b1ac75c..ab0bd71 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -1,5 +1,6 @@ /* * Copyright 2013 Canonical Ltd. + * Copyright 2021 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -15,6 +16,7 @@ * * Authors: * Charles Kerr <charles.kerr@canonical.com> + * Robert Tari <robert@tari.in> */ #include <datetime/menu.h> @@ -401,7 +403,7 @@ private: g_menu_item_set_attribute (menu_item, "x-ayatana-time", "x", unix_time); g_menu_item_set_attribute (menu_item, "x-ayatana-time-format", "s", fmt.c_str()); - if (appt.is_ubuntu_alarm()) + if (appt.is_alarm()) { g_menu_item_set_attribute (menu_item, "x-ayatana-type", "s", "org.ayatana.indicator.alarm"); g_menu_item_set_attribute_value(menu_item, G_MENU_ATTRIBUTE_ICON, get_serialized_alarm_icon()); @@ -598,16 +600,16 @@ protected: GVariant* create_header_state() { // are there alarms? - bool has_ubuntu_alarms = false; + bool has_alarms = false; for(const auto& appointment : m_upcoming) - if((has_ubuntu_alarms = appointment.is_ubuntu_alarm())) + if((has_alarms = appointment.is_alarm())) break; GVariantBuilder b; g_variant_builder_init(&b, G_VARIANT_TYPE_VARDICT); g_variant_builder_add(&b, "{sv}", "title", g_variant_new_string (_("Time and Date"))); g_variant_builder_add(&b, "{sv}", "visible", g_variant_new_boolean (TRUE)); - if (has_ubuntu_alarms) + if (has_alarms) { auto label = m_formatter->header.get(); auto a11y = g_strdup_printf(_("%s (has alarms)"), label.c_str()); diff --git a/src/snap.cpp b/src/snap.cpp index 0507cc7..eb82b37 100644 --- a/src/snap.cpp +++ b/src/snap.cpp @@ -1,5 +1,6 @@ /* * Copyright 2014 Canonical Ltd. + * Copyright 2021 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -15,6 +16,7 @@ * * Authors: * Charles Kerr <charles.kerr@canonical.com> + * Robert Tari <robert@tari.in> */ #ifdef HAVE_UT_ACCTSERVICE_SYSTEMSOUND_SETTINGS @@ -91,7 +93,7 @@ public: response_func on_response) { // If calendar notifications are disabled, don't show them - if (!appointment.is_ubuntu_alarm() && !calendar_notifications_are_enabled()) { + if (!appointment.is_alarm() && !calendar_notifications_are_enabled()) { g_debug("Skipping disabled calendar event '%s' notification", appointment.summary.c_str()); return; } @@ -100,19 +102,19 @@ public: Alarms should require manual intervention to dismiss. Calendar events are less urgent and shouldn't require manual intervention and shouldn't loop the sound. */ - const bool interactive = appointment.is_ubuntu_alarm() && m_engine->supports_actions(); + const bool interactive = appointment.is_alarm() && m_engine->supports_actions(); // force the system to stay awake std::shared_ptr<ain::Awake> awake; - if (appointment.is_ubuntu_alarm() || calendar_bubbles_enabled() || calendar_list_enabled()) { + if (appointment.is_alarm() || calendar_bubbles_enabled() || calendar_list_enabled()) { awake = std::make_shared<ain::Awake>(m_system_bus, m_engine->app_name()); } // calendar events are muted in silent mode; alarm clocks never are std::shared_ptr<ain::Sound> sound; - if (appointment.is_ubuntu_alarm() || (calendar_sounds_enabled() && !silent_mode())) { + if (appointment.is_alarm() || (calendar_sounds_enabled() && !silent_mode())) { // create the sound. - const auto role = appointment.is_ubuntu_alarm() ? "alarm" : "alert"; + const auto role = appointment.is_alarm() ? "alarm" : "alert"; const auto uri = get_alarm_uri(appointment, alarm, m_settings); const auto volume = m_settings->alarm_volume.get(); const bool loop = interactive; @@ -121,12 +123,12 @@ public: // create the haptic feedback... std::shared_ptr<ain::Haptic> haptic; - if (should_vibrate() && (appointment.is_ubuntu_alarm() || calendar_vibrations_enabled())) { + if (should_vibrate() && (appointment.is_alarm() || calendar_vibrations_enabled())) { // when in silent mode should only vibrate if user defined so if (!silent_mode() || vibrate_in_silent_mode_enabled()) { const auto haptic_mode = m_settings->alarm_haptic.get(); if (haptic_mode == "pulse") - haptic = std::make_shared<ain::Haptic>(ain::Haptic::MODE_PULSE, appointment.is_ubuntu_alarm()); + haptic = std::make_shared<ain::Haptic>(ain::Haptic::MODE_PULSE, appointment.is_alarm()); } } @@ -134,7 +136,7 @@ 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" : "calendar-app"); + b.set_icon_name (appointment.is_alarm() ? "alarm-clock" : "calendar-app"); b.add_hint (ain::Builder::HINT_NONSHAPED_ICON); b.set_start_time (appointment.begin.to_unix()); @@ -151,7 +153,7 @@ public: const auto timestr = appointment.begin.format(timefmt); const char * titlefmt; - if (appointment.is_ubuntu_alarm()) { + if (appointment.is_alarm()) { titlefmt = _("Alarm %s"); } else { titlefmt = _("Event %s"); @@ -176,7 +178,7 @@ public: b.set_closed_callback([appointment, alarm, on_response, sound, awake, haptic] (const std::string& action){ Snap::Response response; - if ((action == ACTION_SNOOZE) || (appointment.is_ubuntu_alarm() && action.empty())) + if ((action == ACTION_SNOOZE) || (appointment.is_alarm() && action.empty())) response = Snap::Response::Snooze; else if (action == ACTION_SHOW_APP) response = Snap::Response::ShowApp; @@ -187,14 +189,14 @@ public: }); //TODO: we need to extend it to support alarms appointments - if (!appointment.is_ubuntu_alarm()) { + if (!appointment.is_alarm()) { b.set_timeout_callback([appointment, alarm, on_response](){ on_response(appointment, alarm, Snap::Response::ShowApp); }); } - b.set_show_notification_bubble(appointment.is_ubuntu_alarm() || calendar_bubbles_enabled()); - b.set_post_to_messaging_menu(appointment.is_ubuntu_alarm() || calendar_list_enabled()); + b.set_show_notification_bubble(appointment.is_alarm() || calendar_bubbles_enabled()); + b.set_post_to_messaging_menu(appointment.is_alarm() || calendar_list_enabled()); const auto key = m_engine->show(b); if (key) @@ -268,7 +270,7 @@ private: const Alarm& alarm, const std::shared_ptr<const Settings>& settings) const { - const auto is_alarm = appointment.is_ubuntu_alarm(); + const auto is_alarm = appointment.is_alarm(); const std::string candidates[] = { alarm.audio_url, is_alarm ? settings->alarm_sound.get() : settings->calendar_sound.get(), diff --git a/tests/manual-test-snap.cpp b/tests/manual-test-snap.cpp index 72fd374..6c34847 100644 --- a/tests/manual-test-snap.cpp +++ b/tests/manual-test-snap.cpp @@ -1,9 +1,11 @@ /* * Copyright 2013 Canonical Ltd. + * Copyright 2021 Robert Tari * * Authors: * Charles Kerr <charles.kerr@canonical.com> + * Robert Tari <robert@tari.in> * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -68,7 +70,7 @@ int main(int argc, const char* argv[]) a.color = "green"; a.summary = "Alarm"; a.uid = "D4B57D50247291478ED31DED17FF0A9838DED402"; - a.type = Appointment::UBUNTU_ALARM; + a.type = Appointment::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}); diff --git a/tests/notification-fixture.h b/tests/notification-fixture.h index 739a1fc..f94dd69 100644 --- a/tests/notification-fixture.h +++ b/tests/notification-fixture.h @@ -1,5 +1,6 @@ /* * Copyright 2014-2016 Canonical Ltd. + * Copyright 2021 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -15,6 +16,7 @@ * * Authors: * Charles Kerr <charles.kerr@canonical.com> + * Robert Tari <robert@tari.in> */ #pragma once @@ -112,11 +114,11 @@ protected: appt.end = christmas.end_of_day(); appt.alarms.push_back(ayatana::indicator::datetime::Alarm{"Ho Ho Ho!", CALENDAR_DEFAULT_SOUND, appt.begin}); - // init an Ubuntu Alarm + // init an Alarm ualarm.color = "red"; ualarm.summary = "Wakeup"; ualarm.uid = "E4B57D50247291478ED31DED17FF0A9838DED403"; - ualarm.type = ayatana::indicator::datetime::Appointment::UBUNTU_ALARM; + ualarm.type = ayatana::indicator::datetime::Appointment::ALARM; const auto tomorrow = ayatana::indicator::datetime::DateTime::NowLocal().add_days(1); ualarm.begin = tomorrow; ualarm.end = tomorrow; diff --git a/tests/test-actions.cpp b/tests/test-actions.cpp index a01fb83..09f3a5d 100644 --- a/tests/test-actions.cpp +++ b/tests/test-actions.cpp @@ -1,5 +1,6 @@ /* * Copyright 2013 Canonical Ltd. + * Copyright 2021 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -15,6 +16,7 @@ * * Authors: * Charles Kerr <charles.kerr@canonical.com> + * Robert Tari <robert@tari.in> */ #include <datetime/actions.h> @@ -37,7 +39,7 @@ class ActionsFixture: public StateFixture a1.summary = "Alarm"; a1.summary = "http://www.example.com/"; a1.uid = "example"; - a1.type = Appointment::UBUNTU_ALARM; + a1.type = Appointment::ALARM; a1.begin = a1.end = tomorrow; Appointment a2; // a non-alarm appointment diff --git a/tests/test-alarm-queue.cpp b/tests/test-alarm-queue.cpp index 42edf74..aad93e9 100644 --- a/tests/test-alarm-queue.cpp +++ b/tests/test-alarm-queue.cpp @@ -1,5 +1,6 @@ /* * Copyright 2014 Canonical Ltd. + * Copyright 2021 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -15,6 +16,7 @@ * * Authors: * Charles Kerr <charles.kerr@canonical.com> + * Robert Tari <robert@tari.in> */ #include <datetime/alarm-queue-simple.h> @@ -71,12 +73,12 @@ protected: const auto tomorrow_begin = now.add_days(1).start_of_day(); const auto tomorrow_end = tomorrow_begin.end_of_day(); - Appointment a1; // an ubuntu alarm + Appointment a1; // an alarm a1.color = "red"; a1.summary = "Alarm"; a1.summary = "http://www.example.com/"; a1.uid = "example"; - a1.type = Appointment::UBUNTU_ALARM; + a1.type = Appointment::ALARM; a1.begin = tomorrow_begin; a1.end = tomorrow_end; a1.alarms.push_back(Alarm{"Alarm Text", "", a1.begin}); diff --git a/tests/test-eds-ics-missing-trigger.cpp b/tests/test-eds-ics-missing-trigger.cpp index 70bbccb..e5a0bdf 100644 --- a/tests/test-eds-ics-missing-trigger.cpp +++ b/tests/test-eds-ics-missing-trigger.cpp @@ -82,7 +82,7 @@ TEST_F(VAlarmFixture, MissingTriggers) // build expected: one-time alarm std::vector<Appointment> expected; Appointment a; - a.type = Appointment::UBUNTU_ALARM; + a.type = Appointment::ALARM; a.uid = "20150617T211838Z-6217-32011-2036-1@ubuntu-phablet"; a.color = "#becedd"; a.summary = "One Time Alarm"; diff --git a/tests/test-live-actions.cpp b/tests/test-live-actions.cpp index 50444fa..15b7d7c 100644 --- a/tests/test-live-actions.cpp +++ b/tests/test-live-actions.cpp @@ -1,5 +1,6 @@ /* * Copyright 2013 Canonical Ltd. + * Copyright 2021 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -15,6 +16,7 @@ * * Authors: * Charles Kerr <charles.kerr@canonical.com> + * Robert Tari <robert@tari.in> */ #include "state-mock.h" @@ -205,7 +207,7 @@ TEST_F(TestLiveActionsFixture, PhoneOpenAppointment) const std::string appointment_app_url = ocurrenceDate.to_timezone("UTC").format("calendar://startdate=%Y-%m-%dT%H:%M:%S+00:00"); EXPECT_EQ(appointment_app_url, sReturn); - a.type = Appointment::UBUNTU_ALARM; + a.type = Appointment::ALARM; sReturn = m_actions->open_appointment(a, a.begin); EXPECT_EQ(clock_app_url, sReturn); unsetenv("XDG_CURRENT_DESKTOP"); diff --git a/tests/test-menu-appointments.cpp b/tests/test-menu-appointments.cpp index 91a4b42..4d15b9f 100644 --- a/tests/test-menu-appointments.cpp +++ b/tests/test-menu-appointments.cpp @@ -1,5 +1,6 @@ /* * Copyright 2016 Canonical Ltd. + * Copyright 2021 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -15,6 +16,7 @@ * * Authors: * Charles Kerr <charles.kerr@canonical.com> + * Robert Tari <robert@tari.in> */ #include "glib-fixture.h" @@ -51,7 +53,7 @@ namespace TEST_F(MenuAppointmentFixture, DisplayEvents) { const auto airport = create_appointment( - Appointment::UBUNTU_ALARM, + Appointment::ALARM, "uid-airport", "Pick Aunt Mabel up at the airport", DateTime::Local(2016,12,24,10,0,0), @@ -75,7 +77,7 @@ TEST_F(MenuAppointmentFixture, DisplayEvents) ); const auto santa = create_appointment( - Appointment::UBUNTU_ALARM, + Appointment::ALARM, "uid-santa", "Time to set out cookies and milk for Santa", DateTime::Local(2016,12,25,1,0,0), @@ -83,7 +85,7 @@ TEST_F(MenuAppointmentFixture, DisplayEvents) ); const auto bike = create_appointment( - Appointment::UBUNTU_ALARM, + Appointment::ALARM, "uid-bike", "Remember to put out the bike, it's in the garage", DateTime::Local(2016,12,25,1,0,0), @@ -132,7 +134,7 @@ TEST_F(MenuAppointmentFixture, DisplayEvents) ); const auto weekday_wakeup_alarm = create_appointment( - Appointment::UBUNTU_ALARM, + Appointment::ALARM, "wakeup-alarm", "Wake Up", DateTime::Local(2017,1,3,6,0,0), @@ -172,7 +174,7 @@ TEST_F(MenuAppointmentFixture, DisplayEvents) ); const auto pub_with_pawel = create_appointment( - Appointment::UBUNTU_ALARM, + Appointment::ALARM, "uid-pawel", "Meet Pawel at the Pub", DateTime::Local(2017,2,4,19,0,0), diff --git a/tests/test-menus.cpp b/tests/test-menus.cpp index 8650201..de323d3 100644 --- a/tests/test-menus.cpp +++ b/tests/test-menus.cpp @@ -1,5 +1,6 @@ /* * Copyright 2013 Canonical Ltd. + * Copyright 2021 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -15,6 +16,7 @@ * * Authors: * Charles Kerr <charles.kerr@canonical.com> + * Robert Tari <robert@tari.in> */ @@ -187,7 +189,7 @@ private: a1.summary = "Alarm"; a1.summary = "http://www.example.com/"; a1.uid = "example"; - a1.type = Appointment::UBUNTU_ALARM; + a1.type = Appointment::ALARM; a1.begin = a1.end = tomorrow; Appointment a2; // a non-alarm appointment @@ -208,7 +210,7 @@ private: // confirm it has the right x-ayatana-type gchar * str = nullptr; g_menu_model_get_item_attribute(section, index, "x-ayatana-type", "s", &str); - if (appt.is_ubuntu_alarm()) + if (appt.is_alarm()) EXPECT_STREQ("org.ayatana.indicator.alarm", str); else EXPECT_STREQ("org.ayatana.indicator.appointment", str); @@ -241,7 +243,7 @@ private: g_clear_pointer(&str, g_free); // confirm that alarms have an icon - if (appt.is_ubuntu_alarm()) + if (appt.is_alarm()) { auto v = g_menu_model_get_item_attribute_value(section, index, diff --git a/tests/test-notification.cpp b/tests/test-notification.cpp index 83a021f..80eb04c 100644 --- a/tests/test-notification.cpp +++ b/tests/test-notification.cpp @@ -1,5 +1,6 @@ /* * Copyright 2014-2016 Canonical Ltd. + * Copyright 2021 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -15,6 +16,7 @@ * * Authors: * Charles Kerr <charles.kerr@canonical.com> + * Robert Tari <robert@tari.in> */ #include <datetime/appointment.h> @@ -93,10 +95,10 @@ TEST_F(NotificationFixture,Notification) std::set<Appointment::Type> expected_notify_called; // do we expect the notification to show? std::set<Appointment::Type> expected_vibrate_called; // do we expect the phone to vibrate? } test_cal_disabled[] = { - { true, std::set<Appointment::Type>{ Appointment::Type::UBUNTU_ALARM, Appointment::Type::EVENT }, - std::set<Appointment::Type>{ Appointment::Type::UBUNTU_ALARM, Appointment::Type::EVENT } }, - { false, std::set<Appointment::Type>{ Appointment::Type::UBUNTU_ALARM }, - std::set<Appointment::Type>{ Appointment::Type::UBUNTU_ALARM } } + { true, std::set<Appointment::Type>{ Appointment::Type::ALARM, Appointment::Type::EVENT }, + std::set<Appointment::Type>{ Appointment::Type::ALARM, Appointment::Type::EVENT } }, + { false, std::set<Appointment::Type>{ Appointment::Type::ALARM }, + std::set<Appointment::Type>{ Appointment::Type::ALARM } } }; for (const auto& test_appt : test_appts) |