From 86c0ef0e30f6cb24db04f20a326cf5fb4b616c3c Mon Sep 17 00:00:00 2001 From: Anders Betts Date: Sat, 19 Sep 2026 23:27:03 +0200 Subject: tui: bokslut footer explains the plan/post keys --- clients/tui.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'clients/tui.c') diff --git a/clients/tui.c b/clients/tui.c index 8f410c2..a964f65 100644 --- a/clients/tui.c +++ b/clients/tui.c @@ -1145,9 +1145,15 @@ int tui_menu(const char *title, const char *const *items, int n, /* frame, status and hints */ /* ------------------------------------------------------------------ */ +static const char *g_form_hint; static char g_status[512]; static char g_right[160]; +void tui_form_hint(const char *hint) +{ + g_form_hint = hint; +} + void tui_set_status(const char *status, const char *right) { snprintf(g_status, sizeof g_status, "%s", status ? status : ""); @@ -1390,11 +1396,16 @@ int tui_form_run_hook(const char *title, struct tui_form_field *f, int n, else if (!can_edit) attroff(tui_style_attrs(TUI_DIM, g_colours, 0)); } - tui_hints(can_edit - ? "upp/ned Enter = ändra F5 = uppdatera" - " ^Enter = spara Esc/q = tillbaka ^C = avsluta" - : "upp/ned F5 = uppdatera Esc/q = tillbaka" - " ^C = avsluta (endast behöriga kan ändra)"); + tui_hints(g_form_hint + ? g_form_hint + : (can_edit + ? "upp/ned/Home/End Enter = ändra" + " F5 = uppdatera ^Enter = spara" + " Esc/q = tillbaka ^C = avsluta" + : "upp/ned/Home/End F5 = uppdatera" + " Esc/q = tillbaka ^C = avsluta" + " (endast behöriga kan ändra)")); + g_form_hint = NULL; refresh(); int ch = in_key(); int nxt = tui_form_next(sel, n, ch); -- cgit v1.3