mirror of
https://github.com/profanity-im/profanity.git
synced 2025-02-02 15:08:15 -05:00
Added field updated message, show form mofified indicator for /wins
This commit is contained in:
parent
0de9c1bdda
commit
60eedc7c6d
@ -1877,14 +1877,17 @@ cmd_form(gchar **args, struct cmd_help_t help)
|
|||||||
case FIELD_TEXT_PRIVATE:
|
case FIELD_TEXT_PRIVATE:
|
||||||
case FIELD_JID_SINGLE:
|
case FIELD_JID_SINGLE:
|
||||||
form_set_value(current->form, tag, value);
|
form_set_value(current->form, tag, value);
|
||||||
|
ui_current_print_line("Field updated...");
|
||||||
ui_show_form_field(current, current->form, tag);
|
ui_show_form_field(current, current->form, tag);
|
||||||
break;
|
break;
|
||||||
case FIELD_BOOLEAN:
|
case FIELD_BOOLEAN:
|
||||||
if (g_strcmp0(value, "on") == 0) {
|
if (g_strcmp0(value, "on") == 0) {
|
||||||
form_set_value(current->form, tag, "1");
|
form_set_value(current->form, tag, "1");
|
||||||
|
ui_current_print_line("Field updated...");
|
||||||
ui_show_form_field(current, current->form, tag);
|
ui_show_form_field(current, current->form, tag);
|
||||||
} else if (g_strcmp0(value, "off") == 0) {
|
} else if (g_strcmp0(value, "off") == 0) {
|
||||||
form_set_value(current->form, tag, "0");
|
form_set_value(current->form, tag, "0");
|
||||||
|
ui_current_print_line("Field updated...");
|
||||||
ui_show_form_field(current, current->form, tag);
|
ui_show_form_field(current, current->form, tag);
|
||||||
} else {
|
} else {
|
||||||
ui_current_print_line("Value %s not valid for boolean field: %s", value, tag);
|
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);
|
valid = form_field_contains_option(current->form, tag, value);
|
||||||
if (valid == TRUE) {
|
if (valid == TRUE) {
|
||||||
form_set_value(current->form, tag, value);
|
form_set_value(current->form, tag, value);
|
||||||
|
ui_current_print_line("Field updated...");
|
||||||
ui_show_form_field(current, current->form, tag);
|
ui_show_form_field(current, current->form, tag);
|
||||||
} else {
|
} else {
|
||||||
ui_current_print_line("Value %s not a valid option for field: %s", value, tag);
|
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) {
|
if (valid) {
|
||||||
added = form_add_unique_value(current->form, tag, value);
|
added = form_add_unique_value(current->form, tag, value);
|
||||||
if (added) {
|
if (added) {
|
||||||
|
ui_current_print_line("Field updated...");
|
||||||
ui_show_form_field(current, current->form, tag);
|
ui_show_form_field(current, current->form, tag);
|
||||||
} else {
|
} else {
|
||||||
ui_current_print_line("Value %s already selected for %s", value, tag);
|
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;
|
break;
|
||||||
case FIELD_TEXT_MULTI:
|
case FIELD_TEXT_MULTI:
|
||||||
form_add_value(current->form, tag, value);
|
form_add_value(current->form, tag, value);
|
||||||
|
ui_current_print_line("Field updated...");
|
||||||
ui_show_form_field(current, current->form, tag);
|
ui_show_form_field(current, current->form, tag);
|
||||||
break;
|
break;
|
||||||
case FIELD_JID_MULTI:
|
case FIELD_JID_MULTI:
|
||||||
added = form_add_unique_value(current->form, tag, value);
|
added = form_add_unique_value(current->form, tag, value);
|
||||||
if (added) {
|
if (added) {
|
||||||
|
ui_current_print_line("Field updated...");
|
||||||
ui_show_form_field(current, current->form, tag);
|
ui_show_form_field(current, current->form, tag);
|
||||||
} else {
|
} else {
|
||||||
ui_current_print_line("JID %s already exists in %s", value, tag);
|
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) {
|
if (valid == TRUE) {
|
||||||
removed = form_remove_value(current->form, tag, value);
|
removed = form_remove_value(current->form, tag, value);
|
||||||
if (removed) {
|
if (removed) {
|
||||||
|
ui_current_print_line("Field updated...");
|
||||||
ui_show_form_field(current, current->form, tag);
|
ui_show_form_field(current, current->form, tag);
|
||||||
} else {
|
} else {
|
||||||
ui_current_print_line("Value %s is not currently set for %s", value, tag);
|
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);
|
removed = form_remove_text_multi_value(current->form, tag, index);
|
||||||
if (removed) {
|
if (removed) {
|
||||||
|
ui_current_print_line("Field updated...");
|
||||||
ui_show_form_field(current, current->form, tag);
|
ui_show_form_field(current, current->form, tag);
|
||||||
} else {
|
} else {
|
||||||
ui_current_print_line("Could not remove %s from %s", value, tag);
|
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:
|
case FIELD_JID_MULTI:
|
||||||
removed = form_remove_value(current->form, tag, value);
|
removed = form_remove_value(current->form, tag, value);
|
||||||
if (removed) {
|
if (removed) {
|
||||||
|
ui_current_print_line("Field updated...");
|
||||||
ui_show_form_field(current, current->form, tag);
|
ui_show_form_field(current, current->form, tag);
|
||||||
} else {
|
} else {
|
||||||
ui_current_print_line("Field %s does not contain %s", tag, value);
|
ui_current_print_line("Field %s does not contain %s", tag, value);
|
||||||
|
@ -618,6 +618,9 @@ wins_create_summary(void)
|
|||||||
case WIN_MUC_CONFIG:
|
case WIN_MUC_CONFIG:
|
||||||
muc_config_string = g_string_new("");
|
muc_config_string = g_string_new("");
|
||||||
g_string_printf(muc_config_string, "%d: %s", ui_index, window->from);
|
g_string_printf(muc_config_string, "%d: %s", ui_index, window->from);
|
||||||
|
if ((window->form != NULL) && (window->form->modified)) {
|
||||||
|
g_string_append(muc_config_string, " *");
|
||||||
|
}
|
||||||
result = g_slist_append(result, strdup(muc_config_string->str));
|
result = g_slist_append(result, strdup(muc_config_string->str));
|
||||||
g_string_free(muc_config_string, TRUE);
|
g_string_free(muc_config_string, TRUE);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user