openfirmware: add a menu entry to go back to the firmware prompt
It's annoying to need to reboot the machine everytime I test a change to the bootloader. Change-Id: I1bc8530f397b2a6d66ec26f08527dab9b2a2699b Reviewed-on: https://review.haiku-os.org/c/haiku/+/3564 Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
parent
f924bac3c7
commit
3463eeac01
@ -7,15 +7,30 @@
|
||||
#include <boot/platform.h>
|
||||
#include <boot/menu.h>
|
||||
#include <boot/platform/generic/text_menu.h>
|
||||
#include <platform/openfirmware/openfirmware.h>
|
||||
|
||||
|
||||
static bool
|
||||
of_exit_hook(Menu *menu, MenuItem *item)
|
||||
{
|
||||
of_exit();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
platform_add_menus(Menu *menu)
|
||||
{
|
||||
// ToDo: implement me!
|
||||
MenuItem* item;
|
||||
|
||||
switch (menu->Type()) {
|
||||
case MAIN_MENU:
|
||||
item = new(std::nothrow) MenuItem("Exit to OpenFirmware");
|
||||
if (item != NULL) {
|
||||
menu->AddItem(item);
|
||||
item->SetTarget(of_exit_hook);
|
||||
item->SetShortcut('q');
|
||||
}
|
||||
break;
|
||||
case SAFE_MODE_MENU:
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user