3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-01 23:59:51 +01:00

client: add flashing indicator for the updatable tables

This commit is contained in:
Tim Kourt 2017-06-05 14:29:40 -07:00 committed by Denis Kenzior
parent 31d60b5cf2
commit 2fb671e0d4

View File

@ -245,6 +245,18 @@ void display_error(const char *error)
l_free(text); l_free(text);
} }
static char get_flasher(void)
{
static char c;
if (c == ' ')
c = '*';
else
c = ' ';
return c;
}
void display_table_header(const char *caption, const char *fmt, ...) void display_table_header(const char *caption, const char *fmt, ...)
{ {
va_list args; va_list args;
@ -253,7 +265,10 @@ void display_table_header(const char *caption, const char *fmt, ...)
int caption_pos = int caption_pos =
(int) ((sizeof(dashed_line) - 1) / 2 + strlen(caption) / 2); (int) ((sizeof(dashed_line) - 1) / 2 + strlen(caption) / 2);
text = l_strdup_printf("%*s\n", caption_pos, caption); text = l_strdup_printf("%*s" COLOR_BOLDGRAY "%*c" COLOR_OFF "\n",
caption_pos, caption,
LINE_LEN - 2 - caption_pos,
display_refresh.cmd ? get_flasher() : ' ');
display_text(text); display_text(text);
l_free(text); l_free(text);