From bda5ad2ec9fa333c8200451496d6c251abbeee19 Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Sat, 21 Mar 2026 01:36:24 +0100 Subject: Adds data server (WIP) --- ui/curses/ui.c | 12 ++++++------ ui/curses/ui_vars.py | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'ui/curses') diff --git a/ui/curses/ui.c b/ui/curses/ui.c index faf1b6e..8a2d85a 100644 --- a/ui/curses/ui.c +++ b/ui/curses/ui.c @@ -344,7 +344,7 @@ void ui_line(bool clear, int line, int color, int attr, const char *format, ...) va_start(args, format); vsnprintf(g_line_buff, COLS, format, args); - mvprintw(line, 1, g_line_buff); + mvprintw(line, 1, "%s", g_line_buff); va_end(args); attroff(COLOR_PAIR(color) | attr); @@ -369,7 +369,7 @@ void ui_field(int line, int col, int color, int attr, const char *format, ...) { va_start(args, format); vsnprintf(g_line_buff, COLS - col, format, args); - mvprintw(line, col, g_line_buff); + mvprintw(line, col, "%s", g_line_buff); va_end(args); attroff(COLOR_PAIR(color) | attr); @@ -834,7 +834,7 @@ void ui_print_log_line(unsigned lptr, int line) { PANE_WIDTH, PAIR_NORMAL, A_NORMAL, - " %d-%02d-%02d %02d:%02d:%02d", + " %d-%02d-%02d %02d:%02d:%02d --", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, @@ -845,15 +845,15 @@ void ui_print_log_line(unsigned lptr, int line) { ui_field( line, - PANE_WIDTH + 22, + PANE_WIDTH + 25, g_log_warns[lptr] ? PAIR_WARN : PAIR_HEADER, A_NORMAL, - g_log_warns[lptr] ? "[WARN]" : "[INFO]" + g_log_warns[lptr] ? "WARN" : "INFO" ); ui_field( line, - PANE_WIDTH + 29, + PANE_WIDTH + 30, PAIR_NORMAL, A_NORMAL, g_logs[lptr] diff --git a/ui/curses/ui_vars.py b/ui/curses/ui_vars.py index 54f62e3..b2462fb 100644 --- a/ui/curses/ui_vars.py +++ b/ui/curses/ui_vars.py @@ -1,5 +1,7 @@ class UIVars: def __init__(self, _): + self.flags = set() self.includes = {"curses.h", "locale.h", "time.h"} self.defines = {"-DNCURSES_WIDECHAR=1"} self.links = {"-lncurses"} + self.pager = True -- cgit v1.2.3-70-g09d2