From 60eedc7c6dcb23e7596e1791843e0ce8cf92269a Mon Sep 17 00:00:00 2001 From: James Booth Date: Wed, 17 Sep 2014 00:49:06 +0100 Subject: Added field updated message, show form mofified indicator for /wins --- src/command/commands.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/command') diff --git a/src/command/commands.c b/src/command/commands.c index fa439955..d80c935a 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -1877,14 +1877,17 @@ cmd_form(gchar **args, struct cmd_help_t help) case FIELD_TEXT_PRIVATE: case FIELD_JID_SINGLE: form_set_value(current->form, tag, value); + ui_current_print_line("Field updated..."); ui_show_form_field(current, current->form, tag); break; case FIELD_BOOLEAN: if (g_strcmp0(value, "on") == 0) { form_set_value(current->form, tag, "1"); + ui_current_print_line("Field updated..."); ui_show_form_field(current, current->form, tag); } else if (g_strcmp0(value, "off") == 0) { form_set_value(current->form, tag, "0"); + ui_current_print_line("Field updated..."); ui_show_form_field(current, current->form, tag); } else { ui_current_print_line("Value %s not valid for boolean field: %s", value, tag); @@ -1894,6 +1897,7 @@ cmd_form(gchar **args, struct cmd_help_t help) valid = form_field_contains_option(current->form, tag, value); if (valid == TRUE) { form_set_value(current->form, tag, value); + ui_current_print_line("Field updated..."); ui_show_form_field(current, current->form, tag); } else { ui_current_print_line("Value %s not a valid option for field: %s", value, tag); @@ -1935,6 +1939,7 @@ cmd_form(gchar **args, struct cmd_help_t help) if (valid) { added = form_add_unique_value(current->form, tag, value); if (added) { + ui_current_print_line("Field updated..."); ui_show_form_field(current, current->form, tag); } else { ui_current_print_line("Value %s already selected for %s", value, tag); @@ -1945,11 +1950,13 @@ cmd_form(gchar **args, struct cmd_help_t help) break; case FIELD_TEXT_MULTI: form_add_value(current->form, tag, value); + ui_current_print_line("Field updated..."); ui_show_form_field(current, current->form, tag); break; case FIELD_JID_MULTI: added = form_add_unique_value(current->form, tag, value); if (added) { + ui_current_print_line("Field updated..."); ui_show_form_field(current, current->form, tag); } else { ui_current_print_line("JID %s already exists in %s", value, tag); @@ -1991,6 +1998,7 @@ cmd_form(gchar **args, struct cmd_help_t help) if (valid == TRUE) { removed = form_remove_value(current->form, tag, value); if (removed) { + ui_current_print_line("Field updated..."); ui_show_form_field(current, current->form, tag); } else { ui_current_print_line("Value %s is not currently set for %s", value, tag); @@ -2017,6 +2025,7 @@ cmd_form(gchar **args, struct cmd_help_t help) removed = form_remove_text_multi_value(current->form, tag, index); if (removed) { + ui_current_print_line("Field updated..."); ui_show_form_field(current, current->form, tag); } else { ui_current_print_line("Could not remove %s from %s", value, tag); @@ -2025,6 +2034,7 @@ cmd_form(gchar **args, struct cmd_help_t help) case FIELD_JID_MULTI: removed = form_remove_value(current->form, tag, value); if (removed) { + ui_current_print_line("Field updated..."); ui_show_form_field(current, current->form, tag); } else { ui_current_print_line("Field %s does not contain %s", tag, value); -- cgit 1.4.1-2-gfad0