diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2008-10-17 20:46:51 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2008-10-17 20:46:51 +0800 |
commit | 87a58a19ed00a4ca50af53e1cf5db8a6d4462537 (patch) | |
tree | aca6affbc71ab92dfec32c360835df18d78edbf7 | |
parent | c1a4edc74d9514e56057d856e576579ecbc2b5fb (diff) | |
download | gsoc2013-empathy-87a58a19ed00a4ca50af53e1cf5db8a6d4462537.tar gsoc2013-empathy-87a58a19ed00a4ca50af53e1cf5db8a6d4462537.tar.gz gsoc2013-empathy-87a58a19ed00a4ca50af53e1cf5db8a6d4462537.tar.bz2 gsoc2013-empathy-87a58a19ed00a4ca50af53e1cf5db8a6d4462537.tar.lz gsoc2013-empathy-87a58a19ed00a4ca50af53e1cf5db8a6d4462537.tar.xz gsoc2013-empathy-87a58a19ed00a4ca50af53e1cf5db8a6d4462537.tar.zst gsoc2013-empathy-87a58a19ed00a4ca50af53e1cf5db8a6d4462537.zip |
Fill the tree view with Pidgin accounts to import. (Jonny Lamb)
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
svn path=/trunk/; revision=1613
-rw-r--r-- | src/empathy-import-dialog.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/empathy-import-dialog.c b/src/empathy-import-dialog.c index 9aae07a96..cf0db9511 100644 --- a/src/empathy-import-dialog.c +++ b/src/empathy-import-dialog.c @@ -117,7 +117,7 @@ enum COL_PROTOCOL, COL_NAME, COL_SOURCE, - COL_ACCOUNT, + COL_ACCOUNT_DATA, COL_COUNT }; @@ -433,23 +433,28 @@ import_dialog_add_accounts (EmpathyImportDialog *dialog) model = gtk_tree_view_get_model (GTK_TREE_VIEW (dialog->treeview)); - accounts = g_list_alloc (); + accounts = import_dialog_pidgin_load (); for (account = accounts; account; account = account->next) { - /* Add the accounts here. */ - } + GValue *value, *account_data; + AccountData *data = (AccountData *) account->data; - /* A sample item for testing. */ - gtk_list_store_append (GTK_LIST_STORE (model), &iter); + account_data = tp_g_value_slice_new (G_TYPE_POINTER); + g_value_set_pointer (account_data, data); - gtk_list_store_set (GTK_LIST_STORE (model), &iter, - COL_IMPORT, TRUE, - COL_PROTOCOL, "Jabber", - COL_NAME, "foo@gmail.com", - COL_SOURCE, "Pidgin", - COL_ACCOUNT, NULL, - -1); + value = g_hash_table_lookup (data->settings, "account"); + + gtk_list_store_append (GTK_LIST_STORE (model), &iter); + + gtk_list_store_set (GTK_LIST_STORE (model), &iter, + COL_IMPORT, TRUE, + COL_PROTOCOL, data->protocol, + COL_NAME, g_value_get_string (value), + COL_SOURCE, "Pidgin", + COL_ACCOUNT_DATA, account_data, + -1); + } g_list_free (accounts); } @@ -484,7 +489,7 @@ import_dialog_set_up_account_list (EmpathyImportDialog *dialog) GtkCellRenderer *cell; store = gtk_list_store_new (COL_COUNT, G_TYPE_BOOLEAN, G_TYPE_STRING, - G_TYPE_STRING, G_TYPE_STRING, G_TYPE_HASH_TABLE); + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_VALUE); gtk_tree_view_set_model (GTK_TREE_VIEW (dialog->treeview), GTK_TREE_MODEL (store)); |