From 2abc4f2f3a934c89b5d09873393c3bb7d5d2823e Mon Sep 17 00:00:00 2001 From: Aloshi Date: Sun, 27 Apr 2014 21:47:06 -0500 Subject: [PATCH] Add number of games skipped to scraper result dialog. After pressing the "SKIP" button, the cursor is now reset to the result list. --- src/guis/GuiScraperMulti.cpp | 11 +++++++++-- src/guis/GuiScraperMulti.h | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/guis/GuiScraperMulti.cpp b/src/guis/GuiScraperMulti.cpp index 55eb246d8..949940539 100644 --- a/src/guis/GuiScraperMulti.cpp +++ b/src/guis/GuiScraperMulti.cpp @@ -22,6 +22,7 @@ GuiScraperMulti::GuiScraperMulti(Window* window, const std::queue(mWindow, "SCRAPING IN PROGRESS", Font::get(FONT_SIZE_LARGE), 0x555555FF, TextComponent::ALIGN_CENTER); @@ -49,7 +50,10 @@ GuiScraperMulti::GuiScraperMulti(Window* window, const std::queue(mWindow, "SKIP", "skip", std::bind(&GuiScraperMulti::skip, this))); + buttons.push_back(std::make_shared(mWindow, "SKIP", "skip", [&] { + skip(); + mGrid.resetCursor(); + })); } buttons.push_back(std::make_shared(mWindow, "STOP", "stop (progress saved)", std::bind(&GuiScraperMulti::finish, this))); @@ -110,6 +114,7 @@ void GuiScraperMulti::skip() { mSearchQueue.pop(); mCurrentGame++; + mTotalSkipped++; doNextSearch(); } @@ -119,7 +124,9 @@ void GuiScraperMulti::finish() if(mTotalSuccessful == 0) ss << "NO GAMES SUCCESSFULLY SCRAPED."; else - ss << mTotalSuccessful << " GAME" << ((mTotalSuccessful > 1) ? "S" : "") << "SUCCESSFULLY SCRAPED!"; + ss << mTotalSuccessful << " GAME" << ((mTotalSuccessful > 1) ? "S" : "") << " SUCCESSFULLY SCRAPED!"; + if(mTotalSkipped > 0) + ss << "\n" << mTotalSkipped << " GAME" << ((mTotalSkipped > 1) ? "S" : "") << " SKIPPED."; mWindow->pushGui(new GuiMsgBox(mWindow, ss.str(), "OK", [&] { delete this; })); diff --git a/src/guis/GuiScraperMulti.h b/src/guis/GuiScraperMulti.h index 526c75afa..33b04b2b9 100644 --- a/src/guis/GuiScraperMulti.h +++ b/src/guis/GuiScraperMulti.h @@ -28,6 +28,7 @@ private: unsigned int mTotalGames; unsigned int mCurrentGame; unsigned int mTotalSuccessful; + unsigned int mTotalSkipped; std::queue mSearchQueue; NinePatchComponent mBackground;