Mercurial > pidgin
changeset 7902:3ca501305ac5
[gaim-migrate @ 8562]
More list field API functions. The UI part is almost done.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Sun, 21 Dec 2003 08:50:34 +0000 |
parents | 4344f7fad009 |
children | d91806e4ea64 |
files | src/request.c src/request.h |
diffstat | 2 files changed, 36 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/request.c Sun Dec 21 08:30:53 2003 +0000 +++ b/src/request.c Sun Dec 21 08:50:34 2003 +0000 @@ -692,6 +692,26 @@ } void +gaim_request_field_list_add_selected(GaimRequestField *field, const char *item) +{ + g_return_if_fail(field != NULL); + g_return_if_fail(item != NULL); + g_return_if_fail(field->type == GAIM_REQUEST_FIELD_LIST); + + field->u.list.selected = + g_list_append(field->u.list.selected, g_strdup(item)); +} + +void +gaim_request_field_list_clear_selected(GaimRequestField *field) +{ + g_return_if_fail(field != NULL); + g_return_if_fail(field->type == GAIM_REQUEST_FIELD_LIST); + + gaim_request_field_list_set_selected(field, NULL); +} + +void gaim_request_field_list_set_selected(GaimRequestField *field, GList *items) { g_return_if_fail(field != NULL);
--- a/src/request.h Sun Dec 21 08:30:53 2003 +0000 +++ b/src/request.h Sun Dec 21 08:50:34 2003 +0000 @@ -733,6 +733,22 @@ void gaim_request_field_list_add(GaimRequestField *field, const char *item); /** + * Adds a selected item to the list field. + * + * @param field The field. + * @param item The item to add. + */ +void gaim_request_field_list_add_selected(GaimRequestField *field, + const char *item); + +/** + * Clears the list of selected items in a list field. + * + * @param field The field. + */ +void gaim_request_field_list_clear_selected(GaimRequestField *field); + +/** * Sets a list of selected items in a list field. * * @param field The field.