mirror of
				https://github.com/RetroDECK/ES-DE.git
				synced 2025-04-10 19:15:13 +00:00 
			
		
		
		
	Moved all components into es-core and renamed ScraperSearchComponent to GuiScraperSearch as it's a GUI and not a component.
This commit is contained in:
		
							parent
							
								
									7f39afe3da
								
							
						
					
					
						commit
						b7feedd287
					
				| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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<ScraperSearchComponent>(window,
 | 
			
		||||
			ScraperSearchComponent::NEVER_AUTO_ACCEPT);
 | 
			
		||||
	// GuiScraperSearch.
 | 
			
		||||
	mSearch = std::make_shared<GuiScraperSearch>(window,
 | 
			
		||||
			GuiScraperSearch::NEVER_AUTO_ACCEPT);
 | 
			
		||||
	mGrid.setEntry(mSearch, Vector2i(0, 5), true);
 | 
			
		||||
 | 
			
		||||
	// Buttons
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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<TextComponent> mGameName;
 | 
			
		||||
	std::shared_ptr<TextComponent> mSystemName;
 | 
			
		||||
	std::shared_ptr<ScraperSearchComponent> mSearch;
 | 
			
		||||
	std::shared_ptr<GuiScraperSearch> mSearch;
 | 
			
		||||
	std::shared_ptr<ComponentGrid> mButtonGrid;
 | 
			
		||||
 | 
			
		||||
	ScraperSearchParams mSearchParams;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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++) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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<ScraperSearchComponent>(mWindow,
 | 
			
		||||
			approveResults ? ScraperSearchComponent::ALWAYS_ACCEPT_MATCHING_CRC
 | 
			
		||||
			: ScraperSearchComponent::ALWAYS_ACCEPT_FIRST_RESULT);
 | 
			
		||||
	mSearchComp = std::make_shared<GuiScraperSearch>(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<ButtonComponent> > 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);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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<TextComponent> mTitle;
 | 
			
		||||
	std::shared_ptr<TextComponent> mSystem;
 | 
			
		||||
	std::shared_ptr<TextComponent> mSubtitle;
 | 
			
		||||
	std::shared_ptr<ScraperSearchComponent> mSearchComp;
 | 
			
		||||
	std::shared_ptr<GuiScraperSearch> mSearchComp;
 | 
			
		||||
	std::shared_ptr<ComponentGrid> mButtonGrid;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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<ScraperSearchResult>& results)
 | 
			
		||||
void GuiScraperSearch::onSearchDone(const std::vector<ScraperSearchResult>& results)
 | 
			
		||||
{
 | 
			
		||||
	mResultList->clear();
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -322,16 +322,16 @@ void ScraperSearchComponent::onSearchDone(const std::vector<ScraperSearchResult>
 | 
			
		|||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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<HelpPrompt> ScraperSearchComponent::getHelpPrompts()
 | 
			
		||||
std::vector<HelpPrompt> GuiScraperSearch::getHelpPrompts()
 | 
			
		||||
{
 | 
			
		||||
	std::vector<HelpPrompt> prompts = mGrid.getHelpPrompts();
 | 
			
		||||
	if (getSelectedIndex() != -1)
 | 
			
		||||
| 
						 | 
				
			
			@ -660,12 +660,12 @@ std::vector<HelpPrompt> ScraperSearchComponent::getHelpPrompts()
 | 
			
		|||
	return prompts;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void ScraperSearchComponent::onFocusGained()
 | 
			
		||||
void GuiScraperSearch::onFocusGained()
 | 
			
		||||
{
 | 
			
		||||
	mGrid.onFocusGained();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void ScraperSearchComponent::onFocusLost()
 | 
			
		||||
void GuiScraperSearch::onFocusLost()
 | 
			
		||||
{
 | 
			
		||||
	mGrid.onFocusLost();
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			@ -2,7 +2,7 @@
 | 
			
		|||
//	Scraper.cpp
 | 
			
		||||
//
 | 
			
		||||
//	Main scraper logic.
 | 
			
		||||
//	Called from ScraperSearchComponent.
 | 
			
		||||
//	Called from GuiScraperSearch.
 | 
			
		||||
//	Calls either GamesDBJSONScraper or ScreenScraper.
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,7 +2,7 @@
 | 
			
		|||
//	Scraper.h
 | 
			
		||||
//
 | 
			
		||||
//	Main scraper logic.
 | 
			
		||||
//	Called from ScraperSearchComponent.
 | 
			
		||||
//	Called from GuiScraperSearch.
 | 
			
		||||
//	Calls either GamesDBJSONScraper or ScreenScraper.
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
//
 | 
			
		||||
//	AsyncHandle.h
 | 
			
		||||
//
 | 
			
		||||
//	Asynchronous operations used by ScraperSearchComponent and Scraper.
 | 
			
		||||
//	Asynchronous operations used by GuiScraperSearch and Scraper.
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
#pragma once
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue