diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2013-10-10 15:35:35 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2013-10-10 16:08:54 +0800 |
commit | 6d1eff1e8e1db12e7aa179e8dc9c65050c045536 (patch) | |
tree | 18f70566adb3c146840f7964c8877b51a1cefde0 /ui/ncurses/nc-menu.h | |
parent | 97c5d1f5d56d9ce890b4896ad7a9dc7ece7d4347 (diff) | |
download | talos-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.h')
-rw-r--r-- | ui/ncurses/nc-menu.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/ncurses/nc-menu.h b/ui/ncurses/nc-menu.h index f010835..3b7bc88 100644 --- a/ui/ncurses/nc-menu.h +++ b/ui/ncurses/nc-menu.h @@ -47,7 +47,7 @@ struct pmenu_item { ITEM *nci; struct pmenu *pmenu; void *data; - int (*on_edit)(struct pmenu_item *item); + void (*on_edit)(struct pmenu_item *item); int (*on_execute)(struct pmenu_item *item); }; @@ -85,7 +85,7 @@ struct pmenu { unsigned int insert_pt; int (*hot_key)(struct pmenu *menu, struct pmenu_item *item, int c); void (*on_exit)(struct pmenu *menu); - void (*on_open)(struct pmenu *menu); + void (*on_new)(struct pmenu *menu); }; struct pmenu *pmenu_init(void *ui_ctx, unsigned int item_count, |