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)),
mSearchQueue(searches)
{
assert(mSearchQueue.size());
addChild(&mBackground);
addChild(&mGrid);

View file

@ -57,9 +57,15 @@ void GuiScraperStart::start()
{
std::queue<ScraperSearchParams> searches = getSearches(mSystems->getSelectedObjects(), mFilters->getSelected());
GuiScraperMulti* gsm = new GuiScraperMulti(mWindow, searches, mApproveResults->getState());
mWindow->pushGui(gsm);
delete this;
if(searches.empty())
{
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)