diff options
author | Paul Fariello <paul@fariello.eu> | 2018-04-11 22:17:50 +0520 |
---|---|---|
committer | Paul Fariello <paul@fariello.eu> | 2018-09-05 13:51:00 +0200 |
commit | a952776b899dd29056ad6779b14dab75a4125924 (patch) | |
tree | 305ff2a8375459633b5bbeb79f856c9564c136a6 /src | |
parent | 7123e94e82e1408b9abab1a9043617f58d396849 (diff) | |
download | profani-tty-a952776b899dd29056ad6779b14dab75a4125924.tar.gz |
Rename mucconf wins into conf wins
Configuration windows are now being used by both muc and cmd.
Diffstat (limited to 'src')
-rw-r--r-- | src/command/cmd_ac.c | 16 | ||||
-rw-r--r-- | src/command/cmd_defs.c | 8 | ||||
-rw-r--r-- | src/command/cmd_funcs.c | 80 | ||||
-rw-r--r-- | src/config/preferences.c | 10 | ||||
-rw-r--r-- | src/config/preferences.h | 2 | ||||
-rw-r--r-- | src/config/theme.c | 2 | ||||
-rw-r--r-- | src/ui/confwin.c (renamed from src/ui/mucconfwin.c) | 26 | ||||
-rw-r--r-- | src/ui/console.c | 10 | ||||
-rw-r--r-- | src/ui/core.c | 20 | ||||
-rw-r--r-- | src/ui/statusbar.c | 2 | ||||
-rw-r--r-- | src/ui/ui.h | 16 | ||||
-rw-r--r-- | src/ui/win_types.h | 6 | ||||
-rw-r--r-- | src/ui/window.c | 34 | ||||
-rw-r--r-- | src/ui/window_list.c | 16 | ||||
-rw-r--r-- | src/ui/window_list.h | 4 | ||||
-rw-r--r-- | src/xmpp/iq.c | 8 |
16 files changed, 130 insertions, 130 deletions
diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c index f9d5a22a..7a340e7f 100644 --- a/src/command/cmd_ac.c +++ b/src/command/cmd_ac.c @@ -664,7 +664,7 @@ cmd_ac_init(void) autocomplete_add(time_ac, "console"); autocomplete_add(time_ac, "chat"); autocomplete_add(time_ac, "muc"); - autocomplete_add(time_ac, "mucconfig"); + autocomplete_add(time_ac, "config"); autocomplete_add(time_ac, "private"); autocomplete_add(time_ac, "xml"); autocomplete_add(time_ac, "statusbar"); @@ -1107,8 +1107,8 @@ cmd_ac_reset(ProfWin *window) muc_jid_autocomplete_reset(mucwin->roomjid); } - if (window->type == WIN_MUC_CONFIG) { - ProfMucConfWin *confwin = (ProfMucConfWin*)window; + if (window->type == WIN_CONFIG) { + ProfConfWin *confwin = (ProfConfWin*)window; assert(confwin->memcheck == PROFCONFWIN_MEMCHECK); if (confwin->form) { form_reset_autocompleters(confwin->form); @@ -2349,13 +2349,13 @@ _inpblock_autocomplete(ProfWin *window, const char *const input, gboolean previo static char* _form_autocomplete(ProfWin *window, const char *const input, gboolean previous) { - if (window->type != WIN_MUC_CONFIG) { + if (window->type != WIN_CONFIG) { return NULL; } char *found = NULL; - ProfMucConfWin *confwin = (ProfMucConfWin*)window; + ProfConfWin *confwin = (ProfConfWin*)window; DataForm *form = confwin->form; if (form) { found = autocomplete_param_with_ac(input, "/form help", form->tag_ac, TRUE, previous); @@ -2375,13 +2375,13 @@ _form_autocomplete(ProfWin *window, const char *const input, gboolean previous) static char* _form_field_autocomplete(ProfWin *window, const char *const input, gboolean previous) { - if (window->type != WIN_MUC_CONFIG) { + if (window->type != WIN_CONFIG) { return NULL; } char *found = NULL; - ProfMucConfWin *confwin = (ProfMucConfWin*)window; + ProfConfWin *confwin = (ProfConfWin*)window; DataForm *form = confwin->form; if (form == NULL) { return NULL; @@ -2510,7 +2510,7 @@ _time_autocomplete(ProfWin *window, const char *const input, gboolean previous) return found; } - found = autocomplete_param_with_ac(input, "/time mucconfig", time_format_ac, TRUE, previous); + found = autocomplete_param_with_ac(input, "/time config", time_format_ac, TRUE, previous); if (found) { return found; } diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c index 14e49b47..407ba69d 100644 --- a/src/command/cmd_defs.c +++ b/src/command/cmd_defs.c @@ -1265,8 +1265,8 @@ static struct cmd_t command_defs[] = CMD_TAGS( CMD_TAG_UI) CMD_SYN( - "/time console|chat|muc|mucconfig|private|xml set <format>", - "/time console|chat|muc|mucconfig|private|xml off", + "/time console|chat|muc|config|private|xml set <format>", + "/time console|chat|muc|config|private|xml off", "/time statusbar set <format>", "/time statusbar off", "/time lastactivity set <format>") @@ -1283,8 +1283,8 @@ static struct cmd_t command_defs[] = { "chat off", "Do not show time in chat windows." }, { "muc set <format>", "Set time format for chat room windows." }, { "muc off", "Do not show time in chat room windows." }, - { "mucconfig set <format>", "Set time format for chat room config windows." }, - { "mucconfig off", "Do not show time in chat room config windows." }, + { "config set <format>", "Set time format for chat room config windows." }, + { "config off", "Do not show time in chat room config windows." }, { "private set <format>", "Set time format for private chat windows." }, { "private off", "Do not show time in private chat windows." }, { "xml set <format>", "Set time format for XML console window." }, diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index dc112d85..6f1d7d51 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -3632,11 +3632,11 @@ cmd_decline(ProfWin *window, const char *const command, gchar **args) gboolean cmd_form_field(ProfWin *window, char *tag, gchar **args) { - if (window->type != WIN_MUC_CONFIG) { + if (window->type != WIN_CONFIG) { return TRUE; } - ProfMucConfWin *confwin = (ProfMucConfWin*)window; + ProfConfWin *confwin = (ProfConfWin*)window; DataForm *form = confwin->form; if (form) { if (!form_tag_exists(form, tag)) { @@ -3657,14 +3657,14 @@ cmd_form_field(ProfWin *window, char *tag, gchar **args) if (g_strcmp0(value, "on") == 0) { form_set_value(form, tag, "1"); win_println(window, THEME_DEFAULT, '-', "Field updated..."); - mucconfwin_show_form_field(confwin, form, tag); + confwin_show_form_field(confwin, form, tag); } else if (g_strcmp0(value, "off") == 0) { form_set_value(form, tag, "0"); win_println(window, THEME_DEFAULT, '-', "Field updated..."); - mucconfwin_show_form_field(confwin, form, tag); + confwin_show_form_field(confwin, form, tag); } else { win_println(window, THEME_DEFAULT, '-', "Invalid command, usage:"); - mucconfwin_field_help(confwin, tag); + confwin_field_help(confwin, tag); win_println(window, THEME_DEFAULT, '-', ""); } break; @@ -3675,24 +3675,24 @@ cmd_form_field(ProfWin *window, char *tag, gchar **args) value = args[0]; if (value == NULL) { win_println(window, THEME_DEFAULT, '-', "Invalid command, usage:"); - mucconfwin_field_help(confwin, tag); + confwin_field_help(confwin, tag); win_println(window, THEME_DEFAULT, '-', ""); } else { form_set_value(form, tag, value); win_println(window, THEME_DEFAULT, '-', "Field updated..."); - mucconfwin_show_form_field(confwin, form, tag); + confwin_show_form_field(confwin, form, tag); } break; case FIELD_LIST_SINGLE: value = args[0]; if ((value == NULL) || !form_field_contains_option(form, tag, value)) { win_println(window, THEME_DEFAULT, '-', "Invalid command, usage:"); - mucconfwin_field_help(confwin, tag); + confwin_field_help(confwin, tag); win_println(window, THEME_DEFAULT, '-', ""); } else { form_set_value(form, tag, value); win_println(window, THEME_DEFAULT, '-', "Field updated..."); - mucconfwin_show_form_field(confwin, form, tag); + confwin_show_form_field(confwin, form, tag); } break; @@ -3703,32 +3703,32 @@ cmd_form_field(ProfWin *window, char *tag, gchar **args) } if ((g_strcmp0(cmd, "add") != 0) && (g_strcmp0(cmd, "remove"))) { win_println(window, THEME_DEFAULT, '-', "Invalid command, usage:"); - mucconfwin_field_help(confwin, tag); + confwin_field_help(confwin, tag); win_println(window, THEME_DEFAULT, '-', ""); break; } if (value == NULL) { win_println(window, THEME_DEFAULT, '-', "Invalid command, usage:"); - mucconfwin_field_help(confwin, tag); + confwin_field_help(confwin, tag); win_println(window, THEME_DEFAULT, '-', ""); break; } if (g_strcmp0(cmd, "add") == 0) { form_add_value(form, tag, value); win_println(window, THEME_DEFAULT, '-', "Field updated..."); - mucconfwin_show_form_field(confwin, form, tag); + confwin_show_form_field(confwin, form, tag); break; } if (g_strcmp0(args[0], "remove") == 0) { if (!g_str_has_prefix(value, "val")) { win_println(window, THEME_DEFAULT, '-', "Invalid command, usage:"); - mucconfwin_field_help(confwin, tag); + confwin_field_help(confwin, tag); win_println(window, THEME_DEFAULT, '-', ""); break; } if (strlen(value) < 4) { win_println(window, THEME_DEFAULT, '-', "Invalid command, usage:"); - mucconfwin_field_help(confwin, tag); + confwin_field_help(confwin, tag); win_println(window, THEME_DEFAULT, '-', ""); break; } @@ -3736,7 +3736,7 @@ cmd_form_field(ProfWin *window, char *tag, gchar **args) int index = strtol(&value[3], NULL, 10); if ((index < 1) || (index > form_get_value_count(form, tag))) { win_println(window, THEME_DEFAULT, '-', "Invalid command, usage:"); - mucconfwin_field_help(confwin, tag); + confwin_field_help(confwin, tag); win_println(window, THEME_DEFAULT, '-', ""); break; } @@ -3744,7 +3744,7 @@ cmd_form_field(ProfWin *window, char *tag, gchar **args) removed = form_remove_text_multi_value(form, tag, index); if (removed) { win_println(window, THEME_DEFAULT, '-', "Field updated..."); - mucconfwin_show_form_field(confwin, form, tag); + confwin_show_form_field(confwin, form, tag); } else { win_println(window, THEME_DEFAULT, '-', "Could not remove %s from %s", value, tag); } @@ -3757,13 +3757,13 @@ cmd_form_field(ProfWin *window, char *tag, gchar **args) } if ((g_strcmp0(cmd, "add") != 0) && (g_strcmp0(cmd, "remove"))) { win_println(window, THEME_DEFAULT, '-', "Invalid command, usage:"); - mucconfwin_field_help(confwin, tag); + confwin_field_help(confwin, tag); win_println(window, THEME_DEFAULT, '-', ""); break; } if (value == NULL) { win_println(window, THEME_DEFAULT, '-', "Invalid command, usage:"); - mucconfwin_field_help(confwin, tag); + confwin_field_help(confwin, tag); win_println(window, THEME_DEFAULT, '-', ""); break; } @@ -3773,13 +3773,13 @@ cmd_form_field(ProfWin *window, char *tag, gchar **args) added = form_add_unique_value(form, tag, value); if (added) { win_println(window, THEME_DEFAULT, '-', "Field updated..."); - mucconfwin_show_form_field(confwin, form, tag); + confwin_show_form_field(confwin, form, tag); } else { win_println(window, THEME_DEFAULT, '-', "Value %s already selected for %s", value, tag); } } else { win_println(window, THEME_DEFAULT, '-', "Invalid command, usage:"); - mucconfwin_field_help(confwin, tag); + confwin_field_help(confwin, tag); win_println(window, THEME_DEFAULT, '-', ""); } break; @@ -3790,13 +3790,13 @@ cmd_form_field(ProfWin *window, char *tag, gchar **args) removed = form_remove_value(form, tag, value); if (removed) { win_println(window, THEME_DEFAULT, '-', "Field updated..."); - mucconfwin_show_form_field(confwin, form, tag); + confwin_show_form_field(confwin, form, tag); } else { win_println(window, THEME_DEFAULT, '-', "Value %s is not currently set for %s", value, tag); } } else { win_println(window, THEME_DEFAULT, '-', "Invalid command, usage:"); - mucconfwin_field_help(confwin, tag); + confwin_field_help(confwin, tag); win_println(window, THEME_DEFAULT, '-', ""); } } @@ -3808,13 +3808,13 @@ cmd_form_field(ProfWin *window, char *tag, gchar **args) } if ((g_strcmp0(cmd, "add") != 0) && (g_strcmp0(cmd, "remove"))) { win_println(window, THEME_DEFAULT, '-', "Invalid command, usage:"); - mucconfwin_field_help(confwin, tag); + confwin_field_help(confwin, tag); win_println(window, THEME_DEFAULT, '-', ""); break; } if (value == NULL) { win_println(window, THEME_DEFAULT, '-', "Invalid command, usage:"); - mucconfwin_field_help(confwin, tag); + confwin_field_help(confwin, tag); win_println(window, THEME_DEFAULT, '-', ""); break; } @@ -3822,7 +3822,7 @@ cmd_form_field(ProfWin *window, char *tag, gchar **args) added = form_add_unique_value(form, tag, value); if (added) { win_println(window, THEME_DEFAULT, '-', "Field updated..."); - mucconfwin_show_form_field(confwin, form, tag); + confwin_show_form_field(confwin, form, tag); } else { win_println(window, THEME_DEFAULT, '-', "JID %s already exists in %s", value, tag); } @@ -3832,7 +3832,7 @@ cmd_form_field(ProfWin *window, char *tag, gchar **args) removed = form_remove_value(form, tag, value); if (removed) { win_println(window, THEME_DEFAULT, '-', "Field updated..."); - mucconfwin_show_form_field(confwin, form, tag); + confwin_show_form_field(confwin, form, tag); } else { win_println(window, THEME_DEFAULT, '-', "Field %s does not contain %s", tag, value); } @@ -3857,7 +3857,7 @@ cmd_form(ProfWin *window, const char *const command, gchar **args) return TRUE; } - if (window->type != WIN_MUC_CONFIG) { + if (window->type != WIN_CONFIG) { cons_show("Command '/form' does not apply to this window."); return TRUE; } @@ -3870,20 +3870,20 @@ cmd_form(ProfWin *window, const char *const command, gchar **args) return TRUE; } - ProfMucConfWin *confwin = (ProfMucConfWin*)window; + ProfConfWin *confwin = (ProfConfWin*)window; assert(confwin->memcheck == PROFCONFWIN_MEMCHECK); if (g_strcmp0(args[0], "show") == 0) { - mucconfwin_show_form(confwin); + confwin_show_form(confwin); return TRUE; } if (g_strcmp0(args[0], "help") == 0) { char *tag = args[1]; if (tag) { - mucconfwin_field_help(confwin, tag); + confwin_field_help(confwin, tag); } else { - mucconfwin_form_help(confwin); + confwin_form_help(confwin); gchar **help_text = NULL; Command *command = cmd_get("/form"); @@ -4264,7 +4264,7 @@ cmd_room(ProfWin *window, const char *const command, gchar **args) } if (g_strcmp0(args[0], "config") == 0) { - ProfMucConfWin *confwin = wins_get_muc_conf(mucwin->roomjid); + ProfConfWin *confwin = wins_get_conf(mucwin->roomjid); if (confwin) { ui_focus_win((ProfWin*)confwin); @@ -5159,20 +5159,20 @@ cmd_time(ProfWin *window, const char *const command, gchar **args) cons_bad_cmd_usage(command); return TRUE; } - } else if (g_strcmp0(args[0], "mucconfig") == 0) { + } else if (g_strcmp0(args[0], "config") == 0) { if (args[1] == NULL) { - char *format = prefs_get_string(PREF_TIME_MUCCONFIG); - cons_show("MUC config time format: '%s'.", format); + char *format = prefs_get_string(PREF_TIME_CONFIG); + cons_show("config time format: '%s'.", format); prefs_free_string(format); return TRUE; } else if (g_strcmp0(args[1], "set") == 0 && args[2] != NULL) { - prefs_set_string(PREF_TIME_MUCCONFIG, args[2]); - cons_show("MUC config time format set to '%s'.", args[2]); + prefs_set_string(PREF_TIME_CONFIG, args[2]); + cons_show("config time format set to '%s'.", args[2]); wins_resize_all(); return TRUE; } else if (g_strcmp0(args[1], "off") == 0) { - prefs_set_string(PREF_TIME_MUCCONFIG, "off"); - cons_show("MUC config time display disabled."); + prefs_set_string(PREF_TIME_CONFIG, "off"); + cons_show("config time display disabled."); wins_resize_all(); return TRUE; } else { @@ -7518,7 +7518,7 @@ cmd_command_exec(ProfWin *window, const char *const command, gchar **args) static gboolean _cmd_execute(ProfWin *window, const char *const command, const char *const inp) { - if (g_str_has_prefix(command, "/field") && window->type == WIN_MUC_CONFIG) { + if (g_str_has_prefix(command, "/field") && window->type == WIN_CONFIG) { gboolean result = FALSE; gchar **args = parse_args_with_freetext(inp, 1, 2, &result); if (!result) { diff --git a/src/config/preferences.c b/src/config/preferences.c index e62c552c..bf4a6ab1 100644 --- a/src/config/preferences.c +++ b/src/config/preferences.c @@ -123,7 +123,7 @@ prefs_load(void) g_key_file_set_string(prefs, PREF_GROUP_UI, "time.console", val); g_key_file_set_string(prefs, PREF_GROUP_UI, "time.chat", val); g_key_file_set_string(prefs, PREF_GROUP_UI, "time.muc", val); - g_key_file_set_string(prefs, PREF_GROUP_UI, "time.mucconfig", val); + g_key_file_set_string(prefs, PREF_GROUP_UI, "time.config", val); g_key_file_set_string(prefs, PREF_GROUP_UI, "time.private", val); g_key_file_set_string(prefs, PREF_GROUP_UI, "time.xmlconsole", val); g_key_file_remove_key(prefs, PREF_GROUP_UI, "time", NULL); @@ -1567,7 +1567,7 @@ _get_group(preference_t pref) case PREF_TIME_CONSOLE: case PREF_TIME_CHAT: case PREF_TIME_MUC: - case PREF_TIME_MUCCONFIG: + case PREF_TIME_CONFIG: case PREF_TIME_PRIVATE: case PREF_TIME_XMLCONSOLE: case PREF_TIME_STATUSBAR: @@ -1777,8 +1777,8 @@ _get_key(preference_t pref) return "time.chat"; case PREF_TIME_MUC: return "time.muc"; - case PREF_TIME_MUCCONFIG: - return "time.mucconfig"; + case PREF_TIME_CONFIG: + return "time.config"; case PREF_TIME_PRIVATE: return "time.private"; case PREF_TIME_XMLCONSOLE: @@ -1967,7 +1967,7 @@ _get_default_string(preference_t pref) return "%H:%M:%S"; case PREF_TIME_MUC: return "%H:%M:%S"; - case PREF_TIME_MUCCONFIG: + case PREF_TIME_CONFIG: return "%H:%M:%S"; case PREF_TIME_PRIVATE: return "%H:%M:%S"; diff --git a/src/config/preferences.h b/src/config/preferences.h index bafe4a1f..e882e248 100644 --- a/src/config/preferences.h +++ b/src/config/preferences.h @@ -92,7 +92,7 @@ typedef enum { PREF_TIME_CONSOLE, PREF_TIME_CHAT, PREF_TIME_MUC, - PREF_TIME_MUCCONFIG, + PREF_TIME_CONFIG, PREF_TIME_PRIVATE, PREF_TIME_XMLCONSOLE, PREF_TIME_STATUSBAR, diff --git a/src/config/theme.c b/src/config/theme.c index 13f9cc2b..ad8a2d0e 100644 --- a/src/config/theme.c +++ b/src/config/theme.c @@ -413,7 +413,7 @@ _load_preferences(void) _set_string_preference("time.console", PREF_TIME_CONSOLE); _set_string_preference("time.chat", PREF_TIME_CHAT); _set_string_preference("time.muc", PREF_TIME_MUC); - _set_string_preference("time.mucconfig", PREF_TIME_MUCCONFIG); + _set_string_preference("time.config", PREF_TIME_CONFIG); _set_string_preference("time.private", PREF_TIME_PRIVATE); _set_string_preference("time.xmlconsole", PREF_TIME_XMLCONSOLE); _set_string_preference("time.statusbar", PREF_TIME_STATUSBAR); diff --git a/src/ui/mucconfwin.c b/src/ui/confwin.c index 7a658a1e..73c12a59 100644 --- a/src/ui/mucconfwin.c +++ b/src/ui/confwin.c @@ -1,5 +1,5 @@ /* - * mucconfwin.c + * confwin.c * * Copyright (C) 2012 - 2018 James Booth <boothj5@gmail.com> * @@ -40,10 +40,10 @@ #include "ui/win_types.h" #include "ui/window_list.h" -static void _mucconfwin_form_field(ProfWin *window, char *tag, FormField *field); +static void _confwin_form_field(ProfWin *window, char *tag, FormField *field); void -mucconfwin_show_form(ProfMucConfWin *confwin) +confwin_show_form(ProfConfWin *confwin) { ProfWin *window = (ProfWin*) confwin; if (confwin->form->title) { @@ -54,7 +54,7 @@ mucconfwin_show_form(ProfMucConfWin *confwin) } win_println(window, THEME_DEFAULT, '-', ""); - mucconfwin_form_help(confwin); + confwin_form_help(confwin); GSList *fields = confwin->form->fields; GSList *curr_field = fields; @@ -68,7 +68,7 @@ mucconfwin_show_form(ProfMucConfWin *confwin) } } else if (g_strcmp0(field->type, "hidden") != 0 && field->var) { char *tag = g_hash_table_lookup(confwin->form->var_to_tag, field->var); - _mucconfwin_form_field(window, tag, field); + _confwin_form_field(window, tag, field); } curr_field = g_slist_next(curr_field); @@ -76,25 +76,25 @@ mucconfwin_show_form(ProfMucConfWin *confwin) } void -mucconfwin_show_form_field(ProfMucConfWin *confwin, DataForm *form, char *tag) +confwin_show_form_field(ProfConfWin *confwin, DataForm *form, char *tag) { assert(confwin != NULL); FormField *field = form_get_field_by_tag(form, tag); ProfWin *window = (ProfWin*)confwin; - _mucconfwin_form_field(window, tag, field); + _confwin_form_field(window, tag, field); win_println(window, THEME_DEFAULT, '-', ""); } void -mucconfwin_handle_configuration(ProfMucConfWin *confwin, DataForm *form) +confwin_handle_configuration(ProfConfWin *confwin, DataForm *form) { assert(confwin != NULL); ProfWin *window = (ProfWin*)confwin; ui_focus_win(window); - mucconfwin_show_form(confwin); + confwin_show_form(confwin); win_println(window, THEME_DEFAULT, '-', ""); win_println(window, THEME_DEFAULT, '-', "Use '/form submit' to save changes."); @@ -104,7 +104,7 @@ mucconfwin_handle_configuration(ProfMucConfWin *confwin, DataForm *form) } void -mucconfwin_field_help(ProfMucConfWin *confwin, char *tag) +confwin_field_help(ProfConfWin *confwin, char *tag) { assert(confwin != NULL); @@ -187,7 +187,7 @@ mucconfwin_field_help(ProfMucConfWin *confwin, char *tag) } void -mucconfwin_form_help(ProfMucConfWin *confwin) +confwin_form_help(ProfConfWin *confwin) { assert(confwin != NULL); @@ -200,7 +200,7 @@ mucconfwin_form_help(ProfMucConfWin *confwin) } static void -_mucconfwin_form_field(ProfWin *window, char *tag, FormField *field) +_confwin_form_field(ProfWin *window, char *tag, FormField *field) { win_print(window, THEME_AWAY, '-', "[%s] ", tag); win_append(window, THEME_DEFAULT, "%s", field->label); @@ -331,7 +331,7 @@ _mucconfwin_form_field(ProfWin *window, char *tag, FormField *field) } char* -mucconfwin_get_string(ProfMucConfWin *confwin) +confwin_get_string(ProfConfWin *confwin) { assert(confwin != NULL); diff --git a/src/ui/console.c b/src/ui/console.c index 9bead705..f5c0379b 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -1282,12 +1282,12 @@ cons_time_setting(void) cons_show("Time MUC (/time) : %s", pref_time_muc); prefs_free_string(pref_time_muc); - char *pref_time_mucconf = prefs_get_string(PREF_TIME_MUCCONFIG); - if (g_strcmp0(pref_time_mucconf, "off") == 0) - cons_show("Time MUC config (/time) : OFF"); + char *pref_time_conf = prefs_get_string(PREF_TIME_CONFIG); + if (g_strcmp0(pref_time_conf, "off") == 0) + cons_show("Time config (/time) : OFF"); else - cons_show("Time MUC config (/time) : %s", pref_time_mucconf); - prefs_free_string(pref_time_mucconf); + cons_show("Time config (/time) : %s", pref_time_conf); + prefs_free_string(pref_time_conf); char *pref_time_private = prefs_get_string(PREF_TIME_PRIVATE); if (g_strcmp0(pref_time_private, "off") == 0) diff --git a/src/ui/core.c b/src/ui/core.c index 5246d06a..da4e6469 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -632,8 +632,8 @@ ui_win_has_unsaved_form(int num) { ProfWin *window = wins_get_by_num(num); - if (window->type == WIN_MUC_CONFIG) { - ProfMucConfWin *confwin = (ProfMucConfWin*)window; + if (window->type == WIN_CONFIG) { + ProfConfWin *confwin = (ProfConfWin*)window; assert(confwin->memcheck == PROFCONFWIN_MEMCHECK); return confwin->form->modified; } else { @@ -651,13 +651,13 @@ ui_focus_win(ProfWin *window) } ProfWin *old_current = wins_get_current(); - if (old_current->type == WIN_MUC_CONFIG) { - ProfMucConfWin *confwin = (ProfMucConfWin*)old_current; + if (old_current->type == WIN_CONFIG) { + ProfConfWin *confwin = (ProfConfWin*)old_current; cmd_ac_remove_form_fields(confwin->form); } - if (window->type == WIN_MUC_CONFIG) { - ProfMucConfWin *confwin = (ProfMucConfWin*)window; + if (window->type == WIN_CONFIG) { + ProfConfWin *confwin = (ProfConfWin*)window; cmd_ac_add_form_fields(confwin->form); } @@ -681,8 +681,8 @@ void ui_close_win(int index) { ProfWin *window = wins_get_by_num(index); - if (window && window->type == WIN_MUC_CONFIG) { - ProfMucConfWin *confwin = (ProfMucConfWin*)window; + if (window && window->type == WIN_CONFIG) { + ProfConfWin *confwin = (ProfConfWin*)window; if (confwin->form) { cmd_ac_remove_form_fields(confwin->form); } @@ -1135,7 +1135,7 @@ ui_handle_room_config_submit_result(const char *const roomjid) GString *form_recipient = g_string_new(roomjid); g_string_append(form_recipient, " config"); - form_window = (ProfWin*) wins_get_muc_conf(form_recipient->str); + form_window = (ProfWin*) wins_get_conf(form_recipient->str); g_string_free(form_recipient, TRUE); if (form_window) { @@ -1167,7 +1167,7 @@ ui_handle_room_config_submit_result_error(const char *const roomjid, const char GString *form_recipient = g_string_new(roomjid); g_string_append(form_recipient, " config"); - form_window = (ProfWin*) wins_get_muc_conf(form_recipient->str); + form_window = (ProfWin*) wins_get_conf(form_recipient->str); g_string_free(form_recipient, TRUE); if (form_window) { diff --git a/src/ui/statusbar.c b/src/ui/statusbar.c index ac1d7498..5d860440 100644 --- a/src/ui/statusbar.c +++ b/src/ui/statusbar.c @@ -544,7 +544,7 @@ _display_name(StatusBarTab *tab) } else { fullname = strdup(tab->identifier); } - } else if (tab->window_type == WIN_MUC_CONFIG) { + } else if (tab->window_type == WIN_CONFIG) { char *pref = prefs_get_string(PREF_STATUSBAR_ROOM); GString *display_str = g_string_new(""); if (g_strcmp0("room", pref) == 0) { diff --git a/src/ui/ui.h b/src/ui/ui.h index 6988d882..573fdfcc 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -217,13 +217,13 @@ void privwin_room_kicked(ProfPrivateWin *privwin, const char *const actor, const void privwin_room_banned(ProfPrivateWin *privwin, const char *const actor, const char *const reason); void privwin_room_joined(ProfPrivateWin *privwin); -// MUC room config window -void mucconfwin_handle_configuration(ProfMucConfWin *confwin, DataForm *form); -void mucconfwin_show_form(ProfMucConfWin *confwin); -void mucconfwin_show_form_field(ProfMucConfWin *confwin, DataForm *form, char *tag); -void mucconfwin_form_help(ProfMucConfWin *confwin); -void mucconfwin_field_help(ProfMucConfWin *confwin, char *tag); -char* mucconfwin_get_string(ProfMucConfWin *confwin); +// room config window +void confwin_handle_configuration(ProfConfWin *confwin, DataForm *form); +void confwin_show_form(ProfConfWin *confwin); +void confwin_show_form_field(ProfConfWin *confwin, DataForm *form, char *tag); +void confwin_form_help(ProfConfWin *confwin); +void confwin_field_help(ProfConfWin *confwin, char *tag); +char* confwin_get_string(ProfConfWin *confwin); // xml console void xmlwin_show(ProfXMLWin *xmlwin, const char *const msg); @@ -346,7 +346,7 @@ ProfWin* win_create_console(void); ProfWin* win_create_xmlconsole(void); ProfWin* win_create_chat(const char *const barejid); ProfWin* win_create_muc(const char *const roomjid); -ProfWin* win_create_muc_config(const char *const title, DataForm *form); +ProfWin* win_create_config(const char *const title, DataForm *form); ProfWin* win_create_private(const char *const fulljid); ProfWin* win_create_plugin(const char *const plugin_name, const char *const tag); void win_update_virtual(ProfWin *window); diff --git a/src/ui/win_types.h b/src/ui/win_types.h index 7fa75b34..28a785bf 100644 --- a/src/ui/win_types.h +++ b/src/ui/win_types.h @@ -128,7 +128,7 @@ typedef enum { WIN_CONSOLE, WIN_CHAT, WIN_MUC, - WIN_MUC_CONFIG, + WIN_CONFIG, WIN_PRIVATE, WIN_XML, WIN_PLUGIN @@ -172,12 +172,12 @@ typedef struct prof_muc_win_t { char *message_char; } ProfMucWin; -typedef struct prof_mucconf_win_t { +typedef struct prof_conf_win_t { ProfWin window; char *roomjid; DataForm *form; unsigned long memcheck; -} ProfMucConfWin; +} ProfConfWin; typedef struct prof_private_win_t { ProfWin window; diff --git a/src/ui/window.c b/src/ui/window.c index a6f65d1b..16cd9490 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -203,10 +203,10 @@ win_create_muc(const char *const roomjid) } ProfWin* -win_create_muc_config(const char *const roomjid, DataForm *form) +win_create_config(const char *const roomjid, DataForm *form) { - ProfMucConfWin *new_win = malloc(sizeof(ProfMucConfWin)); - new_win->window.type = WIN_MUC_CONFIG; + ProfConfWin *new_win = malloc(sizeof(ProfConfWin)); + new_win->window.type = WIN_CONFIG; new_win->window.layout = _win_create_simple_layout(); new_win->roomjid = strdup(roomjid); new_win->form = form; @@ -289,8 +289,8 @@ win_get_title(ProfWin *window) assert(mucwin->memcheck == PROFMUCWIN_MEMCHECK); return strdup(mucwin->roomjid); } - if (window->type == WIN_MUC_CONFIG) { - ProfMucConfWin *confwin = (ProfMucConfWin*) window; + if (window->type == WIN_CONFIG) { + ProfConfWin *confwin = (ProfConfWin*) window; assert(confwin->memcheck == PROFCONFWIN_MEMCHECK); GString *title = g_string_new(confwin->roomjid); g_string_append(title, " config"); @@ -338,10 +338,10 @@ win_get_tab_identifier(ProfWin *window) ProfMucWin *mucwin = (ProfMucWin*)window; return strdup(mucwin->roomjid); } - case WIN_MUC_CONFIG: + case WIN_CONFIG: { - ProfMucConfWin *mucconfwin = (ProfMucConfWin*)window; - return strdup(mucconfwin->roomjid); + ProfConfWin *confwin = (ProfConfWin*)window; + return strdup(confwin->roomjid); } case WIN_PRIVATE: { @@ -383,10 +383,10 @@ win_to_string(ProfWin *window) ProfMucWin *mucwin = (ProfMucWin*)window; return mucwin_get_string(mucwin); } - case WIN_MUC_CONFIG: + case WIN_CONFIG: { - ProfMucConfWin *mucconfwin = (ProfMucConfWin*)window; - return mucconfwin_get_string(mucconfwin); + ProfConfWin *confwin = (ProfConfWin*)window; + return confwin_get_string(confwin); } case WIN_PRIVATE: { @@ -491,11 +491,11 @@ win_free(ProfWin* window) free(mucwin->message_char); break; } - case WIN_MUC_CONFIG: + case WIN_CONFIG: { - ProfMucConfWin *mucconf = (ProfMucConfWin*)window; - free(mucconf->roomjid); - form_destroy(mucconf->form); + ProfConfWin *conf = (ProfConfWin*)window; + free(conf->roomjid); + form_destroy(conf->form); break; } case WIN_PRIVATE: @@ -1389,8 +1389,8 @@ _win_print(ProfWin *window, const char show_char, int pad_indent, GDateTime *tim case WIN_MUC: time_pref = prefs_get_string(PREF_TIME_MUC); break; - case WIN_MUC_CONFIG: - time_pref = prefs_get_string(PREF_TIME_MUCCONFIG); + case WIN_CONFIG: + time_pref = prefs_get_string(PREF_TIME_CONFIG); break; case WIN_PRIVATE: time_pref = prefs_get_string(PREF_TIME_PRIVATE); diff --git a/src/ui/window_list.c b/src/ui/window_list.c index e408a2ac..d386f1dd 100644 --- a/src/ui/window_list.c +++ b/src/ui/window_list.c @@ -139,16 +139,16 @@ wins_get_chat_unsubscribed(void) return result; } -ProfMucConfWin* -wins_get_muc_conf(const char *const roomjid) +ProfConfWin* +wins_get_conf(const char *const roomjid) { GList *values = g_hash_table_get_values(windows); GList *curr = values; while (curr) { ProfWin *window = curr->data; - if (window->type == WIN_MUC_CONFIG) { - ProfMucConfWin *confwin = (ProfMucConfWin*)window; + if (window->type == WIN_CONFIG) { + ProfConfWin *confwin = (ProfConfWin*)window; if (g_strcmp0(confwin->roomjid, roomjid) == 0) { g_list_free(values); return confwin; @@ -584,7 +584,7 @@ wins_close_by_num(int i) autocomplete_remove(wins_close_ac, pluginwin->tag); break; } - case WIN_MUC_CONFIG: + case WIN_CONFIG: default: break; } @@ -657,12 +657,12 @@ wins_new_muc(const char *const roomjid) } ProfWin* -wins_new_muc_config(const char *const roomjid, DataForm *form) +wins_new_config(const char *const roomjid, DataForm *form) { GList *keys = g_hash_table_get_keys(windows); int result = _wins_get_next_available_num(keys); g_list_free(keys); - ProfWin *newwin = win_create_muc_config(roomjid, form); + ProfWin *newwin = win_create_config(roomjid, form); g_hash_table_insert(windows, GINT_TO_POINTER(result), newwin); return newwin; } @@ -812,7 +812,7 @@ wins_get_prune_wins(void) ProfWin *window = curr->data; if (win_unread(window) == 0 && window->type != WIN_MUC && - window->type != WIN_MUC_CONFIG && + window->type != WIN_CONFIG && window->type != WIN_XML && window->type != WIN_CONSOLE) { result = g_slist_append(result, window); diff --git a/src/ui/window_list.h b/src/ui/window_list.h index ba62ad32..0309fe00 100644 --- a/src/ui/window_list.h +++ b/src/ui/window_list.h @@ -42,7 +42,7 @@ void wins_init(void); ProfWin* wins_new_xmlconsole(void); ProfWin* wins_new_chat(const char *const barejid); ProfWin* wins_new_muc(const char *const roomjid); -ProfWin* wins_new_muc_config(const char *const roomjid, DataForm *form); +ProfWin* wins_new_config(const char *const roomjid, DataForm *form); ProfWin* wins_new_private(const char *const fulljid); ProfWin* wins_new_plugin(const char *const plugin_name, const char *const tag); @@ -56,7 +56,7 @@ ProfWin* wins_get_console(void); ProfChatWin* wins_get_chat(const char *const barejid); GList* wins_get_chat_unsubscribed(void); ProfMucWin* wins_get_muc(const char *const roomjid); -ProfMucConfWin* wins_get_muc_conf(const char *const roomjid); +ProfConfWin* wins_get_conf(const char *const roomjid); ProfPrivateWin* wins_get_private(const char *const fulljid); ProfPluginWin* wins_get_plugin(const char *const tag); ProfXMLWin* wins_get_xmlconsole(void); diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c index f5bacddd..60c19b88 100644 --- a/src/xmpp/iq.c +++ b/src/xmpp/iq.c @@ -1152,8 +1152,8 @@ _command_exec_response_handler(xmpp_stanza_t *const stanza, void *const userdata } DataForm *form = form_create(x); - ProfMucConfWin *confwin = (ProfMucConfWin*)wins_new_muc_config(from, form); - mucconfwin_handle_configuration(confwin, form); + ProfConfWin *confwin = (ProfConfWin*)wins_new_config(from, form); + confwin_handle_configuration(confwin, form); } if (g_strcmp0(status, "canceled") == 0) { @@ -1693,8 +1693,8 @@ _room_config_id_handler(xmpp_stanza_t *const stanza, void *const userdata) } DataForm *form = form_create(x); - ProfMucConfWin *confwin = (ProfMucConfWin*)wins_new_muc_config(from, form); - mucconfwin_handle_configuration(confwin, form); + ProfConfWin *confwin = (ProfConfWin*)wins_new_config(from, form); + confwin_handle_configuration(confwin, form); return 0; } |