Example #1
0
static void
handle_new_progress_info (CajaProgressInfo *info)
{
    GtkWidget *window, *progress;

    window = get_progress_window ();

    progress = progress_widget_new (info);
    gtk_box_pack_start (GTK_BOX (gtk_bin_get_child (GTK_BIN (window))),
                        progress,
                        FALSE, FALSE, 6);

    gtk_window_present (GTK_WINDOW (window));

    n_progress_ops++;
    update_status_icon_and_window ();
}
static void
update_status_icon_and_window (void)
{
	char *tooltip;

	tooltip = g_strdup_printf (ngettext ("%'d file operation active",
					     "%'d file operations active",
					     n_progress_ops),
				   n_progress_ops);
	gtk_status_icon_set_tooltip_text (status_icon, tooltip);
	g_free (tooltip);
	
	if (n_progress_ops == 0) {
		gtk_status_icon_set_visible (status_icon, FALSE);
		gtk_widget_hide (get_progress_window ());
	} else {
		gtk_status_icon_set_visible (status_icon, TRUE);
	}
}