Skip to content

Commit 08f479a

Browse files
committed
caja-progress-info: show notifications with the gsettings key:
org.mate.caja.preferences.show-notifications Closes #1093
1 parent d054f14 commit 08f479a

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

‎libcaja-private/caja-progress-info.c‎

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
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

3334
enum
@@ -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
}

‎libcaja-private/org.mate.caja.gschema.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@
256256
<key name="show-notifications" type="b">
257257
<default>true</default>
258258
<summary>Whether to show desktop notifications</summary>
259-
<description>If set to true, Caja will show desktop notifications for eject events</description>
259+
<description>If set to true, Caja will show desktop notifications.</description>
260260
</key>
261261
</schema>
262262

0 commit comments

Comments
 (0)