diff options
author | Arthur Mello <arthur.mello@canonical.com> | 2016-06-24 09:26:06 -0300 |
---|---|---|
committer | Robert Tari <robert@tari.in> | 2021-07-08 00:29:23 +0200 |
commit | c0f53270674c6dbfe2eadf38e999c2536c4af4e3 (patch) | |
tree | 1331e290db393b93b3f01fbfe2bff73164f01ddd | |
parent | 033735a671e29307271f0a900b8b10090f28f153 (diff) | |
download | ayatana-indicator-datetime-c0f53270674c6dbfe2eadf38e999c2536c4af4e3.tar.gz ayatana-indicator-datetime-c0f53270674c6dbfe2eadf38e999c2536c4af4e3.tar.bz2 ayatana-indicator-datetime-c0f53270674c6dbfe2eadf38e999c2536c4af4e3.zip |
Make sure that calendar settings do not affect alarm notifications
-rw-r--r-- | src/snap.cpp | 6 | ||||
-rw-r--r-- | tests/test-notification.cpp | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/snap.cpp b/src/snap.cpp index 1e71e7b..273f125 100644 --- a/src/snap.cpp +++ b/src/snap.cpp @@ -97,8 +97,8 @@ public: // force the system to stay awake std::shared_ptr<ain::Awake> awake; - if (calendar_bubbles_enabled()) { - awake = std::make_shared<uin::Awake>(m_engine->app_name()); + if (appointment.is_ubuntu_alarm() || calendar_bubbles_enabled()) { + awake = std::make_shared<ain::Awake>(m_engine->app_name()); } // calendar events are muted in silent mode; alarm clocks never are @@ -114,7 +114,7 @@ public: // create the haptic feedback... std::shared_ptr<ain::Haptic> haptic; - if (should_vibrate() && calendar_vibrations_enabled()) { + if (should_vibrate() && (appointment.is_ubuntu_alarm() || calendar_vibrations_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()); diff --git a/tests/test-notification.cpp b/tests/test-notification.cpp index 58c0760..0db6ab9 100644 --- a/tests/test-notification.cpp +++ b/tests/test-notification.cpp @@ -230,6 +230,12 @@ TEST_F(NotificationFixture,Response) }; + settings->cal_notification_enabled.set(true); + settings->cal_notification_sounds.set(true); + settings->cal_notification_vibrations.set(true); + settings->cal_notification_bubbles.set(true); + settings->cal_notification_list.set(true); + // walk through the tests for (const auto& test : tests) { |