Added word wrap to roster panel

This commit is contained in:
James Booth
2015-11-22 01:39:20 +00:00
parent 0763bfc9f4
commit 3bc9275079
11 changed files with 60 additions and 19 deletions

View File

@@ -284,6 +284,7 @@ static struct cmd_t command_defs[] =
"/roster indent resource <indent>",
"/roster indent presence <indent>",
"/roster size <percent>",
"/roster wrap on|off",
"/roster add <jid> [<nick>]",
"/roster remove <jid>",
"/roster remove_all contacts",
@@ -323,6 +324,7 @@ static struct cmd_t command_defs[] =
{ "indent resource <indent>", "Indent resource line by <indent> spaces." },
{ "indent presence <indent>", "Indent presence line by <indent> spaces." },
{ "size <precent>", "Percentage of the screen taken up by the roster (1-99)." },
{ "wrap on|off", "Enabled or disanle line wrapping in roster panel." },
{ "add <jid> [<nick>]", "Add a new item to the roster." },
{ "remove <jid>", "Removes an item from the roster." },
{ "remove_all contacts", "Remove all items from roster." },
@@ -2041,6 +2043,7 @@ cmd_init(void)
autocomplete_add(roster_ac, "size");
autocomplete_add(roster_ac, "char");
autocomplete_add(roster_ac, "indent");
autocomplete_add(roster_ac, "wrap");
roster_char_ac = autocomplete_new();
autocomplete_add(roster_char_ac, "header");
@@ -2953,6 +2956,10 @@ _roster_autocomplete(ProfWin *window, const char *const input)
if (result) {
return result;
}
result = autocomplete_param_with_func(input, "/roster wrap", prefs_autocomplete_boolean_choice);
if (result) {
return result;
}
result = autocomplete_param_with_ac(input, "/roster", roster_ac, TRUE);
if (result) {
return result;

View File

@@ -1750,6 +1750,17 @@ cmd_roster(ProfWin *window, const char *const command, gchar **args)
return TRUE;
}
// set line wrapping
} else if (g_strcmp0(args[0], "wrap") == 0) {
if (!args[1]) {
cons_bad_cmd_usage(command);
return TRUE;
} else {
int res = _cmd_set_boolean_preference(args[1], command, "Roster panel line wrap", PREF_ROSTER_WRAP);
rosterwin_roster();
return res;
}
// set header character
} else if (g_strcmp0(args[0], "char") == 0) {
if (g_strcmp0(args[1], "header") == 0) {