Moved the ScreenScraper account toggle to the bottom of the scraper account screen.

This commit is contained in:
Leon Styhre 2021-12-06 20:21:32 +01:00
parent 4227a609a2
commit 5019d8c065
2 changed files with 15 additions and 15 deletions

View file

@ -168,20 +168,6 @@ void GuiScraperMenu::openAccountOptions()
{ {
auto s = new GuiSettings(mWindow, "ACCOUNT SETTINGS"); auto s = new GuiSettings(mWindow, "ACCOUNT SETTINGS");
// Whether to use the ScreenScraper account when scraping.
auto scraper_use_account_screenscraper = std::make_shared<SwitchComponent>(mWindow);
scraper_use_account_screenscraper->setState(
Settings::getInstance()->getBool("ScraperUseAccountScreenScraper"));
s->addWithLabel("USE THIS ACCOUNT FOR SCREENSCRAPER", scraper_use_account_screenscraper);
s->addSaveFunc([scraper_use_account_screenscraper, s] {
if (scraper_use_account_screenscraper->getState() !=
Settings::getInstance()->getBool("ScraperUseAccountScreenScraper")) {
Settings::getInstance()->setBool("ScraperUseAccountScreenScraper",
scraper_use_account_screenscraper->getState());
s->setNeedsSaving();
}
});
// ScreenScraper username. // ScreenScraper username.
auto scraper_username_screenscraper = std::make_shared<TextComponent>( auto scraper_username_screenscraper = std::make_shared<TextComponent>(
mWindow, "", Font::get(FONT_SIZE_MEDIUM), 0x777777FF, ALIGN_RIGHT); mWindow, "", Font::get(FONT_SIZE_MEDIUM), 0x777777FF, ALIGN_RIGHT);
@ -216,6 +202,20 @@ void GuiScraperMenu::openAccountOptions()
} }
}); });
// Whether to use the ScreenScraper account when scraping.
auto scraper_use_account_screenscraper = std::make_shared<SwitchComponent>(mWindow);
scraper_use_account_screenscraper->setState(
Settings::getInstance()->getBool("ScraperUseAccountScreenScraper"));
s->addWithLabel("USE THIS ACCOUNT FOR SCREENSCRAPER", scraper_use_account_screenscraper);
s->addSaveFunc([scraper_use_account_screenscraper, s] {
if (scraper_use_account_screenscraper->getState() !=
Settings::getInstance()->getBool("ScraperUseAccountScreenScraper")) {
Settings::getInstance()->setBool("ScraperUseAccountScreenScraper",
scraper_use_account_screenscraper->getState());
s->setNeedsSaving();
}
});
mWindow->pushGui(s); mWindow->pushGui(s);
} }

View file

@ -85,9 +85,9 @@ void Settings::setDefaults()
// Scraper. // Scraper.
mStringMap["Scraper"] = {"screenscraper", "screenscraper"}; mStringMap["Scraper"] = {"screenscraper", "screenscraper"};
mBoolMap["ScraperUseAccountScreenScraper"] = {true, true};
mStringMap["ScraperUsernameScreenScraper"] = {"", ""}; mStringMap["ScraperUsernameScreenScraper"] = {"", ""};
mStringMap["ScraperPasswordScreenScraper"] = {"", ""}; mStringMap["ScraperPasswordScreenScraper"] = {"", ""};
mBoolMap["ScraperUseAccountScreenScraper"] = {true, true};
mBoolMap["ScrapeGameNames"] = {true, true}; mBoolMap["ScrapeGameNames"] = {true, true};
mBoolMap["ScrapeRatings"] = {true, true}; mBoolMap["ScrapeRatings"] = {true, true};