+ else if (key == 'x' || key == 27)
+ boot_editor->state = STATE_CANCEL;
+
+ else if (key == 'h')
+ boot_editor->state = STATE_HELP;
+
+ item = NULL;
+ bd = NULL;
+
+ switch (boot_editor->state) {
+ case STATE_SAVE:
+ item = boot_editor->item;
+ bd = boot_editor_prepare_data(boot_editor);
+ /* fall through */
+ case STATE_CANCEL:
+ boot_editor->on_exit(boot_editor->cui, item, bd);
+ break;
+ case STATE_HELP:
+ boot_editor->state = STATE_EDIT;
+ cui_show_help(boot_editor->cui, "Boot Option Editor",
+ boot_editor_help_text);
+ break;
+ default:
+ break;