#include <log/log.h>
#include <fold/fold.h>
#include <util/util.h>
+#include <i18n/i18n.h>
#include "nc-cui.h"
#include "nc-textscreen.h"
switch (key) {
case 'x':
+ case 27: /* esc */
screen->on_exit(screen->cui);
break;
case KEY_DOWN:
case KEY_UP:
text_screen_scroll(screen, key);
break;
+ case 'h':
+ if (screen->help_text)
+ cui_show_help(screen->cui, screen->help_title,
+ screen->help_text);
+ break;
default:
break;
}
return &screen->scr;
}
+void text_screen_set_help(struct text_screen *screen, const char *title,
+ const struct help_text *text)
+{
+ screen->help_title = title;
+ screen->help_text = text;
+ screen->scr.frame.help = _("x=exit, h=help");
+}
+
static int text_screen_post(struct nc_scr *scr)
{
nc_scr_frame_draw(scr);
screen->scr.frame.ltitle = talloc_strdup(screen, title);
screen->scr.frame.rtitle = NULL;
- screen->scr.frame.help = "x=exit";
+ screen->scr.frame.help = _("x=exit");
scrollok(screen->scr.sub_ncw, true);
}