From 68ba299e0e14ba6214fac5c42572201813e93753 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 10 Sep 2023 14:09:39 +0200 Subject: [PATCH] Removed the back button option from some confirmation dialogs Also changed the button text for some dialogs to display 'Proceed/Cancel' instead of 'Yes/No' --- es-app/src/guis/GuiMenu.cpp | 53 ++++++++----------- es-app/src/guis/GuiMetaDataEd.cpp | 2 +- es-app/src/guis/GuiScraperMenu.cpp | 27 +++++----- es-app/src/guis/GuiScraperMenu.h | 1 + es-app/src/guis/GuiThemeDownloader.cpp | 16 +++--- es-app/src/views/ViewController.cpp | 7 ++- es-core/src/guis/GuiTextEditKeyboardPopup.cpp | 3 +- es-core/src/guis/GuiTextEditPopup.cpp | 3 +- 8 files changed, 55 insertions(+), 57 deletions(-) diff --git a/es-app/src/guis/GuiMenu.cpp b/es-app/src/guis/GuiMenu.cpp index e39dfdc9a..ef58466a8 100644 --- a/es-app/src/guis/GuiMenu.cpp +++ b/es-app/src/guis/GuiMenu.cpp @@ -643,10 +643,9 @@ void GuiMenu::openUIOptions() msg.append("FLAGGED SUITABLE FOR CHILDREN\n"); } msg.append("TO UNLOCK AND RETURN TO THE FULL UI, ENTER THIS CODE: \n"); - msg.append(UIModeController::getInstance()->getFormattedPassKeyStr() + "\n\n"); - msg.append("DO YOU WANT TO PROCEED?"); + msg.append(UIModeController::getInstance()->getFormattedPassKeyStr()); mWindow->pushGui(new GuiMsgBox( - this->getHelpStyle(), msg, "YES", + this->getHelpStyle(), msg, "PROCEED", [this, selectedMode] { LOG(LogDebug) << "GuiMenu::openUISettings(): Setting UI mode to '" << selectedMode << "'."; @@ -673,7 +672,7 @@ void GuiMenu::openUIOptions() false); mWindow->invalidateCachedBackground(); }, - "NO", nullptr)); + "CANCEL", nullptr, "", nullptr, true)); } else { LOG(LogDebug) << "GuiMenu::openUISettings(): Setting UI mode to '" << selectedMode @@ -1136,27 +1135,19 @@ void GuiMenu::openConfigInput(GuiSettings* settings) // the input device settings menu later on. settings->setNeedsSaving(false); - std::string message; - if (mRenderer->getIsVerticalOrientation()) { - message = "THE KEYBOARD AND CONTROLLERS ARE\n" - "AUTOMATICALLY CONFIGURED, BUT USING\n" - "THIS CONFIGURATION TOOL YOU CAN\n" - "OVERRIDE THE DEFAULT BUTTON MAPPINGS\n" - "(THIS WILL NOT AFFECT THE HELP PROMPTS)\n" - "CONTINUE?"; - } - else { - message = "THE KEYBOARD AND CONTROLLERS ARE AUTOMATICALLY\n" - "CONFIGURED, BUT USING THIS CONFIGURATION TOOL\n" - "YOU CAN OVERRIDE THE DEFAULT BUTTON MAPPINGS\n" - "(THIS WILL NOT AFFECT THE HELP PROMPTS)\n" - "CONTINUE?"; - } + std::string message { + "THE KEYBOARD AND CONTROLLERS ARE AUTOMATICALLY CONFIGURED, BUT USING THIS " + "CONFIGURATION TOOL YOU CAN OVERRIDE THE DEFAULT BUTTON MAPPINGS (THIS WILL NOT " + "AFFECT THE HELP PROMPTS)"}; Window* window {mWindow}; window->pushGui(new GuiMsgBox( - getHelpStyle(), message, "YES", - [window] { window->pushGui(new GuiDetectDevice(false, false, nullptr)); }, "NO", nullptr)); + getHelpStyle(), message, "PROCEED", + [window] { window->pushGui(new GuiDetectDevice(false, false, nullptr)); }, "CANCEL", + nullptr, "", nullptr, false, true, + (mRenderer->getIsVerticalOrientation() ? + 0.84f : + 0.54f * (1.778f / mRenderer->getScreenAspectRatio())))); } void GuiMenu::openOtherOptions() @@ -1655,8 +1646,8 @@ void GuiMenu::openUtilities() "THIS WILL CREATE ALL GAME SYSTEM DIRECTORIES INSIDE YOUR ROM FOLDER AND IT WILL ALSO " "UPDATE ALL SYSTEMINFO.TXT FILES. THIS IS A SAFE OPERATION THAT WILL NOT DELETE OR " "MODIFY YOUR GAME FILES. TO DECREASE APPLICATION STARTUP TIMES IT'S RECOMMENDED TO " - "DELETE THE SYSTEM DIRECTORIES YOU DON'T NEED AFTER RUNNING THIS UTILITY. PROCEED?", - "YES", + "DELETE THE SYSTEM DIRECTORIES YOU DON'T NEED AFTER RUNNING THIS UTILITY", + "PROCEED", [this] { if (!SystemData::createSystemDirectories()) { mWindow->pushGui(new GuiMsgBox( @@ -1687,7 +1678,7 @@ void GuiMenu::openUtilities() 0.44f * (1.778f / mRenderer->getScreenAspectRatio())))); } }, - "NO", nullptr, "", nullptr, false, true, + "CANCEL", nullptr, "", nullptr, false, true, (mRenderer->getIsVerticalOrientation() ? 0.80f : 0.52f * (1.778f / mRenderer->getScreenAspectRatio())))); @@ -1706,10 +1697,9 @@ void GuiMenu::openUtilities() row.makeAcceptInputHandler([this] { mWindow->pushGui(new GuiMsgBox( getHelpStyle(), - "THIS WILL RESCAN YOUR ROM DIRECTORY\n" - "FOR CHANGES SUCH AS ADDED OR REMOVED\n" - "GAMES AND SYSTEMS, PROCEED?", - "YES", + "THIS WILL RESCAN YOUR ROM DIRECTORY FOR CHANGES SUCH AS ADDED OR REMOVED GAMES AND " + "SYSTEMS", + "PROCEED", [this] { if (CollectionSystemsManager::getInstance()->isEditing()) CollectionSystemsManager::getInstance()->exitEditMode(); @@ -1722,7 +1712,10 @@ void GuiMenu::openUtilities() } ViewController::getInstance()->rescanROMDirectory(); }, - "NO", nullptr)); + "CANCEL", nullptr, "", nullptr, false, true, + (mRenderer->getIsVerticalOrientation() ? + 0.80f : + 0.52f * (1.778f / mRenderer->getScreenAspectRatio())))); }); s->addRow(row); diff --git a/es-app/src/guis/GuiMetaDataEd.cpp b/es-app/src/guis/GuiMetaDataEd.cpp index bec253683..b76066c88 100644 --- a/es-app/src/guis/GuiMetaDataEd.cpp +++ b/es-app/src/guis/GuiMetaDataEd.cpp @@ -997,7 +997,7 @@ void GuiMetaDataEd::close() save(); closeFunc(); }, - "NO", closeFunc)); + "NO", closeFunc, "", nullptr, true)); } else { // Always save if the media files have been changed (i.e. newly scraped images). diff --git a/es-app/src/guis/GuiScraperMenu.cpp b/es-app/src/guis/GuiScraperMenu.cpp index 81d3453fa..4666dc11f 100644 --- a/es-app/src/guis/GuiScraperMenu.cpp +++ b/es-app/src/guis/GuiScraperMenu.cpp @@ -20,7 +20,8 @@ #include "guis/GuiScraperMulti.h" GuiScraperMenu::GuiScraperMenu(std::string title) - : mMenu {title} + : mRenderer {Renderer::getInstance()} + , mMenu {title} { // Scraper service. mScraper = @@ -144,7 +145,8 @@ GuiScraperMenu::GuiScraperMenu(std::string title) setSize(mMenu.getSize()); - setPosition((Renderer::getScreenWidth() - mSize.x) / 2.0f, Renderer::getScreenHeight() * 0.13f); + setPosition((mRenderer->getScreenWidth() - mSize.x) / 2.0f, + mRenderer->getScreenHeight() * 0.13f); // Make sure that the hash searching max file size is within the allowed range. if (Settings::getInstance()->getInt("ScraperSearchFileHashMaxSize") < 32) @@ -1232,19 +1234,20 @@ void GuiScraperMenu::pressedStart() if ((*it)->getPlatformIds().empty()) { std::string warningString; if (sys.size() == 1) { - warningString = "The selected system does not have a\n" - "platform set, results may be inaccurate\n" - "Continue anyway?"; + warningString = "THE SELECTED SYSTEM DOES NOT HAVE A PLATFORM SET, RESULTS MAY BE " + "INACCURATE"; } else { - warningString = "At least one of your selected\n" - "systems does not have a platform\n" - "set, results may be inaccurate\n" - "Continue anyway?"; + warningString = "AT LEAST ONE OF YOUR SELECTED SYSTEMS DOES NOT HAVE A PLATFORM " + "SET, RESULTS MAY BE INACCURATE"; } - mWindow->pushGui(new GuiMsgBox(getHelpStyle(), Utils::String::toUpper(warningString), - "YES", std::bind(&GuiScraperMenu::start, this), "NO", - nullptr)); + mWindow->pushGui( + new GuiMsgBox(getHelpStyle(), Utils::String::toUpper(warningString), "PROCEED", + std::bind(&GuiScraperMenu::start, this), "CANCEL", nullptr, "", + nullptr, false, true, + (mRenderer->getIsVerticalOrientation() ? + 0.80f : + 0.50f * (1.778f / mRenderer->getScreenAspectRatio())))); return; } } diff --git a/es-app/src/guis/GuiScraperMenu.h b/es-app/src/guis/GuiScraperMenu.h index 3c67c7f5c..096adffaf 100644 --- a/es-app/src/guis/GuiScraperMenu.h +++ b/es-app/src/guis/GuiScraperMenu.h @@ -57,6 +57,7 @@ private: std::shared_ptr> mSystems; std::shared_ptr mScraperRetryOnErrorCount; + Renderer* mRenderer; MenuComponent mMenu; }; diff --git a/es-app/src/guis/GuiThemeDownloader.cpp b/es-app/src/guis/GuiThemeDownloader.cpp index a65e2052b..1f9b2a7dd 100644 --- a/es-app/src/guis/GuiThemeDownloader.cpp +++ b/es-app/src/guis/GuiThemeDownloader.cpp @@ -724,7 +724,7 @@ void GuiThemeDownloader::populateGUI() mStatusType = StatusType::STATUS_DOWNLOADING; mStatusText = "DOWNLOADING THEME"; }, - "ABORT", [] { return; }, "", nullptr, true, true, + "CANCEL", [] { return; }, "", nullptr, true, true, (mRenderer->getIsVerticalOrientation() ? 0.75f : 0.46f * (1.778f / mRenderer->getScreenAspectRatio())))); @@ -752,7 +752,7 @@ void GuiThemeDownloader::populateGUI() mStatusType = StatusType::STATUS_DOWNLOADING; mStatusText = "DOWNLOADING THEME"; }, - "ABORT", [] { return; }, "", nullptr, true, true, + "CANCEL", [] { return; }, "", nullptr, true, true, (mRenderer->getIsVerticalOrientation() ? 0.75f : 0.46f * (1.778f / mRenderer->getScreenAspectRatio())))); @@ -779,7 +779,7 @@ void GuiThemeDownloader::populateGUI() mStatusType = StatusType::STATUS_DOWNLOADING; mStatusText = "DOWNLOADING THEME"; }, - "ABORT", [] { return; }, "", nullptr, true, true, + "CANCEL", [] { return; }, "", nullptr, true, true, (mRenderer->getIsVerticalOrientation() ? 0.75f : 0.46f * (1.778f / mRenderer->getScreenAspectRatio())))); @@ -789,7 +789,7 @@ void GuiThemeDownloader::populateGUI() getHelpStyle(), "THEME REPOSITORY \"" + theme.reponame + "\" CONTAINS LOCAL CHANGES. PROCEED TO OVERWRITE YOUR CHANGES " - "OR ABORT TO SKIP ALL UPDATES FOR THIS THEME", + "OR CANCEL TO SKIP ALL UPDATES FOR THIS THEME", "PROCEED", [this, theme] { std::promise().swap(mPromise); @@ -799,7 +799,7 @@ void GuiThemeDownloader::populateGUI() mStatusType = StatusType::STATUS_UPDATING; mStatusText = "UPDATING THEME"; }, - "ABORT", [] { return; }, "", nullptr, true, true, + "CANCEL", [] { return; }, "", nullptr, true, true, (mRenderer->getIsVerticalOrientation() ? 0.75f : 0.45f * (1.778f / mRenderer->getScreenAspectRatio())))); @@ -1173,7 +1173,7 @@ bool GuiThemeDownloader::input(InputConfig* config, Input input) makeInventory(); updateGUI(); }, - "ABORT", nullptr, "", nullptr, true, true, + "CANCEL", nullptr, "", nullptr, true, true, (mRenderer->getIsVerticalOrientation() ? 0.70f : 0.44f * (1.778f / mRenderer->getScreenAspectRatio())))); @@ -1242,7 +1242,7 @@ bool GuiThemeDownloader::fetchThemesList() mStatusText = "DOWNLOADING THEMES LIST"; return false; }, - "ABORT", + "CANCEL", [&] { delete this; return false; @@ -1280,7 +1280,7 @@ bool GuiThemeDownloader::fetchThemesList() mStatusText = "DOWNLOADING THEMES LIST"; return false; }, - "ABORT", + "CANCEL", [&] { delete this; return false; diff --git a/es-app/src/views/ViewController.cpp b/es-app/src/views/ViewController.cpp index 41e7c2746..7621049b9 100644 --- a/es-app/src/views/ViewController.cpp +++ b/es-app/src/views/ViewController.cpp @@ -259,9 +259,8 @@ void ViewController::noGamesDialog() "THIS WILL CREATE DIRECTORIES FOR ALL THE\n" "GAME SYSTEMS DEFINED IN es_systems.xml\n\n" "THIS MAY CREATE A LOT OF FOLDERS SO IT'S\n" - "ADVICED TO REMOVE THE ONES YOU DON'T NEED\n\n" - "PROCEED?", - "YES", + "ADVICED TO REMOVE THE ONES YOU DON'T NEED", + "PROCEED", [this] { if (!SystemData::createSystemDirectories()) { mWindow->pushGui(new GuiMsgBox(HelpStyle(), @@ -280,7 +279,7 @@ void ViewController::noGamesDialog() true)); } }, - "NO", nullptr, "", nullptr, true)); + "CANCEL", nullptr, "", nullptr, true)); }, "QUIT", [] { diff --git a/es-core/src/guis/GuiTextEditKeyboardPopup.cpp b/es-core/src/guis/GuiTextEditKeyboardPopup.cpp index 356fadb28..8af4766f1 100644 --- a/es-core/src/guis/GuiTextEditKeyboardPopup.cpp +++ b/es-core/src/guis/GuiTextEditKeyboardPopup.cpp @@ -374,7 +374,8 @@ bool GuiTextEditKeyboardPopup::input(InputConfig* config, Input input) [this] { delete this; return true; - })); + }, + "", nullptr, true)); } else { delete this; diff --git a/es-core/src/guis/GuiTextEditPopup.cpp b/es-core/src/guis/GuiTextEditPopup.cpp index cac2014f5..e8e1bffad 100644 --- a/es-core/src/guis/GuiTextEditPopup.cpp +++ b/es-core/src/guis/GuiTextEditPopup.cpp @@ -185,7 +185,8 @@ bool GuiTextEditPopup::input(InputConfig* config, Input input) [this] { delete this; return true; - })); + }, + "", nullptr, true)); } else { delete this;