summaryrefslogtreecommitdiff
path: root/flowtop.c
diff options
context:
space:
mode:
authorVadim Kochan <vadim4j@gmail.com>2015-11-07 00:23:25 +0200
committerTobias Klauser <tklauser@distanz.ch>2015-11-09 10:32:27 +0100
commitcb613c76a3108cec2a8c3334a920dcce106084af (patch)
tree0c06be4beb72468e8c51530d4e1ba5137b37609e /flowtop.c
parent5c3ba0cab03e9fb900ff60222a0313f2cc585c65 (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>
Diffstat (limited to 'flowtop.c')
-rw-r--r--flowtop.c12
1 files changed, 12 insertions, 0 deletions
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;