[Xfce4-commits] <thunar:master> Avoid to show progress status icon for very short jobs.

Jannis Pohlmann jannis at xfce.org
Sun Sep 13 15:52:08 CEST 2009


Updating branch refs/heads/master
         to a6e275939ec75ba9237ba30dd9ae3d88c57e18e9 (commit)
       from f6ffe526899a8a0528be175b6619b4615ec141d3 (commit)

commit a6e275939ec75ba9237ba30dd9ae3d88c57e18e9
Author: Jannis Pohlmann <jannis at xfce.org>
Date:   Sun Sep 13 13:55:18 2009 +0200

    Avoid to show progress status icon for very short jobs.
    
    This is done by making it visible only when the progress dialog is
    shown, not whenever a job is added or removed.

 thunar/thunar-progress-dialog.c |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/thunar/thunar-progress-dialog.c b/thunar/thunar-progress-dialog.c
index bd86819..b4ed669 100644
--- a/thunar/thunar-progress-dialog.c
+++ b/thunar/thunar-progress-dialog.c
@@ -36,6 +36,7 @@
 
 static void     thunar_progress_dialog_dispose            (GObject              *object);
 static void     thunar_progress_dialog_finalize           (GObject              *object);
+static void     thunar_progress_dialog_shown              (ThunarProgressDialog *dialog);
 static gboolean thunar_progress_dialog_closed             (ThunarProgressDialog *dialog);
 static gboolean thunar_progress_dialog_toggled            (ThunarProgressDialog *dialog, 
                                                            GdkEventButton       *button,
@@ -94,6 +95,9 @@ thunar_progress_dialog_init (ThunarProgressDialog *dialog)
   gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), FALSE);
   gtk_window_set_type_hint (GTK_WINDOW (dialog), GDK_WINDOW_TYPE_HINT_NORMAL);
 
+  g_signal_connect_swapped (dialog, "show", 
+                            G_CALLBACK (thunar_progress_dialog_shown), dialog);
+
   g_signal_connect (dialog, "delete-event", 
                     G_CALLBACK (thunar_progress_dialog_closed), dialog);
 
@@ -140,6 +144,17 @@ thunar_progress_dialog_finalize (GObject *object)
 
 
 
+static void
+thunar_progress_dialog_shown (ThunarProgressDialog *dialog)
+{
+  _thunar_return_if_fail (THUNAR_IS_PROGRESS_DIALOG (dialog));
+
+  /* show the status icon */
+  gtk_status_icon_set_visible (dialog->status_icon, TRUE);
+}
+
+
+
 static gboolean
 thunar_progress_dialog_closed (ThunarProgressDialog *dialog)
 {
@@ -248,9 +263,6 @@ thunar_progress_dialog_update_status_icon (ThunarProgressDialog *dialog)
 
   _thunar_return_if_fail (THUNAR_IS_PROGRESS_DIALOG (dialog));
   
-  /* make the status icon visible */
-  gtk_status_icon_set_visible (dialog->status_icon, TRUE);
-
   /* determine the number of views now being active */
   n_views = g_list_length (dialog->views);
 



More information about the Xfce4-commits mailing list