Renamed titlebar preference

This commit is contained in:
James Booth
2015-01-12 00:43:42 +00:00
parent e4d703f914
commit c64484c6ed
6 changed files with 51 additions and 16 deletions

View File

@@ -96,6 +96,7 @@ static char * _ban_autocomplete(char *input, int *size);
static char * _affiliation_autocomplete(char *input, int *size);
static char * _role_autocomplete(char *input, int *size);
static char * _resource_autocomplete(char *input, int *size);
static char * _titlebar_autocomplete(char *input, int *size);
GHashTable *commands = NULL;
@@ -721,10 +722,10 @@ static struct cmd_t command_defs[] =
NULL } } },
{ "/titlebar",
cmd_titlebar, parse_args, 1, 1, &cons_titlebar_setting,
{ "/titlebar on|off", "Show information in the window title bar.",
{ "/titlebar on|off",
"----------------",
cmd_titlebar, parse_args, 2, 2, &cons_titlebar_setting,
{ "/titlebar show on|off", "Show information in the window title bar.",
{ "/titlebar show on|off",
"---------------------",
"Show information in the window title bar.",
NULL } } },
@@ -1206,7 +1207,7 @@ cmd_init(void)
autocomplete_add(sub_ac, "received");
titlebar_ac = autocomplete_new();
autocomplete_add(titlebar_ac, "version");
autocomplete_add(titlebar_ac, "show");
log_ac = autocomplete_new();
autocomplete_add(log_ac, "maxsize");
@@ -1661,6 +1662,7 @@ cmd_reset_autocomplete()
autocomplete_reset(roster_option_ac);
autocomplete_reset(roster_by_ac);
autocomplete_reset(group_ac);
autocomplete_reset(titlebar_ac);
autocomplete_reset(bookmark_ac);
autocomplete_reset(bookmark_property_ac);
autocomplete_reset(otr_ac);
@@ -1892,7 +1894,7 @@ _cmd_complete_parameters(char *input, int *size)
// autocomplete boolean settings
gchar *boolean_choices[] = { "/beep", "/intype", "/states", "/outtype",
"/flash", "/splash", "/chlog", "/grlog", "/mouse", "/history", "/titlebar",
"/flash", "/splash", "/chlog", "/grlog", "/mouse", "/history",
"/vercheck", "/privileges", "/presence", "/wrap" };
for (i = 0; i < ARRAY_SIZE(boolean_choices); i++) {
@@ -2002,6 +2004,7 @@ _cmd_complete_parameters(char *input, int *size)
g_hash_table_insert(ac_funcs, "/affiliation", _affiliation_autocomplete);
g_hash_table_insert(ac_funcs, "/role", _role_autocomplete);
g_hash_table_insert(ac_funcs, "/resource", _resource_autocomplete);
g_hash_table_insert(ac_funcs, "/titlebar", _titlebar_autocomplete);
char parsed[*size+1];
i = 0;
@@ -2484,6 +2487,24 @@ _resource_autocomplete(char *input, int *size)
return NULL;
}
static char *
_titlebar_autocomplete(char *input, int *size)
{
char *found = NULL;
found = autocomplete_param_with_func(input, size, "/titlebar show", prefs_autocomplete_boolean_choice);
if (found != NULL) {
return found;
}
found = autocomplete_param_with_ac(input, size, "/titlebar", titlebar_ac, FALSE);
if (found != NULL) {
return found;
}
return NULL;
}
static char *
_form_autocomplete(char *input, int *size)
{