aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Mello <arthur.mello@canonical.com>2016-06-24 09:26:06 -0300
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-08-29 14:37:39 +0200
commit686579f67c368512ac36267dd5bd13eff2a0abb5 (patch)
tree5525b86c8f89e1ab9b18d83dc6de5a5d1c42ba72
parentf3f17677a2718fb47cda50cd6c64c9650448ea2e (diff)
downloadayatana-indicator-datetime-686579f67c368512ac36267dd5bd13eff2a0abb5.tar.gz
ayatana-indicator-datetime-686579f67c368512ac36267dd5bd13eff2a0abb5.tar.bz2
ayatana-indicator-datetime-686579f67c368512ac36267dd5bd13eff2a0abb5.zip
Make sure that calendar settings do not affect alarm notifications
-rw-r--r--src/snap.cpp6
-rw-r--r--tests/test-notification.cpp6
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)
{