2828#include <gtk/gtk.h>
2929#include <eel/eel-glib-extensions.h>
3030#include "caja-progress-info.h"
31+ #include "caja-global-preferences.h"
3132#include <string.h>
3233
3334enum
@@ -599,9 +600,12 @@ update_status_icon_and_window (void)
599600 GNotification * notification ;
600601 static gboolean window_shown = FALSE;
601602
602- notification = g_notification_new ("caja" );
603- icon = g_themed_icon_new ("system-file-manager" );
604- g_notification_set_icon (notification , icon );
603+ if (g_settings_get_boolean (caja_preferences , CAJA_PREFERENCES_SHOW_NOTIFICATIONS ))
604+ {
605+ notification = g_notification_new ("caja" );
606+ icon = g_themed_icon_new ("system-file-manager" );
607+ g_notification_set_icon (notification , icon );
608+ }
605609
606610 tooltip = g_strdup_printf (ngettext ("%'d file operation active" ,
607611 "%'d file operations active" ,
@@ -620,8 +624,13 @@ update_status_icon_and_window (void)
620624 if (window_shown )
621625 {
622626 gtk_widget_hide (get_progress_window ());
623- g_notification_set_body (notification , _ ("Process completed" ));
624- g_application_send_notification (g_application_get_default (), "caja" , notification );
627+
628+ if (g_settings_get_boolean (caja_preferences , CAJA_PREFERENCES_SHOW_NOTIFICATIONS ))
629+ {
630+ g_notification_set_body (notification , _ ("Process completed" ));
631+ g_application_send_notification (g_application_get_default (), "caja" , notification );
632+ }
633+
625634 window_shown = FALSE;
626635 }
627636 }
@@ -630,8 +639,13 @@ update_status_icon_and_window (void)
630639 gtk_widget_show_all (get_progress_window ());
631640 gtk_status_icon_set_visible (status_icon , TRUE);
632641 gtk_window_present (GTK_WINDOW (get_progress_window ()));
633- g_notification_set_body (notification , _ ("Working..." ));
634- g_application_send_notification (g_application_get_default (), "caja" , notification );
642+
643+ if (g_settings_get_boolean (caja_preferences , CAJA_PREFERENCES_SHOW_NOTIFICATIONS ))
644+ {
645+ g_notification_set_body (notification , _ ("Working..." ));
646+ g_application_send_notification (g_application_get_default (), "caja" , notification );
647+ }
648+
635649 window_shown = TRUE;
636650 }
637651}
0 commit comments