]> git.ozlabs.org Git - petitboot/blobdiff - ui/ncurses/nc-menu.c
ui/ncurses: Add help to system configuration screen
[petitboot] / ui / ncurses / nc-menu.c
index dc4680789d3490ba03a669b59e6e923278077b6d..7533f30e4df8d96048ae6e33c559629af5a81aee 100644 (file)
@@ -16,9 +16,9 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#if defined(HAVE_CONFIG_H)
 #include "config.h"
-
-#define _GNU_SOURCE
+#endif
 
 #include <assert.h>
 #include <errno.h>
@@ -238,6 +238,7 @@ static void pmenu_process_key(struct nc_scr *scr, int key)
                if (menu->on_new)
                        menu->on_new(menu);
                break;
+       case ' ':
        case '\n':
        case '\r':
                if (item->on_execute)
@@ -245,6 +246,15 @@ static void pmenu_process_key(struct nc_scr *scr, int key)
                break;
        case 'i':
                cui_show_sysinfo(cui_from_arg(scr->ui_ctx));
+               break;
+       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;