Added last activity time format option

This commit is contained in:
James Booth
2015-09-29 23:30:23 +01:00
parent ac1164a3fa
commit 99fc70bd92
9 changed files with 81 additions and 28 deletions

View File

@@ -950,7 +950,8 @@ static struct cmd_t command_defs[] =
"/time main set <format>",
"/time main off",
"/time statusbar set <format>",
"/time statusbar off")
"/time statusbar off",
"/time lastactivity set <format>")
CMD_DESC(
"Configure time display preferences. "
"Time formats are strings supported by g_date_time_format. "
@@ -958,14 +959,16 @@ 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." },
{ "statusbar set <format>", "Change time format in statusbar." },
{ "statusbar off", "Change time format in status bar." })
{ "main set <format>", "Change time format in main window." },
{ "main off", "Do not show time in main 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." })
CMD_EXAMPLES(
"/time main set \"%d-%m-%y %H:%M\"",
"/time main off",
"/time statusbar set %H:%M")
"/time statusbar set %H:%M",
"/time lastactivity set \"%d-%m-%y %H:%M\"")
},
{ "/inpblock",
@@ -2098,6 +2101,7 @@ cmd_init(void)
time_ac = autocomplete_new();
autocomplete_add(time_ac, "main");
autocomplete_add(time_ac, "statusbar");
autocomplete_add(time_ac, "lastactivity");
time_format_ac = autocomplete_new();
autocomplete_add(time_format_ac, "set");
@@ -3367,6 +3371,11 @@ _time_autocomplete(ProfWin *window, const char * const input)
return found;
}
found = autocomplete_param_with_ac(input, "/time lastactivity", time_format_ac, TRUE);
if (found) {
return found;
}
found = autocomplete_param_with_ac(input, "/time main", time_format_ac, TRUE);
if (found) {
return found;