diff --git a/es-app/CMakeLists.txt b/es-app/CMakeLists.txt index e83abd0a5..d5e6ea4d3 100644 --- a/es-app/CMakeLists.txt +++ b/es-app/CMakeLists.txt @@ -14,11 +14,6 @@ set(ES_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/SystemScreenSaver.h ${CMAKE_CURRENT_SOURCE_DIR}/src/CollectionSystemManager.h - # GuiComponents - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/RatingComponent.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/ScraperSearchComponent.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/TextListComponent.h - # Guis ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiFastSelect.h ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMetaDataEd.h @@ -32,6 +27,7 @@ set(ES_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiSettings.h ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiScraperMenu.h ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiScraperMulti.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiScraperSearch.h ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiGamelistFilter.h ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiCollectionSystemsOptions.h ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiInfoPopup.h @@ -72,10 +68,6 @@ set(ES_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/SystemScreenSaver.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/CollectionSystemManager.cpp - # GuiComponents - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/RatingComponent.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/ScraperSearchComponent.cpp - # Guis ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiFastSelect.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMetaDataEd.cpp @@ -89,6 +81,7 @@ set(ES_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiSettings.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiScraperMenu.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiScraperMulti.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiScraperSearch.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiGamelistFilter.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiCollectionSystemsOptions.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiInfoPopup.cpp diff --git a/es-app/src/guis/GuiGameScraper.cpp b/es-app/src/guis/GuiGameScraper.cpp index 66f8e674a..5feb8ff93 100644 --- a/es-app/src/guis/GuiGameScraper.cpp +++ b/es-app/src/guis/GuiGameScraper.cpp @@ -3,7 +3,7 @@ // // Single game scraping user interface. // This interface is triggered from GuiMetaDataEd. -// ScraperSearchComponent is called from here. +// GuiScraperSearch is called from here. // #include "guis/GuiGameScraper.h" @@ -45,9 +45,9 @@ GuiGameScraper::GuiGameScraper( // Row 4 is a spacer. - // ScraperSearchComponent. - mSearch = std::make_shared(window, - ScraperSearchComponent::NEVER_AUTO_ACCEPT); + // GuiScraperSearch. + mSearch = std::make_shared(window, + GuiScraperSearch::NEVER_AUTO_ACCEPT); mGrid.setEntry(mSearch, Vector2i(0, 5), true); // Buttons diff --git a/es-app/src/guis/GuiGameScraper.h b/es-app/src/guis/GuiGameScraper.h index adbad4dd1..360394a14 100644 --- a/es-app/src/guis/GuiGameScraper.h +++ b/es-app/src/guis/GuiGameScraper.h @@ -3,7 +3,7 @@ // // Single game scraping user interface. // This interface is triggered from GuiMetaDataEd. -// ScraperSearchComponent is called from here. +// GuiScraperSearch is called from here. // #pragma once @@ -11,7 +11,7 @@ #define ES_APP_GUIS_GUI_GAME_SCRAPER_H #include "components/NinePatchComponent.h" -#include "components/ScraperSearchComponent.h" +#include "guis/GuiScraperSearch.h" #include "GuiComponent.h" class GuiGameScraper : public GuiComponent @@ -37,7 +37,7 @@ private: std::shared_ptr mGameName; std::shared_ptr mSystemName; - std::shared_ptr mSearch; + std::shared_ptr mSearch; std::shared_ptr mButtonGrid; ScraperSearchParams mSearchParams; diff --git a/es-app/src/guis/GuiMetaDataEd.cpp b/es-app/src/guis/GuiMetaDataEd.cpp index aaed45431..0a4a527d5 100644 --- a/es-app/src/guis/GuiMetaDataEd.cpp +++ b/es-app/src/guis/GuiMetaDataEd.cpp @@ -4,7 +4,7 @@ // Game metadata edit user interface. // This interface is triggered from the GuiGamelistOptions menu. // The scraping interface is handled by GuiGameScraper which calls -// ScraperSearchComponent. +// GuiScraperSearch. // #include "guis/GuiMetaDataEd.h" @@ -286,7 +286,7 @@ void GuiMetaDataEd::fetchDone(const ScraperSearchResult& result) MetaDataList* metadata = nullptr; metadata = new MetaDataList(*mMetaData); - mMetadataUpdated = ScraperSearchComponent::saveMetadata(result, *metadata); + mMetadataUpdated = GuiScraperSearch::saveMetadata(result, *metadata); // Update the list with the scraped metadata values. for (unsigned int i = 0; i < mEditors.size(); i++) { diff --git a/es-app/src/guis/GuiMetaDataEd.h b/es-app/src/guis/GuiMetaDataEd.h index a494e7b1c..dac9f7bda 100644 --- a/es-app/src/guis/GuiMetaDataEd.h +++ b/es-app/src/guis/GuiMetaDataEd.h @@ -4,7 +4,7 @@ // Game metadata edit user interface. // This interface is triggered from the GuiGamelistOptions menu. // The scraping interface is handled by GuiGameScraper which calls -// ScraperSearchComponent. +// GuiScraperSearch. // #pragma once diff --git a/es-app/src/guis/GuiScraperMulti.cpp b/es-app/src/guis/GuiScraperMulti.cpp index d9b84b1bc..763a44f71 100644 --- a/es-app/src/guis/GuiScraperMulti.cpp +++ b/es-app/src/guis/GuiScraperMulti.cpp @@ -4,16 +4,16 @@ // Multiple game scraping user interface. // Shows the progress for the scraping as it's running. // This interface is triggered from GuiScraperMenu. -// ScraperSearchComponent is called from here. +// GuiScraperSearch is called from here. // #include "guis/GuiScraperMulti.h" #include "components/ButtonComponent.h" #include "components/MenuComponent.h" -#include "components/ScraperSearchComponent.h" #include "components/TextComponent.h" #include "guis/GuiMsgBox.h" +#include "guis/GuiScraperSearch.h" #include "views/ViewController.h" #include "Gamelist.h" #include "PowerSaver.h" @@ -55,15 +55,15 @@ GuiScraperMulti::GuiScraperMulti( Font::get(FONT_SIZE_SMALL), 0x888888FF, ALIGN_CENTER); mGrid.setEntry(mSubtitle, Vector2i(0, 2), false, true); - mSearchComp = std::make_shared(mWindow, - approveResults ? ScraperSearchComponent::ALWAYS_ACCEPT_MATCHING_CRC - : ScraperSearchComponent::ALWAYS_ACCEPT_FIRST_RESULT); + mSearchComp = std::make_shared(mWindow, + approveResults ? GuiScraperSearch::ALWAYS_ACCEPT_MATCHING_CRC + : GuiScraperSearch::ALWAYS_ACCEPT_FIRST_RESULT); mSearchComp->setAcceptCallback(std::bind(&GuiScraperMulti::acceptResult, this, std::placeholders::_1)); mSearchComp->setSkipCallback(std::bind(&GuiScraperMulti::skip, this)); mSearchComp->setCancelCallback(std::bind(&GuiScraperMulti::finish, this)); mGrid.setEntry(mSearchComp, Vector2i(0, 3), mSearchComp->getSearchType() != - ScraperSearchComponent::ALWAYS_ACCEPT_FIRST_RESULT, true); + GuiScraperSearch::ALWAYS_ACCEPT_FIRST_RESULT, true); std::vector< std::shared_ptr > buttons; @@ -136,7 +136,7 @@ void GuiScraperMulti::acceptResult(const ScraperSearchResult& result) { ScraperSearchParams& search = mSearchQueue.front(); - ScraperSearchComponent::saveMetadata(result, search.game->metadata); + GuiScraperSearch::saveMetadata(result, search.game->metadata); updateGamelist(search.system); diff --git a/es-app/src/guis/GuiScraperMulti.h b/es-app/src/guis/GuiScraperMulti.h index 3ce33ef55..a93e6c53e 100644 --- a/es-app/src/guis/GuiScraperMulti.h +++ b/es-app/src/guis/GuiScraperMulti.h @@ -4,7 +4,7 @@ // Multiple game scraping user interface. // Shows the progress for the scraping as it's running. // This interface is triggered from GuiScraperMenu. -// ScraperSearchComponent is called from here. +// GuiScraperSearch is called from here. // #pragma once @@ -17,7 +17,7 @@ #include "GuiComponent.h" #include "MetaData.h" -class ScraperSearchComponent; +class GuiScraperSearch; class TextComponent; class GuiScraperMulti : public GuiComponent @@ -53,7 +53,7 @@ private: std::shared_ptr mTitle; std::shared_ptr mSystem; std::shared_ptr mSubtitle; - std::shared_ptr mSearchComp; + std::shared_ptr mSearchComp; std::shared_ptr mButtonGrid; }; diff --git a/es-app/src/components/ScraperSearchComponent.cpp b/es-app/src/guis/GuiScraperSearch.cpp similarity index 93% rename from es-app/src/components/ScraperSearchComponent.cpp rename to es-app/src/guis/GuiScraperSearch.cpp index 1c57320d8..a78e00d38 100644 --- a/es-app/src/components/ScraperSearchComponent.cpp +++ b/es-app/src/guis/GuiScraperSearch.cpp @@ -1,7 +1,7 @@ // -// ScraperSearchComponent.cpp +// GuiScraperSearch.cpp // -// User interface component for the scraper where the user is able to see an overview +// User interface for the scraper where the user is able to see an overview // of the game being scraped and an option to override the game search string. // Used by both single-game scraping from the GuiMetaDataEd menu as well as // to resolve scraping conflicts when run from GuiScraperMenu. @@ -11,7 +11,7 @@ // from GuiScraperMulti for multi-game scraping. // -#include "components/ScraperSearchComponent.h" +#include "guis/GuiScraperSearch.h" #include "components/ComponentList.h" #include "components/DateTimeEditComponent.h" @@ -30,7 +30,7 @@ #include "Log.h" #include "Window.h" -ScraperSearchComponent::ScraperSearchComponent( +GuiScraperSearch::GuiScraperSearch( Window* window, SearchType type) : GuiComponent(window), @@ -107,7 +107,7 @@ ScraperSearchComponent::ScraperSearchComponent( updateViewStyle(); } -void ScraperSearchComponent::onSizeChanged() +void GuiScraperSearch::onSizeChanged() { mGrid.setSize(mSize); @@ -160,7 +160,7 @@ void ScraperSearchComponent::onSizeChanged() mBusyAnim.setSize(mSize); } -void ScraperSearchComponent::resizeMetadata() +void GuiScraperSearch::resizeMetadata() { mMD_Grid->setSize(mGrid.getColWidth(2), mGrid.getRowHeight(1)); if (mMD_Grid->getSize().y() > mMD_Pairs.size()) { @@ -202,7 +202,7 @@ void ScraperSearchComponent::resizeMetadata() } } -void ScraperSearchComponent::updateViewStyle() +void GuiScraperSearch::updateViewStyle() { // Unlink description, result list and result name. mGrid.removeEntry(mResultName); @@ -242,7 +242,7 @@ void ScraperSearchComponent::updateViewStyle() } } -void ScraperSearchComponent::search(const ScraperSearchParams& params) +void GuiScraperSearch::search(const ScraperSearchParams& params) { mBlockAccept = true; @@ -257,7 +257,7 @@ void ScraperSearchComponent::search(const ScraperSearchParams& params) mSearchHandle = startScraperSearch(params); } -void ScraperSearchComponent::stop() +void GuiScraperSearch::stop() { mThumbnailReq.reset(); mSearchHandle.reset(); @@ -266,7 +266,7 @@ void ScraperSearchComponent::stop() mBlockAccept = false; } -void ScraperSearchComponent::onSearchDone(const std::vector& results) +void GuiScraperSearch::onSearchDone(const std::vector& results) { mResultList->clear(); @@ -322,16 +322,16 @@ void ScraperSearchComponent::onSearchDone(const std::vector } -void ScraperSearchComponent::onSearchError(const std::string& error) +void GuiScraperSearch::onSearchError(const std::string& error) { - LOG(LogInfo) << "ScraperSearchComponent search error: " << error; + LOG(LogInfo) << "GuiScraperSearch search error: " << error; mWindow->pushGui(new GuiMsgBox(mWindow, Utils::String::toUpper(error), - "RETRY", std::bind(&ScraperSearchComponent::search, this, mLastSearch), + "RETRY", std::bind(&GuiScraperSearch::search, this, mLastSearch), "SKIP", mSkipCallback, "CANCEL", mCancelCallback)); } -int ScraperSearchComponent::getSelectedIndex() +int GuiScraperSearch::getSelectedIndex() { if (!mScraperResults.size() || mGrid.getSelectedComponent() != mResultList) return -1; @@ -339,7 +339,7 @@ int ScraperSearchComponent::getSelectedIndex() return mResultList->getCursorId(); } -void ScraperSearchComponent::updateInfoPane() +void GuiScraperSearch::updateInfoPane() { int i = getSelectedIndex(); if (mSearchType == ALWAYS_ACCEPT_FIRST_RESULT && mScraperResults.size()) @@ -405,7 +405,7 @@ void ScraperSearchComponent::updateInfoPane() } } -bool ScraperSearchComponent::input(InputConfig* config, Input input) +bool GuiScraperSearch::input(InputConfig* config, Input input) { if (config->isMappedTo("a", input) && input.value != 0) { if (mBlockAccept) @@ -415,7 +415,7 @@ bool ScraperSearchComponent::input(InputConfig* config, Input input) return GuiComponent::input(config, input); } -void ScraperSearchComponent::render(const Transform4x4f& parentTrans) +void GuiScraperSearch::render(const Transform4x4f& parentTrans) { Transform4x4f trans = parentTrans * getTransform(); @@ -429,7 +429,7 @@ void ScraperSearchComponent::render(const Transform4x4f& parentTrans) } } -void ScraperSearchComponent::returnResult(ScraperSearchResult result) +void GuiScraperSearch::returnResult(ScraperSearchResult result) { mBlockAccept = true; @@ -443,7 +443,7 @@ void ScraperSearchComponent::returnResult(ScraperSearchResult result) mAcceptCallback(result); } -void ScraperSearchComponent::update(int deltaTime) +void GuiScraperSearch::update(int deltaTime) { GuiComponent::update(deltaTime); @@ -530,7 +530,7 @@ void ScraperSearchComponent::update(int deltaTime) } } -void ScraperSearchComponent::updateThumbnail() +void GuiScraperSearch::updateThumbnail() { if (mThumbnailReq && mThumbnailReq->status() == HttpReq::REQ_SUCCESS) { // Save thumbnail to mScraperResults cache and set the flag that the @@ -569,7 +569,7 @@ void ScraperSearchComponent::updateThumbnail() } } -void ScraperSearchComponent::openInputScreen(ScraperSearchParams& params) +void GuiScraperSearch::openInputScreen(ScraperSearchParams& params) { auto searchForFunc = [&](const std::string& name) { params.nameOverride = name; @@ -596,7 +596,7 @@ void ScraperSearchComponent::openInputScreen(ScraperSearchParams& params) } } -bool ScraperSearchComponent::saveMetadata( +bool GuiScraperSearch::saveMetadata( const ScraperSearchResult& result, MetaDataList& metadata) { bool mMetadataUpdated = false; @@ -651,7 +651,7 @@ bool ScraperSearchComponent::saveMetadata( return mMetadataUpdated; } -std::vector ScraperSearchComponent::getHelpPrompts() +std::vector GuiScraperSearch::getHelpPrompts() { std::vector prompts = mGrid.getHelpPrompts(); if (getSelectedIndex() != -1) @@ -660,12 +660,12 @@ std::vector ScraperSearchComponent::getHelpPrompts() return prompts; } -void ScraperSearchComponent::onFocusGained() +void GuiScraperSearch::onFocusGained() { mGrid.onFocusGained(); } -void ScraperSearchComponent::onFocusLost() +void GuiScraperSearch::onFocusLost() { mGrid.onFocusLost(); } diff --git a/es-app/src/components/ScraperSearchComponent.h b/es-app/src/guis/GuiScraperSearch.h similarity index 90% rename from es-app/src/components/ScraperSearchComponent.h rename to es-app/src/guis/GuiScraperSearch.h index 914e57220..6045c866e 100644 --- a/es-app/src/components/ScraperSearchComponent.h +++ b/es-app/src/guis/GuiScraperSearch.h @@ -1,7 +1,7 @@ // -// ScraperSearchComponent.h +// GuiScraperSearch.h // -// User interface component for the scraper where the user is able to see an overview +// User interface for the scraper where the user is able to see an overview // of the game being scraped and an option to override the game search string. // Used by both single-game scraping from the GuiMetaDataEd menu as well as // to resolve scraping conflicts when run from GuiScraperMenu. @@ -12,8 +12,8 @@ // #pragma once -#ifndef ES_APP_COMPONENTS_SCRAPER_SEARCH_COMPONENT_H -#define ES_APP_COMPONENTS_SCRAPER_SEARCH_COMPONENT_H +#ifndef ES_APP_GUIS_GUI_SCRAPER_SEARCH_H +#define ES_APP_GUIS_GUI_SCRAPER_SEARCH_H #include "components/BusyComponent.h" #include "components/ComponentGrid.h" @@ -27,7 +27,7 @@ class RatingComponent; class ScrollableContainer; class TextComponent; -class ScraperSearchComponent : public GuiComponent +class GuiScraperSearch : public GuiComponent { public: enum SearchType { @@ -36,7 +36,7 @@ public: NEVER_AUTO_ACCEPT }; - ScraperSearchComponent(Window* window, SearchType searchType = NEVER_AUTO_ACCEPT); + GuiScraperSearch(Window* window, SearchType searchType = NEVER_AUTO_ACCEPT); void search(const ScraperSearchParams& params); void openInputScreen(ScraperSearchParams& from); @@ -125,4 +125,4 @@ private: BusyComponent mBusyAnim; }; -#endif // ES_APP_COMPONENTS_SCRAPER_SEARCH_COMPONENT_H +#endif // ES_APP_GUIS_GUI_SCRAPER_SEARCH_H diff --git a/es-app/src/scrapers/Scraper.cpp b/es-app/src/scrapers/Scraper.cpp index 7e88a22f9..9bb2cba15 100644 --- a/es-app/src/scrapers/Scraper.cpp +++ b/es-app/src/scrapers/Scraper.cpp @@ -2,7 +2,7 @@ // Scraper.cpp // // Main scraper logic. -// Called from ScraperSearchComponent. +// Called from GuiScraperSearch. // Calls either GamesDBJSONScraper or ScreenScraper. // diff --git a/es-app/src/scrapers/Scraper.h b/es-app/src/scrapers/Scraper.h index afdff86b4..82c9ef7e6 100644 --- a/es-app/src/scrapers/Scraper.h +++ b/es-app/src/scrapers/Scraper.h @@ -2,7 +2,7 @@ // Scraper.h // // Main scraper logic. -// Called from ScraperSearchComponent. +// Called from GuiScraperSearch. // Calls either GamesDBJSONScraper or ScreenScraper. // diff --git a/es-core/CMakeLists.txt b/es-core/CMakeLists.txt index 6feb9bd5e..bd91a83ae 100644 --- a/es-core/CMakeLists.txt +++ b/es-core/CMakeLists.txt @@ -40,11 +40,13 @@ set(CORE_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/components/MenuComponent.h ${CMAKE_CURRENT_SOURCE_DIR}/src/components/NinePatchComponent.h ${CMAKE_CURRENT_SOURCE_DIR}/src/components/OptionListComponent.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/RatingComponent.h ${CMAKE_CURRENT_SOURCE_DIR}/src/components/ScrollableContainer.h ${CMAKE_CURRENT_SOURCE_DIR}/src/components/SliderComponent.h ${CMAKE_CURRENT_SOURCE_DIR}/src/components/SwitchComponent.h ${CMAKE_CURRENT_SOURCE_DIR}/src/components/TextComponent.h ${CMAKE_CURRENT_SOURCE_DIR}/src/components/TextEditComponent.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/TextListComponent.h ${CMAKE_CURRENT_SOURCE_DIR}/src/components/VideoComponent.h ${CMAKE_CURRENT_SOURCE_DIR}/src/components/VideoPlayerComponent.h ${CMAKE_CURRENT_SOURCE_DIR}/src/components/VideoVlcComponent.h @@ -115,6 +117,7 @@ set(CORE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/components/ImageComponent.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/components/MenuComponent.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/components/NinePatchComponent.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/RatingComponent.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/components/ScrollableContainer.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/components/SliderComponent.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/components/SwitchComponent.cpp diff --git a/es-core/src/AsyncHandle.h b/es-core/src/AsyncHandle.h index 8042d3ede..93d72a1e9 100644 --- a/es-core/src/AsyncHandle.h +++ b/es-core/src/AsyncHandle.h @@ -1,7 +1,7 @@ // // AsyncHandle.h // -// Asynchronous operations used by ScraperSearchComponent and Scraper. +// Asynchronous operations used by GuiScraperSearch and Scraper. // #pragma once diff --git a/es-app/src/components/RatingComponent.cpp b/es-core/src/components/RatingComponent.cpp similarity index 100% rename from es-app/src/components/RatingComponent.cpp rename to es-core/src/components/RatingComponent.cpp diff --git a/es-app/src/components/RatingComponent.h b/es-core/src/components/RatingComponent.h similarity index 100% rename from es-app/src/components/RatingComponent.h rename to es-core/src/components/RatingComponent.h diff --git a/es-app/src/components/TextListComponent.h b/es-core/src/components/TextListComponent.h similarity index 100% rename from es-app/src/components/TextListComponent.h rename to es-core/src/components/TextListComponent.h