diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2014-06-24 00:06:04 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2014-06-24 00:06:04 -0500 |
commit | 373832769c30a950629a4ca9474bd7f5bf03a6b4 (patch) | |
tree | c859a9211aea6c973c75f6846321ac45a08f213a /src | |
parent | 0463fa7657b1aab4a3f5c6e7909ba1513c047968 (diff) | |
download | ayatana-indicator-datetime-373832769c30a950629a4ca9474bd7f5bf03a6b4.tar.gz ayatana-indicator-datetime-373832769c30a950629a4ca9474bd7f5bf03a6b4.tar.bz2 ayatana-indicator-datetime-373832769c30a950629a4ca9474bd7f5bf03a6b4.zip |
add GSettings support for specifying an alarm loop duration
Diffstat (limited to 'src')
-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 ec78feb..e34ace1 100644 --- a/src/settings-live.cpp +++ b/src/settings-live.cpp @@ -54,6 +54,7 @@ LiveSettings::LiveSettings(): update_timezone_name(); update_alarm_sound(); update_alarm_volume(); + update_alarm_duration(); // now listen for clients to change the properties s.t. we can sync update GSettings @@ -125,6 +126,10 @@ LiveSettings::LiveSettings(): alarm_volume.changed().connect([this](AlarmVolume value){ g_settings_set_enum(m_settings, SETTINGS_ALARM_VOLUME_S, gint(value)); }); + + alarm_duration.changed().connect([this](int value){ + g_settings_set_int(m_settings, SETTINGS_ALARM_DURATION_S, value); + }); } /*** @@ -227,6 +232,11 @@ void LiveSettings::update_alarm_volume() alarm_volume.set((AlarmVolume)g_settings_get_enum(m_settings, SETTINGS_ALARM_VOLUME_S)); } +void LiveSettings::update_alarm_duration() +{ + alarm_duration.set(g_settings_get_int(m_settings, SETTINGS_ALARM_DURATION_S)); +} + /*** **** ***/ @@ -272,6 +282,8 @@ void LiveSettings::update_key(const std::string& key) update_alarm_sound(); else if (key == SETTINGS_ALARM_VOLUME_S) update_alarm_volume(); + else if (key == SETTINGS_ALARM_DURATION_S) + update_alarm_duration(); } /*** |