From 6b4dd0a7f0b243728ba44f405ff4b38a4212dbc9 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 8 Apr 2023 12:47:26 +0200 Subject: [PATCH] Added a better way to configure a local testing file for GuiThemeDownloader --- es-app/src/guis/GuiThemeDownloader.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/es-app/src/guis/GuiThemeDownloader.cpp b/es-app/src/guis/GuiThemeDownloader.cpp index 392579dea..e5c1fdbef 100644 --- a/es-app/src/guis/GuiThemeDownloader.cpp +++ b/es-app/src/guis/GuiThemeDownloader.cpp @@ -16,6 +16,7 @@ #include "rapidjson/document.h" #include "rapidjson/error/en.h" +#define LOCAL_TESTING_FILE false #define DEBUG_CLONING false GuiThemeDownloader::GuiThemeDownloader(std::function updateCallback) @@ -554,14 +555,22 @@ bool GuiThemeDownloader::renameDirectory(const std::string& path, const std::str void GuiThemeDownloader::parseThemesList() { - // Temporary location for testing purposes. - // const std::string themesFile {Utils::FileSystem::getHomePath() + - // "/.emulationstation/themes.json"}; +#if (LOCAL_TESTING_FILE) + LOG(LogWarning) << "GuiThemeDownloader: Using local \"themes.json\" testing file"; + const std::string themesFile {Utils::FileSystem::getHomePath() + + "/.emulationstation/themes.json"}; +#else const std::string themesFile {mThemeDirectory + "themes-list/themes.json"}; +#endif if (!Utils::FileSystem::exists(themesFile)) { - LOG(LogInfo) << "GuiThemeDownloader: No themes.json file found"; + LOG(LogError) << "GuiThemeDownloader: No themes.json file found"; + mWindow->pushGui(new GuiMsgBox( + getHelpStyle(), "COULDN'T FIND THE THEMES LIST CONFIGURATION FILE", "OK", + [] { return; }, "", nullptr, "", nullptr, true)); + mGrid.removeEntry(mCenterGrid); + mGrid.setCursorTo(mButtons); return; }