Added a utilities menu entry to the main menu.

This commit is contained in:
Leon Styhre 2021-05-23 11:03:56 +02:00
parent 958c16cb03
commit 9125ab78e5
2 changed files with 13 additions and 1 deletions

View file

@ -59,6 +59,10 @@ GuiMenu::GuiMenu(Window* window) : GuiComponent(window),
if (isFullUI)
addEntry("OTHER SETTINGS", 0x777777FF, true, [this] { openOtherOptions(); });
if (isFullUI)
addEntry("UTILITIES", 0x777777FF, true, [this] {
openUtilitiesMenu(); });
if (!Settings::getInstance()->getBool("ForceKiosk") &&
Settings::getInstance()->getString("UIMode") != "kiosk") {
if (Settings::getInstance()->getBool("ShowQuitMenu"))
@ -1106,7 +1110,7 @@ void GuiMenu::openOtherOptions()
});
// macOS requires root privileges to reboot and power off so it doesn't make much
// sense to show the quit menu for this operating system.
// sense to enable this setting and menu entry for that operating system.
#if !defined(__APPLE__)
// Whether to show the quit menu with the options to reboot and shutdown the computer.
auto show_quit_menu = std::make_shared<SwitchComponent>(mWindow);
@ -1125,6 +1129,13 @@ void GuiMenu::openOtherOptions()
mWindow->pushGui(s);
}
void GuiMenu::openUtilitiesMenu()
{
auto s = new GuiSettings(mWindow, "UTILITIES");
mWindow->pushGui(s);
}
void GuiMenu::openQuitMenu()
{
if (!Settings::getInstance()->getBool("ShowQuitMenu")) {

View file

@ -39,6 +39,7 @@ private:
void openConfigInput();
void openCollectionSystemOptions();
void openOtherOptions();
void openUtilitiesMenu();
void openQuitMenu();
MenuComponent mMenu;