diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2014-09-05 14:12:14 +0000 |
---|---|---|
committer | CI bot <ps-jenkins@lists.canonical.com> | 2014-09-05 14:12:14 +0000 |
commit | 7affbfb591fe0d5b68bdf5023eae2aba5e727dd2 (patch) | |
tree | 55976fcc4f23debe01bb18ef9a9f2a8260f756b8 /src/settings-live.cpp | |
parent | d006b8d390004e03c2cd27d67c80f4fb767f35d5 (diff) | |
parent | 593c16de05fe3806edeeb3bc105ce63b71b8b545 (diff) | |
download | ayatana-indicator-datetime-7affbfb591fe0d5b68bdf5023eae2aba5e727dd2.tar.gz ayatana-indicator-datetime-7affbfb591fe0d5b68bdf5023eae2aba5e727dd2.tar.bz2 ayatana-indicator-datetime-7affbfb591fe0d5b68bdf5023eae2aba5e727dd2.zip |
Add the snooze feature Fixes: 1354400
Approved by: Jussi Pakkanen, PS Jenkins bot
Diffstat (limited to 'src/settings-live.cpp')
-rw-r--r-- | src/settings-live.cpp | 12 |
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(); } /*** |