summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2018-06-07 14:05:28 +0200
committerlukefromdc <[email protected]>2018-06-07 14:30:12 -0400
commita797afc41638ca9dedd432eee2f2c53e00411926 (patch)
treef364f0bb2778df941590ee6d7cfe93f8cb4ca98d
parent639c9028f8fd42c495296031e04e7b2117759d61 (diff)
downloadcaja-a797afc41638ca9dedd432eee2f2c53e00411926.tar.bz2
caja-a797afc41638ca9dedd432eee2f2c53e00411926.tar.xz
caja-progress-info.c: show notifications in begin/end of progress
-rw-r--r--libcaja-private/caja-progress-info.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/libcaja-private/caja-progress-info.c b/libcaja-private/caja-progress-info.c
index 0c4720a9..33f592a6 100644
--- a/libcaja-private/caja-progress-info.c
+++ b/libcaja-private/caja-progress-info.c
@@ -595,7 +595,13 @@ update_status_icon_and_window (void)
{
char *tooltip;
gboolean toshow;
- static gboolean window_shown = TRUE;
+ GIcon *icon;
+ GNotification *notification;
+ static gboolean window_shown = FALSE;
+
+ notification = g_notification_new ("caja");
+ icon = g_themed_icon_new ("system-file-manager");
+ g_notification_set_icon (notification, icon);
tooltip = g_strdup_printf (ngettext ("%'d file operation active",
"%'d file operations active",
@@ -607,17 +613,25 @@ update_status_icon_and_window (void)
toshow = (n_progress_ops > 0);
- if (!toshow && window_shown)
+ if (!toshow)
{
gtk_status_icon_set_visible (status_icon, FALSE);
- gtk_widget_hide (get_progress_window ());
- window_shown = FALSE;
+
+ if (window_shown)
+ {
+ gtk_widget_hide (get_progress_window ());
+ g_notification_set_body (notification, _("Process completed"));
+ g_application_send_notification (g_application_get_default (), "caja", notification);
+ window_shown = FALSE;
+ }
}
else if (toshow && !window_shown)
{
gtk_widget_show_all (get_progress_window ());
gtk_status_icon_set_visible (status_icon, TRUE);
gtk_window_present (GTK_WINDOW (get_progress_window ()));
+ g_notification_set_body (notification, _("Working..."));
+ g_application_send_notification (g_application_get_default (), "caja", notification);
window_shown = TRUE;
}
}