diff options
| author | Victor Kareh <[email protected]> | 2025-08-29 09:14:41 -0400 |
|---|---|---|
| committer | Luke from DC <[email protected]> | 2025-10-10 02:11:17 +0000 |
| commit | 2dd24f923f4d4f2bbc77314445a6b1b6701b3569 (patch) | |
| tree | d9626b8d46c6c09fa5bb5c3195da2bbd2e3f3a5d /src/capplet | |
| parent | fe37d06ad1987f139d98a7b7e0a22aa96fe7260b (diff) | |
| download | mate-notification-daemon-2dd24f923f4d4f2bbc77314445a6b1b6701b3569.tar.bz2 mate-notification-daemon-2dd24f923f4d4f2bbc77314445a6b1b6701b3569.tar.xz | |
history: Add enable/disable toggle
This helps a bit with privacy. By disabling history, it wipes all
notifications in the D-Bus buffer and prevents further storage. The
history popup is also disabled.
Notification storage resumes when history is enabled.
Note that this just prevents the mate-notifications-daemon from storing
notifications, but it doesn't prevent other processes from capturing
them elsewhere.
Diffstat (limited to 'src/capplet')
| -rw-r--r-- | src/capplet/mate-notification-applet-history.c | 6 | ||||
| -rw-r--r-- | src/capplet/mate-notification-properties.c | 3 | ||||
| -rw-r--r-- | src/capplet/mate-notification-properties.ui | 16 |
3 files changed, 25 insertions, 0 deletions
diff --git a/src/capplet/mate-notification-applet-history.c b/src/capplet/mate-notification-applet-history.c index cca03d6..ce38a6f 100644 --- a/src/capplet/mate-notification-applet-history.c +++ b/src/capplet/mate-notification-applet-history.c @@ -245,6 +245,12 @@ show_notification_history (MateNotificationHistoryContext *context) return; } + /* Check if history is enabled */ + if (context->settings && !g_settings_get_boolean (context->settings, GSETTINGS_KEY_HISTORY_ENABLED)) { + g_warning ("Cannot show history: history is disabled for privacy"); + return; + } + /* If popup already exists, destroy it (basically toggle off) */ if (context->history_popup) { gtk_widget_destroy (context->history_popup); diff --git a/src/capplet/mate-notification-properties.c b/src/capplet/mate-notification-properties.c index adbbb6b..f81dd2c 100644 --- a/src/capplet/mate-notification-properties.c +++ b/src/capplet/mate-notification-properties.c @@ -44,6 +44,7 @@ typedef struct { GtkWidget* preview_button; GtkWidget* active_checkbox; GtkWidget* dnd_checkbox; + GtkWidget* history_checkbox; GtkWidget* monitor_label; GtkWidget* timeout_spin; GtkWidget* persistence_checkbox; @@ -496,6 +497,7 @@ static gboolean notification_properties_dialog_init(NotificationAppletDialog* di dialog->theme_combo = GTK_WIDGET(gtk_builder_get_object(builder, "theme_combo")); dialog->active_checkbox = GTK_WIDGET(gtk_builder_get_object(builder, "use_active_check")); dialog->dnd_checkbox = GTK_WIDGET(gtk_builder_get_object(builder, "do_not_disturb_check")); + dialog->history_checkbox = GTK_WIDGET(gtk_builder_get_object(builder, "history_enabled_check")); dialog->monitor_label = GTK_WIDGET(gtk_builder_get_object(builder, "monitor_label")); dialog->timeout_spin = GTK_WIDGET(gtk_builder_get_object(builder, "timeout_spin")); dialog->persistence_checkbox = GTK_WIDGET(gtk_builder_get_object(builder, "enable_persistence_check")); @@ -510,6 +512,7 @@ static gboolean notification_properties_dialog_init(NotificationAppletDialog* di g_settings_bind (dialog->gsettings, GSETTINGS_KEY_USE_ACTIVE_MONITOR, dialog->active_checkbox, "active", G_SETTINGS_BIND_DEFAULT); g_settings_bind (dialog->gsettings, GSETTINGS_KEY_DO_NOT_DISTURB, dialog->dnd_checkbox, "active", G_SETTINGS_BIND_DEFAULT); + g_settings_bind (dialog->gsettings, GSETTINGS_KEY_HISTORY_ENABLED, dialog->history_checkbox, "active", G_SETTINGS_BIND_DEFAULT); GtkAdjustment *timeout_adjustment = gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(dialog->timeout_spin)); g_settings_bind (dialog->gsettings, GSETTINGS_KEY_DEFAULT_TIMEOUT, timeout_adjustment, "value", G_SETTINGS_BIND_DEFAULT); diff --git a/src/capplet/mate-notification-properties.ui b/src/capplet/mate-notification-properties.ui index 49bc4c8..9b461bf 100644 --- a/src/capplet/mate-notification-properties.ui +++ b/src/capplet/mate-notification-properties.ui @@ -218,6 +218,22 @@ <property name="position">2</property> </packing> </child> + <child> + <object class="GtkCheckButton" id="history_enabled_check"> + <property name="label" translatable="yes">Enable Notification History</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="halign">start</property> + <property name="draw_indicator">True</property> + <property name="tooltip_text" translatable="yes">When enabled, notifications are stored for later viewing. When disabled, no notification history is kept for privacy. Note: This only controls MATE's notification storage; system logs may still contain notification data.</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> </object> </child> </object> |
