diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2014-09-02 10:37:03 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2014-09-02 10:37:03 -0500 |
commit | d3732ff1a0d149544f89d08fa489e4f0fca8da07 (patch) | |
tree | 2136f27b75887c1a7f16c21b7f7418e9c7efb33d /src | |
parent | 15a383a7b027d281dcdaa85a43eb3563031366bf (diff) | |
download | ayatana-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')
-rw-r--r-- | src/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/exporter.cpp | 1 | ||||
-rw-r--r-- | src/settings-live.cpp | 12 |
3 files changed, 15 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e583334..2852a75 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -25,6 +25,8 @@ set (SERVICE_CXX_SOURCES locations-settings.cpp menu.cpp notifications.cpp + planner-aggregate.cpp + planner-snooze.cpp planner-month.cpp planner-range.cpp planner-upcoming.cpp diff --git a/src/exporter.cpp b/src/exporter.cpp index 1d45705..05b21eb 100644 --- a/src/exporter.cpp +++ b/src/exporter.cpp @@ -145,6 +145,7 @@ private: bind_uint_property(m_alarm_props, "default-volume", m_settings->alarm_volume); bind_string_property(m_alarm_props, "default-sound", m_settings->alarm_sound); bind_string_property(m_alarm_props, "haptic-feedback", m_settings->alarm_haptic); + bind_uint_property(m_alarm_props, "snooze-duration", m_settings->snooze_duration); } /*** 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(); } /*** |