@@ -295,7 +295,7 @@ static int clock_print_header(void)
"Name", "Flags", "Rate", "Usecount", "Children") < 0)
return -1;
- ret = display_header_footer(CLOCK, buf);
+ ret = display_column_name(buf);
free(buf);
@@ -293,12 +293,12 @@ static int display_keystroke(int fd, void *data)
case KEY_RIGHT:
case '\t':
- display_next_panel();
+ display_show_header(display_next_panel());
break;
case KEY_LEFT:
case KEY_BTAB:
- display_prev_panel();
+ display_show_header(display_prev_panel());
break;
case KEY_DOWN:
@@ -429,21 +429,15 @@ int display_init(int wdefault)
return display_refresh(wdefault);
}
-int display_header_footer(int win, const char *line)
+int display_column_name(const char *line)
{
- int ret;
-
werase(main_win);
wattron(main_win, A_BOLD);
mvwprintw(main_win, 0, 0, "%s", line);
wattroff(main_win, A_BOLD);
wrefresh(main_win);
- ret = display_show_header(win);
- if (ret)
- return ret;
-
- return display_show_footer(win);
+ return 0;
}
int display_register(int win, struct display_ops *ops)
@@ -29,5 +29,5 @@ extern void *display_get_row_data(int window);
extern int display_init(int wdefault);
extern int display_register(int win, struct display_ops *ops);
-extern int display_header_footer(int win, const char *line);
extern int display_refresh(int win);
+extern int display_column_name(const char *line);
@@ -148,7 +148,7 @@ static int regulator_print_header(void)
"Min u-volts", "Max u-volts") < 0)
return -1;
- ret = display_header_footer(REGULATOR, buf);
+ ret = display_column_name(buf);
free(buf);
@@ -243,7 +243,7 @@ static int sensor_print_header(void)
if (asprintf(&buf, "%-36s%s", "Name", "Value") < 0)
return -1;
- ret = display_header_footer(SENSOR, buf);
+ ret = display_column_name(buf);
free(buf);
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> --- clocks.c | 2 +- display.c | 14 ++++---------- display.h | 2 +- regulator.c | 2 +- sensor.c | 2 +- 5 files changed, 8 insertions(+), 14 deletions(-)