aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-02-15 23:16:18 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-02-16 21:10:32 +0800
commit4adfd6f5bf317845bed8b421c284ebb44097b5c5 (patch)
tree094db5df0a1fd269cbad9915aaa4351b0aabf865
parent55fab807184bdb0d30c43d2de6e91532cfdf8ccf (diff)
downloadgsoc2013-empathy-4adfd6f5bf317845bed8b421c284ebb44097b5c5.tar
gsoc2013-empathy-4adfd6f5bf317845bed8b421c284ebb44097b5c5.tar.gz
gsoc2013-empathy-4adfd6f5bf317845bed8b421c284ebb44097b5c5.tar.bz2
gsoc2013-empathy-4adfd6f5bf317845bed8b421c284ebb44097b5c5.tar.lz
gsoc2013-empathy-4adfd6f5bf317845bed8b421c284ebb44097b5c5.tar.xz
gsoc2013-empathy-4adfd6f5bf317845bed8b421c284ebb44097b5c5.tar.zst
gsoc2013-empathy-4adfd6f5bf317845bed8b421c284ebb44097b5c5.zip
accounts_dialog_add_account: select if that's the first account added
This ensures we'll select the first imported account. https://bugzilla.gnome.org/show_bug.cgi?id=670203
-rw-r--r--src/empathy-accounts-dialog.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c
index 35cb9bdb3..6c452b6b2 100644
--- a/src/empathy-accounts-dialog.c
+++ b/src/empathy-accounts-dialog.c
@@ -1857,6 +1857,7 @@ accounts_dialog_add_account (EmpathyAccountsDialog *dialog,
const gchar *name;
EmpathyAccountsDialogPriv *priv = GET_PRIV (dialog);
gboolean selected = FALSE;
+ GtkTreeSelection *selection;
model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->treeview));
status = tp_account_get_connection_status (account, NULL);
@@ -1864,15 +1865,18 @@ accounts_dialog_add_account (EmpathyAccountsDialog *dialog,
settings = empathy_account_settings_new_for_account (account);
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->treeview));
+
if (!accounts_dialog_get_account_iter (dialog, account, &iter))
{
+ /* Select the account if it's the first added */
+ if (gtk_tree_selection_count_selected_rows (selection) == 0)
+ selected = TRUE;
+
gtk_list_store_append (GTK_LIST_STORE (model), &iter);
}
else
{
- GtkTreeSelection *selection;
-
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->treeview));
selected = gtk_tree_selection_iter_is_selected (selection, &iter);
}