X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=gui.c;h=2fddc2f8dbbf2674fae9613fcb8b99da616044ed;hp=d080946a0cab608f67269f6371ac69916d0faf16;hb=8c6ad492bee7eeec2bc667ce983c47f57fa45104;hpb=5c556c52f1196cea4536d36b683372de532943a9 diff --git a/gui.c b/gui.c index d080946a..2fddc2f8 100644 --- a/gui.c +++ b/gui.c @@ -60,15 +60,15 @@ static struct gui_args_info conf; enum {GETCH_MODE, COMMAND_MODE, EXTERNAL_MODE}; -#define COLOR_STATUSBAR 32 -#define COLOR_COMMAND 33 -#define COLOR_OUTPUT 34 -#define COLOR_MSG 35 -#define COLOR_ERRMSG 36 -#define COLOR_WELCOME 37 -#define COLOR_SEPARATOR 38 -#define COLOR_TOP 39 -#define COLOR_BOT 40 +#define COLOR_STATUSBAR 52 +#define COLOR_COMMAND 53 +#define COLOR_OUTPUT 54 +#define COLOR_MSG 55 +#define COLOR_ERRMSG 56 +#define COLOR_WELCOME 57 +#define COLOR_SEPARATOR 58 +#define COLOR_TOP 59 +#define COLOR_BOT 60 struct gui_command { const char *key; @@ -649,7 +649,6 @@ static void print_stat_item(int i) if (!curses_active || !d.len || !c) return; tmp = make_message("%s%s%s", d.prefix, c, d.postfix); -// PARA_DEBUG_LOG("%s: read: %s\n", __func__, tmp); wmove(top.win, d.y * top.lines / 100, d.x * COLS / 100); wrefresh(top.win); wattron(top.win, COLOR_PAIR(i + 1)); @@ -681,6 +680,7 @@ static void clear_all_items(void) static void init_colors(void) { int i; + if (!has_colors()) msg_n_exit(EXIT_FAILURE, "Error: No color term\n"); start_color(); @@ -749,7 +749,9 @@ static int check_stat_line(char *line, __a_unused void *data) // PARA_INFO_LOG("%s: checking: %s\n", __func__, line); i = stat_line_valid(line); if (i >= 0) { - line += strlen(status_item_list[i]) + 2; + line += strlen(status_item_list[i]) + 1; + if (*line == ' ') + line++; free(stat_content[i]); stat_content[i] = para_strdup(line); print_stat_item(i);