summaryrefslogtreecommitdiffstats
path: root/ui/ncurses/nc-menu.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-10-10 15:35:35 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-10-10 16:08:54 +0800
commit6d1eff1e8e1db12e7aa179e8dc9c65050c045536 (patch)
tree18f70566adb3c146840f7964c8877b51a1cefde0 /ui/ncurses/nc-menu.c
parent97c5d1f5d56d9ce890b4896ad7a9dc7ece7d4347 (diff)
downloadtalos-petitboot-6d1eff1e8e1db12e7aa179e8dc9c65050c045536.tar.gz
talos-petitboot-6d1eff1e8e1db12e7aa179e8dc9c65050c045536.zip
ui/ncurses: Defer item creation until boot editor is done
Currently, when creating new menu entries, we create an empty item, add it to the menu, then run the boot editor. This means that cancelling the edit will leave an empty item in the menu. This change defers the creation until the boot editor is done. To do this, we modify the on_open callback to take a menu rather than an item, and pass NULL boot data to the editor. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'ui/ncurses/nc-menu.c')
-rw-r--r--ui/ncurses/nc-menu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/ncurses/nc-menu.c b/ui/ncurses/nc-menu.c
index 073860b..b45719d 100644
--- a/ui/ncurses/nc-menu.c
+++ b/ui/ncurses/nc-menu.c
@@ -233,8 +233,8 @@ static void pmenu_process_key(struct nc_scr *scr, int key)
item->on_edit(item);
break;
case 'n':
- if (menu->on_open)
- menu->on_open(menu);
+ if (menu->on_new)
+ menu->on_new(menu);
break;
case '\n':
case '\r':
OpenPOWER on IntegriCloud