From 1122476de653fb6f59e11418bdc5bf1b6c9999ae Mon Sep 17 00:00:00 2001 From: Aloshi Date: Mon, 26 May 2014 20:17:17 -0500 Subject: [PATCH] Added "ignore" plaform. If is set to "ignore", the system will not show up in the "SCRAPE NOW" systems list, and the "SCRAPE" button will be missing in the "EDIT METADATA" screen. Useful for single-game systems, systems made up of shortcuts, and pre-configured systems in distributions. --- src/PlatformId.cpp | 3 ++- src/PlatformId.h | 3 ++- src/guis/GuiMetaDataEd.cpp | 5 ++++- src/guis/GuiScraperStart.cpp | 5 ++++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/PlatformId.cpp b/src/PlatformId.cpp index 124a5eefb..2f7b4ac9b 100644 --- a/src/PlatformId.cpp +++ b/src/PlatformId.cpp @@ -53,7 +53,8 @@ namespace PlatformIds "pcengine", // = 45, "zxspectrum", // = 46, - "invalid" // = 47 + "ignore", // = 47 // do not allow scraping for this system + "invalid" // = 48 }; PlatformId getPlatformId(const char* str) diff --git a/src/PlatformId.h b/src/PlatformId.h index 45659def1..4c5e1d845 100644 --- a/src/PlatformId.h +++ b/src/PlatformId.h @@ -55,7 +55,8 @@ namespace PlatformIds TURBOGRAFX_16 = 45, ZX_SPECTRUM = 46, - PLATFORM_COUNT = 47 + PLATFORM_IGNORE = 47, // do not allow scraping for this system + PLATFORM_COUNT = 48 }; PlatformId getPlatformId(const char* str); diff --git a/src/guis/GuiMetaDataEd.cpp b/src/guis/GuiMetaDataEd.cpp index 5149bee96..6c6c2a58d 100644 --- a/src/guis/GuiMetaDataEd.cpp +++ b/src/guis/GuiMetaDataEd.cpp @@ -128,7 +128,10 @@ GuiMetaDataEd::GuiMetaDataEd(Window* window, MetaDataList* md, const std::vector } std::vector< std::shared_ptr > buttons; - buttons.push_back(std::make_shared(mWindow, "SCRAPE", "scrape", std::bind(&GuiMetaDataEd::fetch, this))); + + if(scraperParams.system->getPlatformId() != PlatformIds::PLATFORM_IGNORE) + buttons.push_back(std::make_shared(mWindow, "SCRAPE", "scrape", std::bind(&GuiMetaDataEd::fetch, this))); + buttons.push_back(std::make_shared(mWindow, "SAVE", "save", [&] { save(); delete this; })); buttons.push_back(std::make_shared(mWindow, "CANCEL", "cancel", [&] { delete this; })); diff --git a/src/guis/GuiScraperStart.cpp b/src/guis/GuiScraperStart.cpp index 9b382d2a9..188b56785 100644 --- a/src/guis/GuiScraperStart.cpp +++ b/src/guis/GuiScraperStart.cpp @@ -23,7 +23,10 @@ GuiScraperStart::GuiScraperStart(Window* window) : GuiComponent(window), //add systems (all with a platformid specified selected) mSystems = std::make_shared< OptionListComponent >(mWindow, "SCRAPE THESE SYSTEMS", true); for(auto it = SystemData::sSystemVector.begin(); it != SystemData::sSystemVector.end(); it++) - mSystems->add((*it)->getFullName(), *it, (*it)->getPlatformId() != PlatformIds::PLATFORM_UNKNOWN); + { + if((*it)->getPlatformId() != PlatformIds::PLATFORM_IGNORE) + mSystems->add((*it)->getFullName(), *it, (*it)->getPlatformId() != PlatformIds::PLATFORM_UNKNOWN); + } mMenu.addWithLabel("Systems", mSystems); mApproveResults = std::make_shared(mWindow);