aboutsummaryrefslogtreecommitdiff
path: root/src/settings-live.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-09-02 10:37:03 -0500
committerCharles Kerr <charles.kerr@canonical.com>2014-09-02 10:37:03 -0500
commitd3732ff1a0d149544f89d08fa489e4f0fca8da07 (patch)
tree2136f27b75887c1a7f16c21b7f7418e9c7efb33d /src/settings-live.cpp
parent15a383a7b027d281dcdaa85a43eb3563031366bf (diff)
downloadayatana-indicator-datetime-d3732ff1a0d149544f89d08fa489e4f0fca8da07.tar.gz
ayatana-indicator-datetime-d3732ff1a0d149544f89d08fa489e4f0fca8da07.tar.bz2
ayatana-indicator-datetime-d3732ff1a0d149544f89d08fa489e4f0fca8da07.zip
add snooze properties to our schema; export it on the bus; add tests
Diffstat (limited to 'src/settings-live.cpp')
-rw-r--r--src/settings-live.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/settings-live.cpp b/src/settings-live.cpp
index a8338ed..8ea06a4 100644
--- a/src/settings-live.cpp
+++ b/src/settings-live.cpp
@@ -56,6 +56,7 @@ LiveSettings::LiveSettings():
update_alarm_volume();
update_alarm_duration();
update_alarm_haptic();
+ update_snooze_duration();
// now listen for clients to change the properties s.t. we can sync update GSettings
@@ -135,6 +136,10 @@ LiveSettings::LiveSettings():
alarm_haptic.changed().connect([this](const std::string& value){
g_settings_set_string(m_settings, SETTINGS_ALARM_HAPTIC_S, value.c_str());
});
+
+ snooze_duration.changed().connect([this](unsigned int value){
+ g_settings_set_uint(m_settings, SETTINGS_SNOOZE_DURATION_S, value);
+ });
}
/***
@@ -249,6 +254,11 @@ void LiveSettings::update_alarm_haptic()
g_free(val);
}
+void LiveSettings::update_snooze_duration()
+{
+ snooze_duration.set(g_settings_get_uint(m_settings, SETTINGS_SNOOZE_DURATION_S));
+}
+
/***
****
***/
@@ -298,6 +308,8 @@ void LiveSettings::update_key(const std::string& key)
update_alarm_duration();
else if (key == SETTINGS_ALARM_HAPTIC_S)
update_alarm_haptic();
+ else if (key == SETTINGS_SNOOZE_DURATION_S)
+ update_snooze_duration();
}
/***