aboutsummaryrefslogtreecommitdiff
path: root/src/settings-live.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-08-08 20:52:31 +0000
committerCI bot <ps-jenkins@lists.canonical.com>2014-08-08 20:52:31 +0000
commit0777142ba348c212f57af039c6f7b2ae15d5058f (patch)
treec4998c28ec72c215ccb8bff40ef5851e826358ac /src/settings-live.cpp
parent23b0a5d6d97b8e36443a2a719b879f99975ef972 (diff)
parent9cc6380c1cb0c4e96a893a1b9d2720d2ed3181bd (diff)
downloadayatana-indicator-datetime-0777142ba348c212f57af039c6f7b2ae15d5058f.tar.gz
ayatana-indicator-datetime-0777142ba348c212f57af039c6f7b2ae15d5058f.tar.bz2
ayatana-indicator-datetime-0777142ba348c212f57af039c6f7b2ae15d5058f.zip
Add haptic feedback support for alarms. Fixes: 1350017
Approved by: Antti Kaijanmäki, PS Jenkins bot, Nekhelesh Ramananthan
Diffstat (limited to 'src/settings-live.cpp')
-rw-r--r--src/settings-live.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/settings-live.cpp b/src/settings-live.cpp
index 71bbd96..a8338ed 100644
--- a/src/settings-live.cpp
+++ b/src/settings-live.cpp
@@ -55,6 +55,7 @@ LiveSettings::LiveSettings():
update_alarm_sound();
update_alarm_volume();
update_alarm_duration();
+ update_alarm_haptic();
// now listen for clients to change the properties s.t. we can sync update GSettings
@@ -130,6 +131,10 @@ LiveSettings::LiveSettings():
alarm_duration.changed().connect([this](unsigned int value){
g_settings_set_uint(m_settings, SETTINGS_ALARM_DURATION_S, value);
});
+
+ alarm_haptic.changed().connect([this](const std::string& value){
+ g_settings_set_string(m_settings, SETTINGS_ALARM_HAPTIC_S, value.c_str());
+ });
}
/***
@@ -237,6 +242,13 @@ void LiveSettings::update_alarm_duration()
alarm_duration.set(g_settings_get_uint(m_settings, SETTINGS_ALARM_DURATION_S));
}
+void LiveSettings::update_alarm_haptic()
+{
+ auto val = g_settings_get_string(m_settings, SETTINGS_ALARM_HAPTIC_S);
+ alarm_haptic.set(val);
+ g_free(val);
+}
+
/***
****
***/
@@ -284,6 +296,8 @@ void LiveSettings::update_key(const std::string& key)
update_alarm_volume();
else if (key == SETTINGS_ALARM_DURATION_S)
update_alarm_duration();
+ else if (key == SETTINGS_ALARM_HAPTIC_S)
+ update_alarm_haptic();
}
/***