[haiku-commits] Change in haiku[master]: openfirmware: add a menu entry to go back to the firmware prompt

  • From: Gerrit <review@xxxxxxxxxxxxxxxxxxx>
  • To: waddlesplash <waddlesplash@xxxxxxxxx>, haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 30 Dec 2020 18:07:00 +0000

From Adrien Destugues <pulkomandy@xxxxxxxxx>:

Adrien Destugues has uploaded this change for review. ( 
https://review.haiku-os.org/c/haiku/+/3564 ;)


Change subject: openfirmware: add a menu entry to go back to the firmware prompt
......................................................................

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.
---
M src/system/boot/platform/openfirmware/menu.cpp
1 file changed, 16 insertions(+), 1 deletion(-)



  git pull ssh://git.haiku-os.org:22/haiku refs/changes/64/3564/1

diff --git a/src/system/boot/platform/openfirmware/menu.cpp 
b/src/system/boot/platform/openfirmware/menu.cpp
index 47f9c6f..feaf39b 100644
--- a/src/system/boot/platform/openfirmware/menu.cpp
+++ b/src/system/boot/platform/openfirmware/menu.cpp
@@ -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;

--
To view, visit https://review.haiku-os.org/c/haiku/+/3564
To unsubscribe, or for help writing mail filters, visit 
https://review.haiku-os.org/settings

Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: I1bc8530f397b2a6d66ec26f08527dab9b2a2699b
Gerrit-Change-Number: 3564
Gerrit-PatchSet: 1
Gerrit-Owner: Adrien Destugues <pulkomandy@xxxxxxxxx>
Gerrit-MessageType: newchange

Other related posts:

  • » [haiku-commits] Change in haiku[master]: openfirmware: add a menu entry to go back to the firmware prompt - Gerrit