[evolution-data-server] evo-I#1032 - alarm-notify: Add a way to disable sound notifications



commit c8b77447b078f65f4b99b67fefed47786879c5c6
Author: Milan Crha <mcrha redhat com>
Date:   Tue Nov 16 14:31:59 2021 +0100

    evo-I#1032 - alarm-notify: Add a way to disable sound notifications
    
    Related to https://gitlab.gnome.org/GNOME/evolution/-/issues/1032

 data/org.gnome.evolution-data-server.calendar.gschema.xml.in | 5 +++++
 src/services/evolution-alarm-notify/e-alarm-notify.c         | 6 ++++++
 2 files changed, 11 insertions(+)
---
diff --git a/data/org.gnome.evolution-data-server.calendar.gschema.xml.in 
b/data/org.gnome.evolution-data-server.calendar.gschema.xml.in
index ee153d5a5..d5b5acd6b 100644
--- a/data/org.gnome.evolution-data-server.calendar.gschema.xml.in
+++ b/data/org.gnome.evolution-data-server.calendar.gschema.xml.in
@@ -38,6 +38,11 @@
       <summary>Reminder programs</summary>
       <description>Programs that are allowed to be run by reminders</description>
     </key>
+    <key name="notify-enable-audio" type="b">
+      <default>true</default>
+      <summary>Enable audio notifications</summary>
+      <description>When set to true, the audio reminders will be played, otherwise audio reminders will be 
silently ignored</description>
+    </key>
     <key name="notify-with-tray" type="b">
       <default>true</default>
       <summary>Show reminders in notification tray only</summary>
diff --git a/src/services/evolution-alarm-notify/e-alarm-notify.c 
b/src/services/evolution-alarm-notify/e-alarm-notify.c
index 5c9b479f9..f93111fc8 100644
--- a/src/services/evolution-alarm-notify/e-alarm-notify.c
+++ b/src/services/evolution-alarm-notify/e-alarm-notify.c
@@ -144,6 +144,11 @@ e_alarm_notify_audio (EAlarmNotify *an,
        g_return_val_if_fail (rd != NULL, FALSE);
        g_return_val_if_fail (alarm != NULL, FALSE);
 
+       if (!g_settings_get_boolean (an->priv->settings, "notify-enable-audio")) {
+               ean_debug_print ("Audio notify: Skipped, because disabled in the settings\n");
+               return FALSE;
+       }
+
        attachments = e_cal_component_alarm_get_attachments (alarm);
        if (attachments && !attachments->next)
                attach = attachments->data;
@@ -787,6 +792,7 @@ e_alarm_notify_status_icon_popup_menu_cb (GtkStatusIcon *status_icon,
        } items[] = {
                { N_("Display Reminders window with _notifications"), "notify-with-tray", 
G_SETTINGS_BIND_DEFAULT | G_SETTINGS_BIND_INVERT_BOOLEAN },
                { N_("Keep reminder notification window always on _top"), "notify-window-on-top", 
G_SETTINGS_BIND_DEFAULT },
+               { N_("Enable _audio notifications"), "notify-enable-audio", G_SETTINGS_BIND_DEFAULT },
                { N_("Display reminders for _completed tasks"), "notify-completed-tasks", 
G_SETTINGS_BIND_DEFAULT },
                { N_("Display reminders for _past events"), "notify-past-events", G_SETTINGS_BIND_DEFAULT }
        };


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]