From cb613c76a3108cec2a8c3334a920dcce106084af Mon Sep 17 00:00:00 2001 From: Vadim Kochan Date: Sat, 7 Nov 2015 00:23:25 +0200 Subject: flowtop: Add runtime command to change rate units Add interactive command 'b' to change rate units to show. Signed-off-by: Vadim Kochan Signed-off-by: Tobias Klauser --- flowtop.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/flowtop.c b/flowtop.c index 425ad8e..df190a4 100644 --- a/flowtop.c +++ b/flowtop.c @@ -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; -- cgit v1.2.3-54-g00ecf