From 570d6afed8ff62e430f46b3d87870702240ce3e8 Mon Sep 17 00:00:00 2001 From: lukefromdc Date: Sun, 23 Oct 2016 23:50:34 -0400 Subject: Add gsettings preference to enable/disable notifications Defaults to TRUE --- libcaja-private/caja-file-operations.c | 2 ++ libcaja-private/caja-global-preferences.h | 1 + libcaja-private/org.mate.caja.gschema.xml | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/libcaja-private/caja-file-operations.c b/libcaja-private/caja-file-operations.c index a1172533..b76ef038 100644 --- a/libcaja-private/caja-file-operations.c +++ b/libcaja-private/caja-file-operations.c @@ -200,6 +200,8 @@ caja_application_notify_unmount_show (const gchar *message) gchar **strings; strings = g_strsplit (message, "\n", 0); + if (!g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_SHOW_NOTIFICATIONS)) return; + if (unmount_notify == NULL) { unmount_notify = notify_notification_new (strings[0], strings[1], diff --git a/libcaja-private/caja-global-preferences.h b/libcaja-private/caja-global-preferences.h index d97c7225..6fae1fc0 100644 --- a/libcaja-private/caja-global-preferences.h +++ b/libcaja-private/caja-global-preferences.h @@ -59,6 +59,7 @@ G_BEGIN_DECLS /* Desktop options */ #define CAJA_PREFERENCES_DESKTOP_IS_HOME_DIR "desktop-is-home-dir" +#define CAJA_PREFERENCES_SHOW_NOTIFICATIONS "show-notifications" /* Display */ #define CAJA_PREFERENCES_SHOW_HIDDEN_FILES "show-hidden-files" diff --git a/libcaja-private/org.mate.caja.gschema.xml b/libcaja-private/org.mate.caja.gschema.xml index 0668d584..0f84f4ec 100644 --- a/libcaja-private/org.mate.caja.gschema.xml +++ b/libcaja-private/org.mate.caja.gschema.xml @@ -241,6 +241,11 @@ Whether to show file sizes with IEC units If set to true, file sizes are shown using IEC (base 1024) units with "KiB" style suffixes, instead of default with SI units. + + true + Whether to show desktop notifications + If set to true, caja will show desktop notifications for eject events + -- cgit v1.2.1