diff options
author | xclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4> | 2008-10-17 20:46:51 +0800 |
---|---|---|
committer | xclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4> | 2008-10-17 20:46:51 +0800 |
commit | 5c44736e019ce8487a0856c188846b899c83b3a7 (patch) | |
tree | aca6affbc71ab92dfec32c360835df18d78edbf7 /src | |
parent | 4d5b6f406262ba5ecfe7cb699cb26c36125b6d18 (diff) | |
download | gsoc2013-empathy-5c44736e019ce8487a0856c188846b899c83b3a7.tar gsoc2013-empathy-5c44736e019ce8487a0856c188846b899c83b3a7.tar.gz gsoc2013-empathy-5c44736e019ce8487a0856c188846b899c83b3a7.tar.bz2 gsoc2013-empathy-5c44736e019ce8487a0856c188846b899c83b3a7.tar.lz gsoc2013-empathy-5c44736e019ce8487a0856c188846b899c83b3a7.tar.xz gsoc2013-empathy-5c44736e019ce8487a0856c188846b899c83b3a7.tar.zst gsoc2013-empathy-5c44736e019ce8487a0856c188846b899c83b3a7.zip |
Fill the tree view with Pidgin accounts to import. (Jonny Lamb)
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
git-svn-id: svn+ssh://svn.gnome.org/svn/empathy/trunk@1613 4ee84921-47dd-4033-b63a-18d7a039a3e4
Diffstat (limited to 'src')
-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)); |