]> 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 eb7cfdff0d942562333a664dfe145b4555e03e6b..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>
@@ -250,6 +250,11 @@ static void pmenu_process_key(struct nc_scr *scr, int key)
        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;