aboutsummaryrefslogtreecommitdiff
path: root/src/snap.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2015-04-08 18:48:24 -0500
committerCharles Kerr <charles.kerr@canonical.com>2015-04-08 18:48:24 -0500
commit9ee3e699248b4dcaae0ac15829d5004e5e23c66e (patch)
treee55e6037e67d77a3f0f2cf7221b63cd10a64704e /src/snap.cpp
parent49f49d4c18c2cc77a1a305c93a74e9e8ec903526 (diff)
downloadayatana-indicator-datetime-9ee3e699248b4dcaae0ac15829d5004e5e23c66e.tar.gz
ayatana-indicator-datetime-9ee3e699248b4dcaae0ac15829d5004e5e23c66e.tar.bz2
ayatana-indicator-datetime-9ee3e699248b4dcaae0ac15829d5004e5e23c66e.zip
honor the AccountsService 'other vibrations' setting.
Diffstat (limited to 'src/snap.cpp')
-rw-r--r--src/snap.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/snap.cpp b/src/snap.cpp
index ae0a62a..3867e90 100644
--- a/src/snap.cpp
+++ b/src/snap.cpp
@@ -104,10 +104,12 @@ public:
}
// create the haptic feedback...
- const auto haptic_mode = m_settings->alarm_haptic.get();
std::shared_ptr<uin::Haptic> haptic;
- if (haptic_mode == "pulse")
- haptic = std::make_shared<uin::Haptic>(uin::Haptic::MODE_PULSE);
+ if (should_vibrate()) {
+ const auto haptic_mode = m_settings->alarm_haptic.get();
+ if (haptic_mode == "pulse")
+ haptic = std::make_shared<uin::Haptic>(uin::Haptic::MODE_PULSE);
+ }
// show a notification...
const auto minutes = std::chrono::minutes(m_settings->alarm_duration.get());
@@ -181,6 +183,12 @@ private:
&& (accounts_service_sound_get_silent_mode(m_accounts_service_sound_proxy));
}
+ bool should_vibrate() const
+ {
+ return (m_accounts_service_sound_proxy != nullptr)
+ && (accounts_service_sound_get_other_vibrate(m_accounts_service_sound_proxy));
+ }
+
std::string get_alarm_uri(const Alarm& alarm,
const std::shared_ptr<const Settings>& settings) const
{