summaryrefslogtreecommitdiffstats
path: root/ui/ncurses/nc-boot-editor.h
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-boot-editor.h
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-boot-editor.h')
-rw-r--r--ui/ncurses/nc-boot-editor.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/ui/ncurses/nc-boot-editor.h b/ui/ncurses/nc-boot-editor.h
index a509f75..ee6d046 100644
--- a/ui/ncurses/nc-boot-editor.h
+++ b/ui/ncurses/nc-boot-editor.h
@@ -60,16 +60,18 @@ enum boot_editor_result {
*/
struct boot_editor {
- struct nc_scr scr;
- FORM *ncf;
- FIELD **fields;
+ struct nc_scr scr;
+ FORM *ncf;
+ FIELD **fields;
+ void *data;
+ struct pmenu *original_pmenu;
+ void (*on_exit)(struct boot_editor *boot_editor,
+ enum boot_editor_result result,
+ struct pb_boot_data *bd);
enum boot_editor_attr_cursor attr_cursor;
- void (*on_exit)(struct boot_editor *boot_editor,
- enum boot_editor_result result,
- struct pb_boot_data *bd);
};
-struct boot_editor *boot_editor_init(void *ui_ctx,
+struct boot_editor *boot_editor_init(struct pmenu *menu,
const struct pb_boot_data *bd,
void (*on_exit)(struct boot_editor *,
enum boot_editor_result,
OpenPOWER on IntegriCloud