From f3d884d8ddc2fbe3e2db3d333f41f03036ab71a4 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 26 Aug 2010 15:38:18 +0200 Subject: accounts-dialog: display loading page while loading accounts (#611701) --- src/empathy-accounts-dialog.c | 27 +++++++++++++++++++++++++++ src/empathy-accounts-dialog.ui | 29 ++++++++++++++++++++++++++++- 2 files changed, 55 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c index d97cf6507..994d85e06 100644 --- a/src/empathy-accounts-dialog.c +++ b/src/empathy-accounts-dialog.c @@ -71,6 +71,12 @@ #define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyAccountsDialog) G_DEFINE_TYPE (EmpathyAccountsDialog, empathy_accounts_dialog, GTK_TYPE_DIALOG); +enum +{ + NOTEBOOK_PAGE_ACCOUNT = 0, + NOTEBOOK_PAGE_LOADING +}; + typedef struct { GtkWidget *alignment_settings; GtkWidget *alignment_infobar; @@ -96,6 +102,9 @@ typedef struct { GtkWidget *label_type; GtkWidget *settings_widget; + GtkWidget *notebook_account; + GtkWidget *spinner; + /* We have to keep a reference on the actual EmpathyAccountWidget, not just * his GtkWidget. It is the only reliable source we can query to know if * there are any unsaved changes to the currently selected account. We can't @@ -1866,6 +1875,10 @@ finished_loading (EmpathyAccountsDialog *self) gtk_widget_set_sensitive (priv->button_add, TRUE); gtk_widget_set_sensitive (priv->button_import, TRUE); + + gtk_spinner_stop (GTK_SPINNER (priv->spinner)); + gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook_account), + NOTEBOOK_PAGE_ACCOUNT); } static void @@ -1997,6 +2010,7 @@ accounts_dialog_build_ui (EmpathyAccountsDialog *dialog) EmpathyAccountsDialogPriv *priv = GET_PRIV (dialog); GtkWidget *content_area; GtkWidget *action_area, *vbox, *hbox, *align; + GtkWidget *alig; filename = empathy_file_lookup ("empathy-accounts-dialog.ui", "src"); @@ -2011,6 +2025,8 @@ accounts_dialog_build_ui (EmpathyAccountsDialog *dialog) "button_remove", &priv->button_remove, "button_import", &priv->button_import, "hbox_protocol", &priv->hbox_protocol, + "notebook_account", &priv->notebook_account, + "alignment_loading", &alig, NULL); g_free (filename); @@ -2035,6 +2051,17 @@ accounts_dialog_build_ui (EmpathyAccountsDialog *dialog) gtk_widget_hide (priv->button_remove); #endif /* HAVE_MEEGO */ + /* Display loading page */ + priv->spinner = gtk_spinner_new (); + + gtk_spinner_start (GTK_SPINNER (priv->spinner)); + gtk_widget_show (priv->spinner); + + gtk_container_add (GTK_CONTAINER (alig), priv->spinner); + + gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook_account), + NOTEBOOK_PAGE_LOADING); + /* Remove button is insensitive until we have a selected account */ gtk_widget_set_sensitive (priv->button_remove, FALSE); diff --git a/src/empathy-accounts-dialog.ui b/src/empathy-accounts-dialog.ui index 5af524ad3..049c06ce4 100644 --- a/src/empathy-accounts-dialog.ui +++ b/src/empathy-accounts-dialog.ui @@ -216,7 +216,34 @@ - + + True + + + True + 12 + + + + + + 0 + + + + + True + <b><span size='xx-large'>Loading account information</span></b> + True + + + 1 + + + + + 1 + -- cgit v1.2.3