From 059ce0e41599f2dbc9249e666f7ff65ffe1e195b Mon Sep 17 00:00:00 2001 From: Christoph Greulich Date: Thu, 30 Jan 2025 00:49:16 +0100 Subject: [PATCH] Introduced KNULLI flag, hid some irrelevant menu options, added RGB sanity check --- CMakeLists.txt | 6 ++++++ es-app/src/guis/GuiMenu.cpp | 12 ++++++++++-- es-app/src/guis/knulli/GuiRgbSettings.cpp | 8 ++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3fa6d0a038..fe420e5fe4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,7 @@ option(BCM "BCM host" OFF) option(BATOCERA "Set to ON to enable BATOCERA specific code" OFF) option(RETROBAT "Set to ON to enable RETROBAT specific code" OFF) +option(KNULLI "Set to ON to enable KNULLI specific code" OFF) option(ENABLE_FILEMANAGER "Set to ON to enable f1 shortcut for filesystem" OFF) option(DISABLE_KODI "Set to ON to disable kodi in menu" OFF) @@ -97,6 +98,11 @@ if(RETROBAT) add_definitions(-DRETROBAT) endif() +if(KNULLI) + MESSAGE("Knulli build") + add_definitions(-DKNULLI) +endif() + # disable kodi menu if(DISABLE_KODI) MESSAGE("Kodi disabled") diff --git a/es-app/src/guis/GuiMenu.cpp b/es-app/src/guis/GuiMenu.cpp index 816cb07fb9..ea77becf53 100644 --- a/es-app/src/guis/GuiMenu.cpp +++ b/es-app/src/guis/GuiMenu.cpp @@ -199,8 +199,9 @@ GuiMenu::GuiMenu(Window *window, bool animate) : GuiComponent(window), mMenu(win ApiSystem::getInstance()->isScriptingSupported(ApiSystem::UPGRADE)) addEntry(_("UPDATES & DOWNLOADS"), true, [this] { openUpdatesSettings(); }, "iconUpdates"); - // Tools (Knulli-specific) +#ifdef KNULLI addEntry(_("DEVICE SETTINGS"), true, [this] { openDeviceSettings(); }, "iconSystem"); +#endif addEntry(_("SYSTEM SETTINGS").c_str(), true, [this] { openSystemSettings(); }, "iconSystem"); } else @@ -1238,6 +1239,7 @@ void GuiMenu::openUpdatesSettings() }); } +#ifndef KNULLI if (ApiSystem::getInstance()->isScriptingSupported(ApiSystem::UPGRADE)) { updateGui->addGroup(_("SOFTWARE UPDATES")); @@ -1289,7 +1291,7 @@ void GuiMenu::openUpdatesSettings() } }); } - +#endif mWindow->pushGui(updateGui); } @@ -1673,6 +1675,7 @@ void GuiMenu::openSystemSettings() } }); +#ifndef KNULLI // splash auto optionsSplash = std::make_shared >(mWindow, _("BOOT SPLASH"), false); @@ -1714,6 +1717,7 @@ void GuiMenu::openSystemSettings() SystemConf::getInstance()->saveSystemConf(); } }); +#endif #else if (!ApiSystem::getInstance()->isScriptingSupported(ApiSystem::GAMESETTINGS)) { @@ -1840,12 +1844,16 @@ void GuiMenu::openSystemSettings() } #ifdef BATOCERA +#ifndef KNULLI s->addEntry(_("DMD"), true, [this] { openDmdSettings(); }); #endif +#endif #ifdef BATOCERA +#ifndef KNULLI s->addEntry(_("MULTISCREENS"), true, [this] { openMultiScreensSettings(); }); #endif +#endif #ifdef BATOCERA #ifdef X86_64 diff --git a/es-app/src/guis/knulli/GuiRgbSettings.cpp b/es-app/src/guis/knulli/GuiRgbSettings.cpp index 9d8612446b..36380aeba0 100644 --- a/es-app/src/guis/knulli/GuiRgbSettings.cpp +++ b/es-app/src/guis/knulli/GuiRgbSettings.cpp @@ -116,17 +116,25 @@ std::shared_ptr> GuiRgbSettings::createModeOpti optionsLedMode->add(_("NONE"), "0", selectedLedMode == "0"); if (isH700 || isA133) { optionsLedMode->add(_("STATIC"), "1", selectedLedMode == "1"); + } else if (selectedLedMode == "1") { + selectedLedMode = DEFAULT_LED_MODE; } if (isH700) { optionsLedMode->add(_("BREATHING (FAST)"), "2", selectedLedMode == "2"); + } else if (selectedLedMode == "2") { + selectedLedMode = DEFAULT_LED_MODE; } if (isH700 || isA133) { optionsLedMode->add(_("BREATHING (MEDIUM)"), "3", selectedLedMode == "3"); + } else if (selectedLedMode == "3") { + selectedLedMode = DEFAULT_LED_MODE; } if (isH700) { optionsLedMode->add(_("BREATHING (SLOW)"), "4", selectedLedMode == "4"); optionsLedMode->add(_("SINGLE RAINBOW"), "5", selectedLedMode == "5"); optionsLedMode->add(_("MULTI RAINBOW"), "6", selectedLedMode == "6"); + } else if (selectedLedMode == "4" || selectedLedMode == "5" || selectedLedMode == "6") { + selectedLedMode = DEFAULT_LED_MODE; } addWithDescription(_("MODE"), _("Set the default LED animation. (Not all of the settings below are applicable to every mode.)"), optionsLedMode);