From 5fc35bd6a64e17db7d6ee4cfcc1077469ead62f4 Mon Sep 17 00:00:00 2001 From: James Booth Date: Fri, 24 Oct 2014 00:21:00 +0100 Subject: [PATCH] Changed room help colour, added whitespace after invalid field setting --- src/command/commands.c | 14 ++++++++++++++ src/ui/core.c | 9 +++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/command/commands.c b/src/command/commands.c index d7ee7854..0dc26fff 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -1835,6 +1835,7 @@ cmd_form_field(char *tag, gchar **args) } else { ui_current_print_line("Invalid command, usage:"); ui_show_form_field_help(current, form, tag); + ui_current_print_line(""); } break; @@ -1845,6 +1846,7 @@ cmd_form_field(char *tag, gchar **args) if (value == NULL) { ui_current_print_line("Invalid command, usage:"); ui_show_form_field_help(current, form, tag); + ui_current_print_line(""); } else { form_set_value(form, tag, value); ui_current_print_line("Field updated..."); @@ -1856,6 +1858,7 @@ cmd_form_field(char *tag, gchar **args) if ((value == NULL) || !form_field_contains_option(form, tag, value)) { ui_current_print_line("Invalid command, usage:"); ui_show_form_field_help(current, form, tag); + ui_current_print_line(""); } else { form_set_value(form, tag, value); ui_current_print_line("Field updated..."); @@ -1871,11 +1874,13 @@ cmd_form_field(char *tag, gchar **args) if ((g_strcmp0(cmd, "add") != 0) && (g_strcmp0(cmd, "remove"))) { ui_current_print_line("Invalid command, usage:"); ui_show_form_field_help(current, form, tag); + ui_current_print_line(""); break; } if (value == NULL) { ui_current_print_line("Invalid command, usage:"); ui_show_form_field_help(current, form, tag); + ui_current_print_line(""); break; } if (g_strcmp0(cmd, "add") == 0) { @@ -1888,11 +1893,13 @@ cmd_form_field(char *tag, gchar **args) if (!g_str_has_prefix(value, "val")) { ui_current_print_line("Invalid command, usage:"); ui_show_form_field_help(current, form, tag); + ui_current_print_line(""); break; } if (strlen(value) < 4) { ui_current_print_line("Invalid command, usage:"); ui_show_form_field_help(current, form, tag); + ui_current_print_line(""); break; } @@ -1900,6 +1907,7 @@ cmd_form_field(char *tag, gchar **args) if ((index < 1) || (index > form_get_value_count(form, tag))) { ui_current_print_line("Invalid command, usage:"); ui_show_form_field_help(current, form, tag); + ui_current_print_line(""); break; } @@ -1920,11 +1928,13 @@ cmd_form_field(char *tag, gchar **args) if ((g_strcmp0(cmd, "add") != 0) && (g_strcmp0(cmd, "remove"))) { ui_current_print_line("Invalid command, usage:"); ui_show_form_field_help(current, form, tag); + ui_current_print_line(""); break; } if (value == NULL) { ui_current_print_line("Invalid command, usage:"); ui_show_form_field_help(current, form, tag); + ui_current_print_line(""); break; } if (g_strcmp0(args[0], "add") == 0) { @@ -1940,6 +1950,7 @@ cmd_form_field(char *tag, gchar **args) } else { ui_current_print_line("Invalid command, usage:"); ui_show_form_field_help(current, form, tag); + ui_current_print_line(""); } break; } @@ -1956,6 +1967,7 @@ cmd_form_field(char *tag, gchar **args) } else { ui_current_print_line("Invalid command, usage:"); ui_show_form_field_help(current, form, tag); + ui_current_print_line(""); } } break; @@ -1967,11 +1979,13 @@ cmd_form_field(char *tag, gchar **args) if ((g_strcmp0(cmd, "add") != 0) && (g_strcmp0(cmd, "remove"))) { ui_current_print_line("Invalid command, usage:"); ui_show_form_field_help(current, form, tag); + ui_current_print_line(""); break; } if (value == NULL) { ui_current_print_line("Invalid command, usage:"); ui_show_form_field_help(current, form, tag); + ui_current_print_line(""); break; } if (g_strcmp0(args[0], "add") == 0) { diff --git a/src/ui/core.c b/src/ui/core.c index 06ef4762..f50ad982 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -2556,7 +2556,8 @@ static void _ui_show_form(ProfWin *window, const char * const room, DataForm *form) { if (form->title != NULL) { - win_save_print(window, '-', NULL, 0, 0, "", form->title); + win_save_print(window, '-', NULL, NO_EOL, 0, "", "Form title: "); + win_save_print(window, '-', NULL, NO_DATE, 0, "", form->title); } else { win_save_vprint(window, '-', NULL, 0, 0, "", "Configuration for room %s.", room); } @@ -2607,9 +2608,9 @@ _ui_handle_room_configuration(const char * const room, DataForm *form) ui_show_form(window, room, form); win_save_print(window, '-', NULL, 0, 0, "", ""); - win_save_print(window, '-', NULL, 0, COLOUR_ROOMINFO, "", "Use '/form submit' to save changes."); - win_save_print(window, '-', NULL, 0, COLOUR_ROOMINFO, "", "Use '/form cancel' to cancel changes."); - win_save_print(window, '-', NULL, 0, COLOUR_ROOMINFO, "", "See '/form help' for more information."); + win_save_print(window, '-', NULL, 0, 0, "", "Use '/form submit' to save changes."); + win_save_print(window, '-', NULL, 0, 0, "", "Use '/form cancel' to cancel changes."); + win_save_print(window, '-', NULL, 0, 0, "", "See '/form help' for more information."); win_save_print(window, '-', NULL, 0, 0, "", ""); }