Formatting some code that accidentally excluded from clang-format.

This commit is contained in:
Leon Styhre 2021-07-11 13:31:43 +02:00
parent 41f4cce5d6
commit 738f8854cb

View file

@ -596,8 +596,9 @@ void GuiScraperMenu::openOtherOptions()
if (Settings::getInstance()->getString("Scraper") == "thegamesdb") {
scraper_language->setEnabled(false);
scraper_language->setOpacity(DISABLED_OPACITY);
scraper_language->getParent()->getChild(scraper_language->
getChildIndex() - 1)->setOpacity(DISABLED_OPACITY);
scraper_language->getParent()
->getChild(scraper_language->getChildIndex() - 1)
->setOpacity(DISABLED_OPACITY);
}
// Overwrite files and data.
@ -615,8 +616,8 @@ void GuiScraperMenu::openOtherOptions()
// Halt scraping on invalid media files.
auto scraper_halt_on_invalid_media = std::make_shared<SwitchComponent>(mWindow);
scraper_halt_on_invalid_media->
setState(Settings::getInstance()->getBool("ScraperHaltOnInvalidMedia"));
scraper_halt_on_invalid_media->setState(
Settings::getInstance()->getBool("ScraperHaltOnInvalidMedia"));
s->addWithLabel("HALT ON INVALID MEDIA FILES", scraper_halt_on_invalid_media);
s->addSaveFunc([scraper_halt_on_invalid_media, s] {
if (scraper_halt_on_invalid_media->getState() !=
@ -629,8 +630,8 @@ void GuiScraperMenu::openOtherOptions()
// Search using metadata names.
auto scraper_search_metadata_name = std::make_shared<SwitchComponent>(mWindow);
scraper_search_metadata_name->
setState(Settings::getInstance()->getBool("ScraperSearchMetadataName"));
scraper_search_metadata_name->setState(
Settings::getInstance()->getBool("ScraperSearchMetadataName"));
s->addWithLabel("SEARCH USING METADATA NAMES", scraper_search_metadata_name);
s->addSaveFunc([scraper_search_metadata_name, s] {
if (scraper_search_metadata_name->getState() !=
@ -670,11 +671,11 @@ void GuiScraperMenu::openOtherOptions()
if (!Settings::getInstance()->getBool("ScraperInteractive")) {
scraper_semiautomatic->setEnabled(false);
scraper_semiautomatic->setOpacity(DISABLED_OPACITY);
scraper_semiautomatic->getParent()->getChild(scraper_semiautomatic->
getChildIndex() - 1)->setOpacity(DISABLED_OPACITY);
scraper_semiautomatic->getParent()
->getChild(scraper_semiautomatic->getChildIndex() - 1)
->setOpacity(DISABLED_OPACITY);
}
// Respect the per-file multi-scraper exclusion flag.
auto scraper_respect_exclusions = std::make_shared<SwitchComponent>(mWindow);
scraper_respect_exclusions->setState(
@ -707,14 +708,14 @@ void GuiScraperMenu::openOtherOptions()
if (!Settings::getInstance()->getBool("ScraperRespectExclusions")) {
scraper_exclude_recursively->setEnabled(false);
scraper_exclude_recursively->setOpacity(DISABLED_OPACITY);
scraper_exclude_recursively->getParent()->getChild(scraper_exclude_recursively->
getChildIndex() - 1)->setOpacity(DISABLED_OPACITY);
scraper_exclude_recursively->getParent()
->getChild(scraper_exclude_recursively->getChildIndex() - 1)
->setOpacity(DISABLED_OPACITY);
}
// Include actual folders when scraping.
auto scraper_include_folders = std::make_shared<SwitchComponent>(mWindow);
scraper_include_folders->setState(
Settings::getInstance()->getBool("ScraperIncludeFolders"));
scraper_include_folders->setState(Settings::getInstance()->getBool("ScraperIncludeFolders"));
s->addWithLabel("SCRAPE ACTUAL FOLDERS", scraper_include_folders);
s->addSaveFunc([scraper_include_folders, s] {
if (scraper_include_folders->getState() !=
@ -744,14 +745,16 @@ void GuiScraperMenu::openOtherOptions()
if (scraper_semiautomatic->getEnabled()) {
scraper_semiautomatic->setEnabled(false);
scraper_semiautomatic->setOpacity(DISABLED_OPACITY);
scraper_semiautomatic->getParent()->getChild(scraper_semiautomatic->
getChildIndex() - 1)->setOpacity(DISABLED_OPACITY);
scraper_semiautomatic->getParent()
->getChild(scraper_semiautomatic->getChildIndex() - 1)
->setOpacity(DISABLED_OPACITY);
}
else {
scraper_semiautomatic->setEnabled(true);
scraper_semiautomatic->setOpacity(255);
scraper_semiautomatic->getParent()->getChild(scraper_semiautomatic->
getChildIndex() - 1)->setOpacity(255);
scraper_semiautomatic->getParent()
->getChild(scraper_semiautomatic->getChildIndex() - 1)
->setOpacity(255);
}
};
@ -759,14 +762,16 @@ void GuiScraperMenu::openOtherOptions()
if (scraper_exclude_recursively->getEnabled()) {
scraper_exclude_recursively->setEnabled(false);
scraper_exclude_recursively->setOpacity(DISABLED_OPACITY);
scraper_exclude_recursively->getParent()->getChild(scraper_exclude_recursively->
getChildIndex() - 1)->setOpacity(DISABLED_OPACITY);
scraper_exclude_recursively->getParent()
->getChild(scraper_exclude_recursively->getChildIndex() - 1)
->setOpacity(DISABLED_OPACITY);
}
else {
scraper_exclude_recursively->setEnabled(true);
scraper_exclude_recursively->setOpacity(255);
scraper_exclude_recursively->getParent()->getChild(scraper_exclude_recursively->
getChildIndex() - 1)->setOpacity(255);
scraper_exclude_recursively->getParent()
->getChild(scraper_exclude_recursively->getChildIndex() - 1)
->setOpacity(255);
}
};
@ -799,9 +804,8 @@ void GuiScraperMenu::pressedStart()
"Continue anyway?";
}
mWindow->pushGui(new GuiMsgBox(mWindow, getHelpStyle(),
Utils::String::toUpper(warningString),
"YES", std::bind(&GuiScraperMenu::start, this),
"NO", nullptr));
Utils::String::toUpper(warningString), "YES",
std::bind(&GuiScraperMenu::start, this), "NO", nullptr));
return;
}
}
@ -811,8 +815,8 @@ void GuiScraperMenu::pressedStart()
void GuiScraperMenu::start()
{
if (mSystems->getSelectedObjects().empty()) {
mWindow->pushGui(new GuiMsgBox(mWindow, getHelpStyle(),
"PLEASE SELECT AT LEAST ONE SYSTEM TO SCRAPE"));
mWindow->pushGui(
new GuiMsgBox(mWindow, getHelpStyle(), "PLEASE SELECT AT LEAST ONE SYSTEM TO SCRAPE"));
return;
}
@ -834,8 +838,7 @@ void GuiScraperMenu::start()
contentToScrape = true;
break;
}
if (scraperService == "screenscraper" &&
Settings::getInstance()->getBool("ScrapeVideos")) {
if (scraperService == "screenscraper" && Settings::getInstance()->getBool("ScrapeVideos")) {
contentToScrape = true;
break;
}
@ -868,20 +871,20 @@ void GuiScraperMenu::start()
getSearches(mSystems->getSelectedObjects(), mFilters->getSelected());
if (searches.empty()) {
mWindow->pushGui(new GuiMsgBox(mWindow, getHelpStyle(),
"ALL GAMES WERE FILTERED, NOTHING TO SCRAPE"));
mWindow->pushGui(
new GuiMsgBox(mWindow, getHelpStyle(), "ALL GAMES WERE FILTERED, NOTHING TO SCRAPE"));
}
else {
GuiScraperMulti* gsm = new GuiScraperMulti(mWindow, searches,
Settings::getInstance()->getBool("ScraperInteractive"));
GuiScraperMulti* gsm = new GuiScraperMulti(
mWindow, searches, Settings::getInstance()->getBool("ScraperInteractive"));
mWindow->pushGui(gsm);
mMenu.setCursorToList();
mMenu.setCursorToFirstListEntry();
}
}
std::queue<ScraperSearchParams> GuiScraperMenu::getSearches(
std::vector<SystemData*> systems, GameFilterFunc selector)
std::queue<ScraperSearchParams> GuiScraperMenu::getSearches(std::vector<SystemData*> systems,
GameFilterFunc selector)
{
std::queue<ScraperSearchParams> queue;
for (auto sys = systems.cbegin(); sys != systems.cend(); sys++) {
@ -902,8 +905,10 @@ std::queue<ScraperSearchParams> GuiScraperMenu::getSearches(
return queue;
}
void GuiScraperMenu::addEntry(const std::string& name, unsigned int color,
bool add_arrow, const std::function<void()>& func)
void GuiScraperMenu::addEntry(const std::string& name,
unsigned int color,
bool add_arrow,
const std::function<void()>& func)
{
std::shared_ptr<Font> font = Font::get(FONT_SIZE_MEDIUM);