diff options
author | James Booth <boothj5@gmail.com> | 2015-09-30 22:34:27 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2015-09-30 22:34:27 +0100 |
commit | b9948a4c018b25b3d5dc0a876740d8621b210070 (patch) | |
tree | 917b5ea296aab390aaee6b9f74b04f8ec042fcbd /src/command/command.c | |
parent | d2b991de1d5948410c1ded0ac0dca1c7adc8117d (diff) | |
download | profani-tty-b9948a4c018b25b3d5dc0a876740d8621b210070.tar.gz |
Added time format perferences per window type
Diffstat (limited to 'src/command/command.c')
-rw-r--r-- | src/command/command.c | 52 |
1 files changed, 46 insertions, 6 deletions
diff --git a/src/command/command.c b/src/command/command.c index 2203b398..f1432d90 100644 --- a/src/command/command.c +++ b/src/command/command.c @@ -947,8 +947,8 @@ static struct cmd_t command_defs[] = CMD_TAGS( CMD_TAG_UI) CMD_SYN( - "/time main set <format>", - "/time main off", + "/time console|chat|muc|mucconfig|private|xml set <format>", + "/time console|chat|muc|mucconfig|private|xml off", "/time statusbar set <format>", "/time statusbar off", "/time lastactivity set <format>") @@ -959,8 +959,18 @@ static struct cmd_t command_defs[] = "Setting the format to an unsupported string, will display the string. " "If the format contains spaces, it must be surrounded with double quotes.") CMD_ARGS( - { "main set <format>", "Change time format in main window." }, - { "main off", "Do not show time in main window." }, + { "console set <format>", "Set time format for console window." }, + { "console off", "Do not show time in console window." }, + { "chat set <format>", "Set time format for chat windows." }, + { "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." }, + { "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." }, + { "xml off", "Do not show time in XML console window." }, { "statusbar set <format>", "Change time format in statusbar." }, { "statusbar off", "Do not show time in status bar." }, { "lastactivity set <format>", "Change time format for last activity." }) @@ -2099,7 +2109,12 @@ cmd_init(void) autocomplete_add(occupants_show_ac, "jid"); time_ac = autocomplete_new(); - autocomplete_add(time_ac, "main"); + autocomplete_add(time_ac, "console"); + autocomplete_add(time_ac, "chat"); + autocomplete_add(time_ac, "muc"); + autocomplete_add(time_ac, "mucconfig"); + autocomplete_add(time_ac, "private"); + autocomplete_add(time_ac, "xml"); autocomplete_add(time_ac, "statusbar"); autocomplete_add(time_ac, "lastactivity"); @@ -3376,7 +3391,32 @@ _time_autocomplete(ProfWin *window, const char * const input) return found; } - found = autocomplete_param_with_ac(input, "/time main", time_format_ac, TRUE); + found = autocomplete_param_with_ac(input, "/time console", time_format_ac, TRUE); + if (found) { + return found; + } + + found = autocomplete_param_with_ac(input, "/time chat", time_format_ac, TRUE); + if (found) { + return found; + } + + found = autocomplete_param_with_ac(input, "/time muc", time_format_ac, TRUE); + if (found) { + return found; + } + + found = autocomplete_param_with_ac(input, "/time mucconfig", time_format_ac, TRUE); + if (found) { + return found; + } + + found = autocomplete_param_with_ac(input, "/time private", time_format_ac, TRUE); + if (found) { + return found; + } + + found = autocomplete_param_with_ac(input, "/time xml", time_format_ac, TRUE); if (found) { return found; } |