Mercurial > pidgin
diff console/gntaccount.c @ 13964:0a0d2a1fd2bc
[gaim-migrate @ 16520]
Add multi-column support for GntTree. Use it for email-notifications.
Restore colors before exiting.
committer: Tailor Script <tailor@pidgin.im>
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Wed, 19 Jul 2006 07:12:59 +0000 |
parents | 25be562aaca8 |
children | a71678d2da16 |
line wrap: on
line diff
--- a/console/gntaccount.c Tue Jul 18 07:18:05 2006 +0000 +++ b/console/gntaccount.c Wed Jul 19 07:12:59 2006 +0000 @@ -210,25 +210,26 @@ gnt_box_add_widget(GNT_BOX(accounts.window), gnt_line_new(FALSE)); - accounts.tree = gnt_tree_new(); + accounts.tree = gnt_tree_new_with_columns(2); GNT_WIDGET_SET_FLAGS(accounts.tree, GNT_WIDGET_NO_BORDER); for (iter = gaim_accounts_get_all(); iter; iter = iter->next) { GaimAccount *account = iter->data; - char *str = g_strdup_printf("%s (%s)", - gaim_account_get_username(account), gaim_account_get_protocol_id(account)); gnt_tree_add_choice(GNT_TREE(accounts.tree), account, - str, NULL, NULL); + gnt_tree_create_row(GNT_TREE(accounts.tree), + gaim_account_get_username(account), + gaim_account_get_protocol_name(account)), + NULL, NULL); gnt_tree_set_choice(GNT_TREE(accounts.tree), account, gaim_account_get_enabled(account, GAIM_GNT_UI)); - g_free(str); } g_signal_connect(G_OBJECT(accounts.tree), "toggled", G_CALLBACK(account_toggled), NULL); - gnt_widget_set_size(accounts.tree, 40, 10); + gnt_tree_set_col_width(GNT_TREE(accounts.tree), 0, 40); + gnt_tree_set_col_width(GNT_TREE(accounts.tree), 1, 10); gnt_box_add_widget(GNT_BOX(accounts.window), accounts.tree); gnt_box_add_widget(GNT_BOX(accounts.window), gnt_line_new(FALSE));