From b6f4faf55bc19dfe1ba71ba29a9c1fb9c2935110 Mon Sep 17 00:00:00 2001 From: James Booth Date: Wed, 10 Sep 2014 00:07:31 +0100 Subject: Implemented list-multi display for room config forms --- src/ui/core.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/ui/core.c b/src/ui/core.c index 4f34a210..532161cf 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -1969,6 +1969,20 @@ TODO add command to get help for a field } } if (g_strcmp0(field->type, "list-multi") == 0) { + if (curr_value != NULL) { + win_save_newline(window); + GSList *options = field->options; + GSList *curr_option = options; + while (curr_option != NULL) { + FormOption *option = curr_option->data; + if (g_slist_find_custom(curr_value, option->value, (GCompareFunc)g_strcmp0) != NULL) { + win_save_vprint(window, '-', NULL, 0, COLOUR_ONLINE, "", " %s (%s)", option->label, option->value); + } else { + win_save_vprint(window, '-', NULL, 0, 0, "", " %s (%s)", option->label, option->value); + } + curr_option = g_slist_next(curr_option); + } + } } if (g_strcmp0(field->type, "jid-multi") == 0) { } -- cgit 1.4.1-2-gfad0