From 2e14b67ca57829d097b9e850e95b96934ec7d97d Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 26 Mar 2018 16:26:09 +0200 Subject: honor gsettings for calendar events --- src/settings-live.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/settings-live.cpp') diff --git a/src/settings-live.cpp b/src/settings-live.cpp index 3475d5e..206b762 100644 --- a/src/settings-live.cpp +++ b/src/settings-live.cpp @@ -52,6 +52,7 @@ LiveSettings::LiveSettings(): update_show_year(); update_time_format_mode(); update_timezone_name(); + update_calendar_sound(); update_alarm_sound(); update_alarm_volume(); update_alarm_duration(); @@ -121,6 +122,10 @@ LiveSettings::LiveSettings(): g_settings_set_string(m_settings, SETTINGS_TIMEZONE_NAME_S, value.c_str()); }); + calendar_sound.changed().connect([this](const std::string& value){ + g_settings_set_string(m_settings, SETTINGS_CALENDAR_SOUND_S, value.c_str()); + }); + alarm_sound.changed().connect([this](const std::string& value){ g_settings_set_string(m_settings, SETTINGS_ALARM_SOUND_S, value.c_str()); }); @@ -230,6 +235,13 @@ void LiveSettings::update_timezone_name() g_free(val); } +void LiveSettings::update_calendar_sound() +{ + auto val = g_settings_get_string(m_settings, SETTINGS_CALENDAR_SOUND_S); + calendar_sound.set(val); + g_free(val); +} + void LiveSettings::update_alarm_sound() { auto val = g_settings_get_string(m_settings, SETTINGS_ALARM_SOUND_S); @@ -300,6 +312,8 @@ void LiveSettings::update_key(const std::string& key) update_show_detected_locations(); else if (key == SETTINGS_TIMEZONE_NAME_S) update_timezone_name(); + else if (key == SETTINGS_CALENDAR_SOUND_S) + update_calendar_sound(); else if (key == SETTINGS_ALARM_SOUND_S) update_alarm_sound(); else if (key == SETTINGS_ALARM_VOLUME_S) -- cgit v1.2.3