* 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>
#include "log/log.h"
#include "talloc/talloc.h"
#include "ui/common/ui-system.h"
+#include "nc-cui.h"
#include "nc-menu.h"
/**
set_item_userptr(nci, i);
- menu->scr.unpost(&menu->scr);
+ nc_scr_unpost(&menu->scr);
set_menu_items(menu->ncm, NULL);
// FIXME: need to assure item name is a talloc string.
i->nci = nci;
set_menu_items(menu->ncm, menu->items);
- menu->scr.post(&menu->scr);
+ nc_scr_post(&menu->scr);
return 0;
}
switch (key) {
case 27: /* ESC */
+ case 'x':
if (menu->on_exit)
menu->on_exit(menu);
nc_flush_keys();
case KEY_UP:
pmenu_move_cursor(menu, REQ_UP_ITEM);
break;
+ case KEY_BTAB:
+ pmenu_move_cursor(menu, REQ_PREV_ITEM);
+ break;
case KEY_DOWN:
pmenu_move_cursor(menu, REQ_DOWN_ITEM);
break;
+ case '\t':
+ pmenu_move_cursor(menu, REQ_NEXT_ITEM);
+ break;
case 'e':
if (item->on_edit)
item->on_edit(item);
if (menu->on_new)
menu->on_new(menu);
break;
+ case ' ':
case '\n':
case '\r':
if (item->on_execute)
item->on_execute(item);
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 KEY_F(1):
+ 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;
/* Makes menu scrollable. */
set_menu_format(menu->ncm, LINES - nc_scr_frame_lines, 1);
+ set_menu_grey(menu->ncm, A_NORMAL);
+
return 0;
}