aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libempathy-gtk/empathy-irc-network-chooser-dialog.c26
-rw-r--r--src/empathy-accounts-dialog.c20
2 files changed, 39 insertions, 7 deletions
diff --git a/libempathy-gtk/empathy-irc-network-chooser-dialog.c b/libempathy-gtk/empathy-irc-network-chooser-dialog.c
index c1335e539..a42c21f19 100644
--- a/libempathy-gtk/empathy-irc-network-chooser-dialog.c
+++ b/libempathy-gtk/empathy-irc-network-chooser-dialog.c
@@ -356,17 +356,33 @@ remove_network (EmpathyIrcNetworkChooserDialog *self)
DEBUG ("Remove network %s", empathy_irc_network_get_name (network));
- gtk_list_store_remove (priv->store, &iter);
- empathy_irc_network_manager_remove (priv->network_manager, network);
-
- /* Select next network */
- if (gtk_tree_model_iter_next (GTK_TREE_MODEL (priv->store), &iter))
+ /* Delete network and select next network */
+ if (gtk_list_store_remove (priv->store, &iter))
{
GtkTreeIter filter_iter = iter_to_filter_iter (self, &iter);
select_iter (self, &filter_iter, TRUE);
}
+ else
+ {
+ /* this should only happen if the last network was deleted */
+ GtkTreeIter last, filter_iter;
+ gint n_elements;
+
+ n_elements = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (priv->store),
+ NULL);
+
+ if (n_elements > 0)
+ {
+ gtk_tree_model_iter_nth_child (GTK_TREE_MODEL (priv->store), &last,
+ NULL, (n_elements-1));
+ filter_iter = iter_to_filter_iter (self, &last);
+ select_iter (self, &filter_iter, TRUE);
+ }
+ }
+
+ empathy_irc_network_manager_remove (priv->network_manager, network);
gtk_widget_grab_focus (priv->treeview);
g_object_unref (network);
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c
index c753a9f20..d97cf6507 100644
--- a/src/empathy-accounts-dialog.c
+++ b/src/empathy-accounts-dialog.c
@@ -1860,6 +1860,15 @@ accounts_dialog_set_selected_account (EmpathyAccountsDialog *dialog,
}
static void
+finished_loading (EmpathyAccountsDialog *self)
+{
+ EmpathyAccountsDialogPriv *priv = GET_PRIV (self);
+
+ gtk_widget_set_sensitive (priv->button_add, TRUE);
+ gtk_widget_set_sensitive (priv->button_import, TRUE);
+}
+
+static void
accounts_dialog_cms_prepare_cb (GObject *source,
GAsyncResult *result,
gpointer user_data)
@@ -1869,7 +1878,7 @@ accounts_dialog_cms_prepare_cb (GObject *source,
EmpathyAccountsDialogPriv *priv = GET_PRIV (dialog);
if (!empathy_connection_managers_prepare_finish (cms, result, NULL))
- return;
+ goto out;
accounts_dialog_update_settings (dialog, NULL);
@@ -1879,6 +1888,9 @@ accounts_dialog_cms_prepare_cb (GObject *source,
g_object_unref (priv->initial_selection);
priv->initial_selection = NULL;
}
+
+out:
+ finished_loading (dialog);
}
static void
@@ -2023,9 +2035,13 @@ accounts_dialog_build_ui (EmpathyAccountsDialog *dialog)
gtk_widget_hide (priv->button_remove);
#endif /* HAVE_MEEGO */
- /* Remove button is unsensitive until we have a selected account */
+ /* Remove button is insensitive until we have a selected account */
gtk_widget_set_sensitive (priv->button_remove, FALSE);
+ /* Add and Import buttons are insensitive while the dialog is loading */
+ gtk_widget_set_sensitive (priv->button_add, FALSE);
+ gtk_widget_set_sensitive (priv->button_import, FALSE);
+
priv->combobox_protocol = empathy_protocol_chooser_new ();
gtk_box_pack_start (GTK_BOX (priv->hbox_protocol), priv->combobox_protocol,
TRUE, TRUE, 0);