Give an error message if a scrape is started with no games selected.

This commit is contained in:
Aloshi 2014-03-28 20:08:59 -05:00
parent b3dcdb52eb
commit 391e299f79
2 changed files with 11 additions and 3 deletions

View file

@ -14,6 +14,8 @@ GuiScraperMulti::GuiScraperMulti(Window* window, const std::queue<ScraperSearchP
GuiComponent(window), mBackground(window, ":/frame.png"), mGrid(window, Vector2i(1, 5)), GuiComponent(window), mBackground(window, ":/frame.png"), mGrid(window, Vector2i(1, 5)),
mSearchQueue(searches) mSearchQueue(searches)
{ {
assert(mSearchQueue.size());
addChild(&mBackground); addChild(&mBackground);
addChild(&mGrid); addChild(&mGrid);

View file

@ -57,9 +57,15 @@ void GuiScraperStart::start()
{ {
std::queue<ScraperSearchParams> searches = getSearches(mSystems->getSelectedObjects(), mFilters->getSelected()); std::queue<ScraperSearchParams> searches = getSearches(mSystems->getSelectedObjects(), mFilters->getSelected());
GuiScraperMulti* gsm = new GuiScraperMulti(mWindow, searches, mApproveResults->getState()); if(searches.empty())
mWindow->pushGui(gsm); {
delete this; mWindow->pushGui(new GuiMsgBox(mWindow,
"NO GAMES FIT THAT CRITERIA."));
}else{
GuiScraperMulti* gsm = new GuiScraperMulti(mWindow, searches, mApproveResults->getState());
mWindow->pushGui(gsm);
delete this;
}
} }
std::queue<ScraperSearchParams> GuiScraperStart::getSearches(std::vector<SystemData*> systems, GameFilterFunc selector) std::queue<ScraperSearchParams> GuiScraperStart::getSearches(std::vector<SystemData*> systems, GameFilterFunc selector)