Added /wrap user preference for enabling/disabling word wrapping

This commit is contained in:
James Booth
2014-11-09 23:29:25 +00:00
parent 70501f5dbf
commit 46583839df
8 changed files with 43 additions and 4 deletions

View File

@@ -578,6 +578,14 @@ static struct cmd_t command_defs[] =
"Switch display of the contacts presence on or off.",
NULL } } },
{ "/wrap",
cmd_wrap, parse_args, 1, 1, &cons_wrap_setting,
{ "/wrap on|off", "Word wrapping.",
{ "/wrap on|off",
"------------",
"Enable or disable word wrapping.",
NULL } } },
{ "/notify",
cmd_notify, parse_args, 2, 3, &cons_notify_setting,
{ "/notify [type value]|[type setting value]", "Control various desktop noficiations.",
@@ -1773,7 +1781,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",
"/vercheck", "/privileges", "/presence" };
"/vercheck", "/privileges", "/presence", "/wrap" };
for (i = 0; i < ARRAY_SIZE(boolean_choices); i++) {
result = autocomplete_param_with_func(input, size, boolean_choices[i],

View File

@@ -620,7 +620,7 @@ cmd_help(gchar **args, struct cmd_help_t help)
"/chlog", "/flash", "/gone", "/grlog", "/history", "/intype",
"/log", "/mouse", "/notify", "/outtype", "/prefs", "/priority",
"/reconnect", "/roster", "/splash", "/states", "/statuses", "/theme",
"/titlebar", "/vercheck", "/privileges", "/occupants", "/presence" };
"/titlebar", "/vercheck", "/privileges", "/occupants", "/presence", "/wrap" };
_cmd_show_filtered_help("Settings commands", filter, ARRAY_SIZE(filter));
} else if (strcmp(args[0], "navigation") == 0) {
@@ -2928,6 +2928,16 @@ cmd_presence(gchar **args, struct cmd_help_t help)
return _cmd_set_boolean_preference(args[0], help, "Contact presence", PREF_PRESENCE);
}
gboolean
cmd_wrap(gchar **args, struct cmd_help_t help)
{
gboolean result = _cmd_set_boolean_preference(args[0], help, "Word wrap", PREF_WRAP);
wins_resize_all();
return result;
}
gboolean
cmd_states(gchar **args, struct cmd_help_t help)
{

View File

@@ -133,6 +133,7 @@ gboolean cmd_affiliation(gchar **args, struct cmd_help_t help);
gboolean cmd_role(gchar **args, struct cmd_help_t help);
gboolean cmd_privileges(gchar **args, struct cmd_help_t help);
gboolean cmd_presence(gchar **args, struct cmd_help_t help);
gboolean cmd_wrap(gchar **args, struct cmd_help_t help);
gboolean cmd_form_field(char *tag, gchar **args);