diff options
Diffstat (limited to 'src/snap.cpp')
-rw-r--r-- | src/snap.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/snap.cpp b/src/snap.cpp index d0c12a0..363e0df 100644 --- a/src/snap.cpp +++ b/src/snap.cpp @@ -97,9 +97,9 @@ public: // force the system to stay awake std::shared_ptr<ain::Awake> awake; - if (appointment.is_ubuntu_alarm() || calendar_bubbles_enabled()) { - awake = std::make_shared<ain::Awake>(m_engine->app_name()); - } + if (appointment.is_ubuntu_alarm() || calendar_bubbles_enabled() || calendar_list_enabled()) { + awake = std::make_shared<ain::Awake>(m_engine->app_name()); + } // calendar events are muted in silent mode; alarm clocks never are std::shared_ptr<ain::Sound> sound; @@ -115,9 +115,12 @@ public: // create the haptic feedback... std::shared_ptr<ain::Haptic> haptic; 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()); + // 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()); + } } // show a notification... @@ -218,6 +221,11 @@ private: return m_settings->cal_notification_list.get(); } + bool vibrate_in_silent_mode_enabled() const + { + return m_settings->vibrate_silent_mode.get(); + } + static void on_sound_proxy_ready(GObject* /*source_object*/, GAsyncResult* res, gpointer gself) { GError * error; |