aboutsummaryrefslogtreecommitdiff
path: root/src/settings-live.cpp
diff options
context:
space:
mode:
authorkugiigi <kugi_eusebio@protonmail.com>2021-03-20 11:52:07 +0800
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-12-19 16:57:38 +0100
commit63a57fde6677d8f663e5880a259998b95b1da6c5 (patch)
treecff6527e6f869c465e0b90296e761e246a8a39c6 /src/settings-live.cpp
parentecaacccacf853059ea4588c44bd13035faaba6af (diff)
downloadayatana-indicator-datetime-63a57fde6677d8f663e5880a259998b95b1da6c5.tar.gz
ayatana-indicator-datetime-63a57fde6677d8f663e5880a259998b95b1da6c5.tar.bz2
ayatana-indicator-datetime-63a57fde6677d8f663e5880a259998b95b1da6c5.zip
Add option to show/hide alarms
Diffstat (limited to 'src/settings-live.cpp')
-rw-r--r--src/settings-live.cpp13
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)