about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-09-10 00:07:31 +0100
committerJames Booth <boothj5@gmail.com>2014-09-10 00:07:31 +0100
commitb6f4faf55bc19dfe1ba71ba29a9c1fb9c2935110 (patch)
treeaa1acceddca953683a4189da7f1dbc474f816d49 /src
parentf6c236035a69fa90604e73ec919b5f9e24b6a2b3 (diff)
downloadprofani-tty-b6f4faf55bc19dfe1ba71ba29a9c1fb9c2935110.tar.gz
Implemented list-multi display for room config forms
Diffstat (limited to 'src')
-rw-r--r--src/ui/core.c14
1 files changed, 14 insertions, 0 deletions
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) {
             }