endif
-petitboot_nc_SOURCES = generic-main.c
+petitboot_nc_SOURCES = generic-main.c generic-main-help.c
petitboot_nc_LDADD = $(common_libs)
petitboot_ps3_nc_SOURCES = ps3-main.c
--- /dev/null
+
+const char *main_menu_help_text =
+"From the main menu screen, select a boot option. The options displayed are \
+available on the system and the network.\n\
+\n\
+To select a boot option, press Enter.\n\
+\n\
+To make changes to an existing option, type E (edit).\n\
+\n\
+To add a new boot option, type N (new).\n\
+\n\
+To display information about the system, including the MAC addresses of each \
+network interface, type I (information).\n\
+\n\
+To make changes to the system configuration, type C (configure).\n\
+\n\
+To close the Petitboot interface, type X (exit).\n";
#include "ui/common/discover-client.h"
#include "nc-cui.h"
+extern const char *main_menu_help_text;
+
static void print_version(void)
{
printf("petitboot-nc (" PACKAGE_NAME ") " PACKAGE_VERSION "\n");
"Petitboot (" PACKAGE_VERSION ")");
m->scr.frame.rtitle = NULL;
m->scr.frame.help = talloc_strdup(m,
- "Enter=accept, e=edit, n=new, x=exit");
+ "Enter=accept, e=edit, n=new, x=exit, h=help");
m->scr.frame.status = talloc_strdup(m, "Welcome to Petitboot");
i = pmenu_item_init(m, 0, " ");
goto fail_setup;
}
+ m->help_title = "main menu";
+ m->help_text = main_menu_help_text;
+
menu_opts_off(m->ncm, O_SHOWDESC);
set_menu_mark(m->ncm, " *");
set_current_item(m->ncm, i->nci);
case 'c':
cui_show_config(cui_from_arg(scr->ui_ctx));
break;
+ case 'h':
+ if (menu->help_text)
+ cui_show_help(cui_from_arg(scr->ui_ctx),
+ menu->help_title, menu->help_text);
+ break;
default:
menu_driver(menu->ncm, key);
break;
ITEM **items;
unsigned int item_count;
unsigned int insert_pt;
+ const char *help_title;
+ const char *help_text;
int (*hot_key)(struct pmenu *menu, struct pmenu_item *item, int c);
void (*on_exit)(struct pmenu *menu);
void (*on_new)(struct pmenu *menu);