diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2023-12-19 16:58:19 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2023-12-19 16:58:19 +0100 |
commit | d0ebe52935bb6b92ea5c84a8388ab992066e7a5e (patch) | |
tree | cff6527e6f869c465e0b90296e761e246a8a39c6 /src/settings-live.cpp | |
parent | ecaacccacf853059ea4588c44bd13035faaba6af (diff) | |
parent | 63a57fde6677d8f663e5880a259998b95b1da6c5 (diff) | |
download | ayatana-indicator-datetime-d0ebe52935bb6b92ea5c84a8388ab992066e7a5e.tar.gz ayatana-indicator-datetime-d0ebe52935bb6b92ea5c84a8388ab992066e7a5e.tar.bz2 ayatana-indicator-datetime-d0ebe52935bb6b92ea5c84a8388ab992066e7a5e.zip |
Merge branch 'luigi311-toggle_alarm'
Attributes GH PR #118: https://github.com/AyatanaIndicators/ayatana-indicator-datetime/pull/118
Diffstat (limited to 'src/settings-live.cpp')
-rw-r--r-- | src/settings-live.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/settings-live.cpp b/src/settings-live.cpp index cf18739..9cbc23c 100644 --- a/src/settings-live.cpp +++ b/src/settings-live.cpp @@ -47,6 +47,7 @@ LiveSettings::LiveSettings(): update_show_day(); update_show_detected_locations(); update_show_events(); + update_show_alarms(); update_show_locations(); update_show_seconds(); update_show_week_numbers(); @@ -117,6 +118,10 @@ LiveSettings::LiveSettings(): g_settings_set_boolean(m_settings, SETTINGS_SHOW_EVENTS_S, value); }); + show_alarms.changed().connect([this](bool value){ + g_settings_set_boolean(m_settings, SETTINGS_SHOW_ALARMS_S, value); + }); + show_locations.changed().connect([this](bool value){ g_settings_set_boolean(m_settings, SETTINGS_SHOW_LOCATIONS_S, value); }); @@ -239,6 +244,12 @@ void LiveSettings::update_show_events() show_events.set(val); } +void LiveSettings::update_show_alarms() +{ + const auto val = g_settings_get_boolean(m_settings, SETTINGS_SHOW_ALARMS_S); + show_alarms.set(val); +} + void LiveSettings::update_show_locations() { const auto val = g_settings_get_boolean(m_settings, SETTINGS_SHOW_LOCATIONS_S); @@ -415,6 +426,8 @@ void LiveSettings::update_key_ccid(const std::string& key) update_show_week_numbers(); else if (key == SETTINGS_SHOW_EVENTS_S) update_show_events(); + else if (key == SETTINGS_SHOW_ALARMS_S) + update_show_alarms(); else if (key == SETTINGS_SHOW_LOCATIONS_S) update_show_locations(); else if (key == SETTINGS_SHOW_DETECTED_S) |