[accounts-dialog] Add wait cursor when showing the language dialog



commit b439b634928846b5c4236797ebaf3114872ca888
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Mar 3 00:27:05 2010 -0500

    Add wait cursor when showing the language dialog

 src/main.c |   42 ++++++++++++++++++++++++++++++++----------
 1 files changed, 32 insertions(+), 10 deletions(-)
---
diff --git a/src/main.c b/src/main.c
index 451cee6..5469214 100644
--- a/src/main.c
+++ b/src/main.c
@@ -736,6 +736,27 @@ language_response (GtkDialog         *dialog,
         gtk_notebook_set_current_page (GTK_NOTEBOOK (get_widget (d, "account-language-notebook")), 1);
 }
 
+static gboolean
+finish_language_chooser (UserAccountDialog *d)
+{
+        GtkWidget *combo;
+
+        combo = get_widget (d, "account-language-combo");
+        d->language_chooser = um_language_chooser_new ();
+        gtk_window_set_transient_for (GTK_WINDOW (d->language_chooser),
+                                      GTK_WINDOW (d->main_window));
+        g_signal_connect (d->language_chooser, "response",
+                          G_CALLBACK (language_response), d);
+        g_signal_connect (d->language_chooser, "delete-event",
+                          G_CALLBACK (gtk_widget_hide_on_delete), NULL);
+
+        gdk_window_set_cursor (gtk_widget_get_window (d->main_window), NULL);
+        gtk_window_present (GTK_WINDOW (d->language_chooser));
+        gtk_widget_set_sensitive (GTK_WIDGET (combo), FALSE);
+
+        return FALSE;
+}
+
 static void
 language_changed (GtkComboBox       *combo,
                   UserAccountDialog *d)
@@ -744,6 +765,7 @@ language_changed (GtkComboBox       *combo,
         GtkTreeIter iter;
         gchar *lang;
         UmUser *user;
+        GdkCursor *cursor;
 
         if (!gtk_combo_box_get_active_iter (combo, &iter))
                  return;
@@ -760,18 +782,18 @@ language_changed (GtkComboBox       *combo,
                 return;
         }
 
-        if (!d->language_chooser) {
-                d->language_chooser = um_language_chooser_new ();
-                gtk_window_set_transient_for (GTK_WINDOW (d->language_chooser),
-                                              GTK_WINDOW (d->main_window));
-                g_signal_connect (d->language_chooser, "response",
-                                  G_CALLBACK (language_response), d);
-                g_signal_connect (d->language_chooser, "delete-event",
-                                  G_CALLBACK (gtk_widget_hide_on_delete), NULL);
+        if (d->language_chooser) {
+                gtk_window_present (GTK_WINDOW (d->language_chooser));
+                gtk_widget_set_sensitive (GTK_WIDGET (combo), FALSE);
+                return;
         }
 
-        gtk_window_present (GTK_WINDOW (d->language_chooser));
-        gtk_widget_set_sensitive (GTK_WIDGET (combo), FALSE);
+        cursor = gdk_cursor_new (GDK_WATCH);
+        gdk_window_set_cursor (gtk_widget_get_window (d->main_window),
+                               cursor);
+        gdk_cursor_unref (cursor);
+
+        g_idle_add (finish_language_chooser, d);
 }
 
 static gboolean



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]