diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-08-26 23:15:30 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-08-26 23:23:01 +0800 |
commit | d5872cec74644d7e3c53a65433271ca05c67c4b9 (patch) | |
tree | f4d8f568fdd92b3af3d5269ccb25528e55fb09dc | |
parent | c43467a6cc9dbc9f1e9eab28ce9bfd2feed3f998 (diff) | |
download | gsoc2013-empathy-d5872cec74644d7e3c53a65433271ca05c67c4b9.tar gsoc2013-empathy-d5872cec74644d7e3c53a65433271ca05c67c4b9.tar.gz gsoc2013-empathy-d5872cec74644d7e3c53a65433271ca05c67c4b9.tar.bz2 gsoc2013-empathy-d5872cec74644d7e3c53a65433271ca05c67c4b9.tar.lz gsoc2013-empathy-d5872cec74644d7e3c53a65433271ca05c67c4b9.tar.xz gsoc2013-empathy-d5872cec74644d7e3c53a65433271ca05c67c4b9.tar.zst gsoc2013-empathy-d5872cec74644d7e3c53a65433271ca05c67c4b9.zip |
unsensitive the remove button while loading
-rw-r--r-- | src/empathy-accounts-dialog.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c index 4f09c0e22..4bf692778 100644 --- a/src/empathy-accounts-dialog.c +++ b/src/empathy-accounts-dialog.c @@ -104,6 +104,7 @@ typedef struct { GtkWidget *notebook_account; GtkWidget *spinner; + gboolean loading; /* 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 @@ -1313,7 +1314,8 @@ accounts_dialog_model_selection_changed (GtkTreeSelection *selection, } /* Update remove button sensitivity */ - gtk_widget_set_sensitive (priv->button_remove, is_selection && !creating); + gtk_widget_set_sensitive (priv->button_remove, is_selection && !creating && + !priv->loading); } static void @@ -1872,11 +1874,20 @@ static void finished_loading (EmpathyAccountsDialog *self) { EmpathyAccountsDialogPriv *priv = GET_PRIV (self); + GtkTreeSelection *selection; + gboolean has_selected; + + priv->loading = FALSE; gtk_widget_set_sensitive (priv->button_add, TRUE); gtk_widget_set_sensitive (priv->button_import, TRUE); gtk_widget_set_sensitive (priv->treeview, TRUE); + /* Sensitive the remove button if there is an account selected */ + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->treeview)); + has_selected = gtk_tree_selection_get_selected (selection, NULL, NULL); + gtk_widget_set_sensitive (priv->button_remove, has_selected); + gtk_spinner_stop (GTK_SPINNER (priv->spinner)); gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook_account), NOTEBOOK_PAGE_ACCOUNT); @@ -2053,6 +2064,8 @@ accounts_dialog_build_ui (EmpathyAccountsDialog *dialog) #endif /* HAVE_MEEGO */ /* Display loading page */ + priv->loading = TRUE; + priv->spinner = gtk_spinner_new (); gtk_spinner_start (GTK_SPINNER (priv->spinner)); |