diff options
author | Vadim Kochan <vadim4j@gmail.com> | 2015-11-07 00:23:25 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2015-11-09 10:32:27 +0100 |
commit | cb613c76a3108cec2a8c3334a920dcce106084af (patch) | |
tree | 0c06be4beb72468e8c51530d4e1ba5137b37609e | |
parent | 5c3ba0cab03e9fb900ff60222a0313f2cc585c65 (diff) |
flowtop: Add runtime command to change rate units
Add interactive command 'b' to change rate units to show.
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r-- | flowtop.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -1179,6 +1179,12 @@ static void draw_help(WINDOW *screen) mvaddnstr(row + 5, col + 3, "Down, d, j Move down", -1); mvaddnstr(row + 6, col + 3, "? Toggle help window", -1); mvaddnstr(row + 7, col + 3, "q, Ctrl+C Quit", -1); + + attron(A_BOLD | A_UNDERLINE); + mvaddnstr(row + 9, col + 2, "Display Settings", -1); + attroff(A_BOLD | A_UNDERLINE); + + mvaddnstr(row + 11, col + 3, "b Toggle rate units (bits/bytes)", -1); } static void draw_footer(WINDOW *screen) @@ -1238,6 +1244,12 @@ static void presenter(void) if (skip_lines > SCROLL_MAX) skip_lines = SCROLL_MAX; break; + case 'b': + if (rate_type == RATE_BYTES) + rate_type = RATE_BITS; + else + rate_type = RATE_BYTES; + break; case '?': if (show_help) show_help = false; |