mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 06:05:38 +00:00
Renamed CollectionSystemManager to CollectionSystemsManager.
This commit is contained in:
parent
a27c961987
commit
327676d7d7
|
@ -11,7 +11,7 @@ set(ES_HEADERS
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/src/Gamelist.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/FileFilterIndex.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/SystemScreensaver.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/CollectionSystemManager.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/CollectionSystemsManager.h
|
||||
|
||||
# Guis
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMetaDataEd.h
|
||||
|
@ -59,7 +59,7 @@ set(ES_SOURCES
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/src/Gamelist.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/FileFilterIndex.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/SystemScreensaver.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/CollectionSystemManager.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/CollectionSystemsManager.cpp
|
||||
|
||||
# Guis
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMetaDataEd.cpp
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: MIT
|
||||
//
|
||||
// EmulationStation Desktop Edition
|
||||
// CollectionSystemManager.cpp
|
||||
// CollectionSystemsManager.cpp
|
||||
//
|
||||
// Manages collections of the following two types:
|
||||
// 1) Automatically populated (All games, Favorites and Recent/Last Played)
|
||||
|
@ -9,17 +9,17 @@
|
|||
//
|
||||
// The automatic collections are basically virtual systems that have no
|
||||
// gamelist.xml files and that only exist in memory during the program session.
|
||||
// SystemData sets up the basic data structures and CollectionSystemManager
|
||||
// SystemData sets up the basic data structures and CollectionSystemsManager
|
||||
// populates and manages the collections.
|
||||
//
|
||||
// The custom collections have simple data files which are just lists of ROM files.
|
||||
//
|
||||
// In addition to this, CollectionSystemManager also handles some logic for
|
||||
// In addition to this, CollectionSystemsManager also handles some logic for
|
||||
// normal systems such as adding and removing favorite games, including triggering
|
||||
// the required re-sort and refresh of the gamelists.
|
||||
//
|
||||
|
||||
#include "CollectionSystemManager.h"
|
||||
#include "CollectionSystemsManager.h"
|
||||
|
||||
#include "guis/GuiInfoPopup.h"
|
||||
#include "utils/FileSystemUtil.h"
|
||||
|
@ -43,10 +43,10 @@ std::string myCollectionsName = "collections";
|
|||
#define LAST_PLAYED_MAX 50
|
||||
|
||||
// Handles the getting, initialization, deinitialization,
|
||||
// saving and deletion of a CollectionSystemManager instance.
|
||||
CollectionSystemManager* CollectionSystemManager::sInstance = nullptr;
|
||||
// saving and deletion of a CollectionSystemsManager instance.
|
||||
CollectionSystemsManager* CollectionSystemsManager::sInstance = nullptr;
|
||||
|
||||
CollectionSystemManager::CollectionSystemManager(Window* window) : mWindow(window)
|
||||
CollectionSystemsManager::CollectionSystemsManager(Window* window) : mWindow(window)
|
||||
{
|
||||
CollectionSystemDecl systemDecls[] = {
|
||||
// Type Name Long name Theme folder isCustom
|
||||
|
@ -84,7 +84,7 @@ CollectionSystemManager::CollectionSystemManager(Window* window) : mWindow(windo
|
|||
mCustomCollectionsBundle = nullptr;
|
||||
}
|
||||
|
||||
CollectionSystemManager::~CollectionSystemManager()
|
||||
CollectionSystemsManager::~CollectionSystemsManager()
|
||||
{
|
||||
assert(sInstance == this);
|
||||
|
||||
|
@ -112,25 +112,25 @@ CollectionSystemManager::~CollectionSystemManager()
|
|||
sInstance = nullptr;
|
||||
}
|
||||
|
||||
CollectionSystemManager* CollectionSystemManager::get()
|
||||
CollectionSystemsManager* CollectionSystemsManager::get()
|
||||
{
|
||||
assert(sInstance);
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
void CollectionSystemManager::init(Window* window)
|
||||
void CollectionSystemsManager::init(Window* window)
|
||||
{
|
||||
assert(!sInstance);
|
||||
sInstance = new CollectionSystemManager(window);
|
||||
sInstance = new CollectionSystemsManager(window);
|
||||
}
|
||||
|
||||
void CollectionSystemManager::deinit()
|
||||
void CollectionSystemsManager::deinit()
|
||||
{
|
||||
if (sInstance)
|
||||
delete sInstance;
|
||||
}
|
||||
|
||||
void CollectionSystemManager::saveCustomCollection(SystemData* sys)
|
||||
void CollectionSystemsManager::saveCustomCollection(SystemData* sys)
|
||||
{
|
||||
const std::string rompath = FileData::getROMDirectory();
|
||||
std::string name = sys->getName();
|
||||
|
@ -204,7 +204,7 @@ void CollectionSystemManager::saveCustomCollection(SystemData* sys)
|
|||
}
|
||||
}
|
||||
|
||||
void CollectionSystemManager::loadCollectionSystems()
|
||||
void CollectionSystemsManager::loadCollectionSystems()
|
||||
{
|
||||
initAutoCollectionSystems();
|
||||
CollectionSystemDecl decl = mCollectionSystemDeclsIndex[myCollectionsName];
|
||||
|
@ -222,7 +222,7 @@ void CollectionSystemManager::loadCollectionSystems()
|
|||
}
|
||||
}
|
||||
|
||||
void CollectionSystemManager::loadEnabledListFromSettings()
|
||||
void CollectionSystemsManager::loadEnabledListFromSettings()
|
||||
{
|
||||
// We parse the auto collection settings list.
|
||||
std::vector<std::string> autoSelected = Utils::String::commaStringToVector(
|
||||
|
@ -255,7 +255,7 @@ void CollectionSystemManager::loadEnabledListFromSettings()
|
|||
}
|
||||
}
|
||||
|
||||
void CollectionSystemManager::updateSystemsList()
|
||||
void CollectionSystemsManager::updateSystemsList()
|
||||
{
|
||||
// Remove all collection systems.
|
||||
removeCollectionsFromDisplayedSystems();
|
||||
|
@ -289,7 +289,7 @@ void CollectionSystemManager::updateSystemsList()
|
|||
}
|
||||
}
|
||||
|
||||
void CollectionSystemManager::refreshCollectionSystems(FileData* file)
|
||||
void CollectionSystemsManager::refreshCollectionSystems(FileData* file)
|
||||
{
|
||||
if (!file->getSystem()->isGameSystem() || file->getType() != GAME)
|
||||
return;
|
||||
|
@ -321,7 +321,7 @@ void CollectionSystemManager::refreshCollectionSystems(FileData* file)
|
|||
}
|
||||
}
|
||||
|
||||
void CollectionSystemManager::updateCollectionSystem(FileData* file, CollectionSystemData sysData)
|
||||
void CollectionSystemsManager::updateCollectionSystem(FileData* file, CollectionSystemData sysData)
|
||||
{
|
||||
if (sysData.isPopulated) {
|
||||
// Skip all custom collections where the game does not exist.
|
||||
|
@ -455,7 +455,7 @@ void CollectionSystemManager::updateCollectionSystem(FileData* file, CollectionS
|
|||
}
|
||||
}
|
||||
|
||||
void CollectionSystemManager::deleteCollectionFiles(FileData* file)
|
||||
void CollectionSystemsManager::deleteCollectionFiles(FileData* file)
|
||||
{
|
||||
// Collection files use the full path as key, to avoid clashes.
|
||||
std::string key = file->getFullPath();
|
||||
|
@ -485,7 +485,7 @@ void CollectionSystemManager::deleteCollectionFiles(FileData* file)
|
|||
}
|
||||
}
|
||||
|
||||
bool CollectionSystemManager::isThemeGenericCollectionCompatible(bool genericCustomCollections)
|
||||
bool CollectionSystemsManager::isThemeGenericCollectionCompatible(bool genericCustomCollections)
|
||||
{
|
||||
std::vector<std::string> cfgSys = getCollectionThemeFolders(genericCustomCollections);
|
||||
for (auto sysIt = cfgSys.cbegin(); sysIt != cfgSys.cend(); sysIt++) {
|
||||
|
@ -495,7 +495,7 @@ bool CollectionSystemManager::isThemeGenericCollectionCompatible(bool genericCus
|
|||
return true;
|
||||
}
|
||||
|
||||
bool CollectionSystemManager::isThemeCustomCollectionCompatible(
|
||||
bool CollectionSystemsManager::isThemeCustomCollectionCompatible(
|
||||
std::vector<std::string> stringVector)
|
||||
{
|
||||
if (isThemeGenericCollectionCompatible(true))
|
||||
|
@ -517,7 +517,7 @@ bool CollectionSystemManager::isThemeCustomCollectionCompatible(
|
|||
return true;
|
||||
}
|
||||
|
||||
std::string CollectionSystemManager::getValidNewCollectionName(std::string inName, int index)
|
||||
std::string CollectionSystemsManager::getValidNewCollectionName(std::string inName, int index)
|
||||
{
|
||||
std::string name = inName;
|
||||
|
||||
|
@ -570,7 +570,7 @@ std::string CollectionSystemManager::getValidNewCollectionName(std::string inNam
|
|||
return name;
|
||||
}
|
||||
|
||||
void CollectionSystemManager::setEditMode(std::string collectionName)
|
||||
void CollectionSystemsManager::setEditMode(std::string collectionName)
|
||||
{
|
||||
if (mCustomCollectionSystemsData.find(collectionName) == mCustomCollectionSystemsData.cend()) {
|
||||
LOG(LogError) << "Tried to edit a non-existing collection: " << collectionName;
|
||||
|
@ -593,7 +593,7 @@ void CollectionSystemManager::setEditMode(std::string collectionName)
|
|||
mWindow->setInfoPopup(s);
|
||||
}
|
||||
|
||||
void CollectionSystemManager::exitEditMode()
|
||||
void CollectionSystemsManager::exitEditMode()
|
||||
{
|
||||
GuiInfoPopup* s = new GuiInfoPopup(mWindow, "FINISHED EDITING THE '" +
|
||||
Utils::String::toUpper(mEditingCollection) + "' COLLECTION", 4000);
|
||||
|
@ -605,7 +605,7 @@ void CollectionSystemManager::exitEditMode()
|
|||
mEditingCollectionSystemData->system->onMetaDataSavePoint();
|
||||
}
|
||||
|
||||
bool CollectionSystemManager::inCustomCollection(
|
||||
bool CollectionSystemsManager::inCustomCollection(
|
||||
const std::string& collectionName, FileData* gameFile)
|
||||
{
|
||||
auto collectionEntry = mCustomCollectionSystemsData.find(collectionName);
|
||||
|
@ -619,7 +619,7 @@ bool CollectionSystemManager::inCustomCollection(
|
|||
return false;
|
||||
}
|
||||
|
||||
bool CollectionSystemManager::toggleGameInCollection(FileData* file)
|
||||
bool CollectionSystemsManager::toggleGameInCollection(FileData* file)
|
||||
{
|
||||
if (file->getType() == GAME) {
|
||||
GuiInfoPopup* s;
|
||||
|
@ -704,7 +704,7 @@ bool CollectionSystemManager::toggleGameInCollection(FileData* file)
|
|||
return false;
|
||||
}
|
||||
|
||||
SystemData* CollectionSystemManager::getSystemToView(SystemData* sys)
|
||||
SystemData* CollectionSystemsManager::getSystemToView(SystemData* sys)
|
||||
{
|
||||
SystemData* systemToView = sys;
|
||||
FileData* rootFolder = sys->getRootFolder();
|
||||
|
@ -721,7 +721,7 @@ SystemData* CollectionSystemManager::getSystemToView(SystemData* sys)
|
|||
return systemToView;
|
||||
}
|
||||
|
||||
FileData* CollectionSystemManager::updateCollectionFolderMetadata(SystemData* sys)
|
||||
FileData* CollectionSystemsManager::updateCollectionFolderMetadata(SystemData* sys)
|
||||
{
|
||||
FileData* rootFolder = sys->getRootFolder();
|
||||
std::string desc = "This collection is empty.";
|
||||
|
@ -808,7 +808,7 @@ FileData* CollectionSystemManager::updateCollectionFolderMetadata(SystemData* sy
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
std::vector<std::string> CollectionSystemManager::getUnusedSystemsFromTheme()
|
||||
std::vector<std::string> CollectionSystemsManager::getUnusedSystemsFromTheme()
|
||||
{
|
||||
// Get used systems in es_systems.cfg.
|
||||
std::vector<std::string> systemsInUse = getSystemsFromConfig();
|
||||
|
@ -834,7 +834,7 @@ std::vector<std::string> CollectionSystemManager::getUnusedSystemsFromTheme()
|
|||
return themeSys;
|
||||
}
|
||||
|
||||
SystemData* CollectionSystemManager::addNewCustomCollection(std::string name)
|
||||
SystemData* CollectionSystemsManager::addNewCustomCollection(std::string name)
|
||||
{
|
||||
CollectionSystemDecl decl = mCollectionSystemDeclsIndex[myCollectionsName];
|
||||
decl.themeFolder = name;
|
||||
|
@ -844,7 +844,7 @@ SystemData* CollectionSystemManager::addNewCustomCollection(std::string name)
|
|||
return createNewCollectionEntry(name, decl, true, true);
|
||||
}
|
||||
|
||||
void CollectionSystemManager::deleteCustomCollection(std::string collectionName)
|
||||
void CollectionSystemsManager::deleteCustomCollection(std::string collectionName)
|
||||
{
|
||||
auto collectionEntry = mCustomCollectionSystemsData.find(collectionName);
|
||||
|
||||
|
@ -855,8 +855,8 @@ void CollectionSystemManager::deleteCustomCollection(std::string collectionName)
|
|||
delete mWindow->peekGui();
|
||||
|
||||
if (collectionEntry != mCustomCollectionSystemsData.end()) {
|
||||
CollectionSystemManager::get()->loadEnabledListFromSettings();
|
||||
CollectionSystemManager::get()->updateSystemsList();
|
||||
CollectionSystemsManager::get()->loadEnabledListFromSettings();
|
||||
CollectionSystemsManager::get()->updateSystemsList();
|
||||
|
||||
ViewController::get()->removeGameListView(collectionEntry->second.system);
|
||||
ViewController::get()->reloadAll();
|
||||
|
@ -867,7 +867,7 @@ void CollectionSystemManager::deleteCustomCollection(std::string collectionName)
|
|||
// Remove the collection configuration file.
|
||||
std::string configFile = getCustomCollectionConfigPath(collectionName);
|
||||
Utils::FileSystem::removeFile(configFile);
|
||||
LOG(LogDebug) << "CollectionSystemManager::deleteCustomCollection(): Deleted the "
|
||||
LOG(LogDebug) << "CollectionSystemsManager::deleteCustomCollection(): Deleted the "
|
||||
"configuration file '" << configFile << "'.";
|
||||
|
||||
GuiInfoPopup* s = new GuiInfoPopup(mWindow, "DELETED THE COLLECTION '" +
|
||||
|
@ -880,7 +880,7 @@ void CollectionSystemManager::deleteCustomCollection(std::string collectionName)
|
|||
}
|
||||
}
|
||||
|
||||
void CollectionSystemManager::initAutoCollectionSystems()
|
||||
void CollectionSystemsManager::initAutoCollectionSystems()
|
||||
{
|
||||
for (std::map<std::string, CollectionSystemDecl, stringComparator>::const_iterator
|
||||
it = mCollectionSystemDeclsIndex.cbegin();
|
||||
|
@ -892,7 +892,7 @@ void CollectionSystemManager::initAutoCollectionSystems()
|
|||
}
|
||||
}
|
||||
|
||||
void CollectionSystemManager::initCustomCollectionSystems()
|
||||
void CollectionSystemsManager::initCustomCollectionSystems()
|
||||
{
|
||||
std::vector<std::string> systems = getCollectionsFromConfigFolder();
|
||||
for (auto nameIt = systems.cbegin(); nameIt != systems.cend(); nameIt++) {
|
||||
|
@ -900,7 +900,7 @@ void CollectionSystemManager::initCustomCollectionSystems()
|
|||
}
|
||||
}
|
||||
|
||||
SystemData* CollectionSystemManager::getAllGamesCollection()
|
||||
SystemData* CollectionSystemsManager::getAllGamesCollection()
|
||||
{
|
||||
CollectionSystemData* allSysData = &mAutoCollectionSystemsData["all"];
|
||||
if (!allSysData->isPopulated)
|
||||
|
@ -909,7 +909,7 @@ SystemData* CollectionSystemManager::getAllGamesCollection()
|
|||
return allSysData->system;
|
||||
}
|
||||
|
||||
SystemData* CollectionSystemManager::createNewCollectionEntry(
|
||||
SystemData* CollectionSystemsManager::createNewCollectionEntry(
|
||||
std::string name, CollectionSystemDecl sysDecl, bool index, bool custom)
|
||||
{
|
||||
SystemData* newSys = new SystemData(name, sysDecl.longName,
|
||||
|
@ -931,7 +931,7 @@ SystemData* CollectionSystemManager::createNewCollectionEntry(
|
|||
return newSys;
|
||||
}
|
||||
|
||||
void CollectionSystemManager::populateAutoCollection(CollectionSystemData* sysData)
|
||||
void CollectionSystemsManager::populateAutoCollection(CollectionSystemData* sysData)
|
||||
{
|
||||
SystemData* newSys = sysData->system;
|
||||
CollectionSystemDecl sysDecl = sysData->decl;
|
||||
|
@ -990,7 +990,7 @@ void CollectionSystemManager::populateAutoCollection(CollectionSystemData* sysDa
|
|||
sysData->isPopulated = true;
|
||||
}
|
||||
|
||||
void CollectionSystemManager::populateCustomCollection(CollectionSystemData* sysData)
|
||||
void CollectionSystemsManager::populateCustomCollection(CollectionSystemData* sysData)
|
||||
{
|
||||
SystemData* newSys = sysData->system;
|
||||
sysData->isPopulated = true;
|
||||
|
@ -1044,7 +1044,7 @@ void CollectionSystemManager::populateCustomCollection(CollectionSystemData* sys
|
|||
}
|
||||
}
|
||||
|
||||
void CollectionSystemManager::removeCollectionsFromDisplayedSystems()
|
||||
void CollectionSystemsManager::removeCollectionsFromDisplayedSystems()
|
||||
{
|
||||
// Remove all collection Systems.
|
||||
for (auto sysIt = SystemData::sSystemVector.cbegin();
|
||||
|
@ -1068,7 +1068,7 @@ void CollectionSystemManager::removeCollectionsFromDisplayedSystems()
|
|||
ViewController::get()->removeGameListView(mCustomCollectionsBundle);
|
||||
}
|
||||
|
||||
void CollectionSystemManager::addEnabledCollectionsToDisplayedSystems(
|
||||
void CollectionSystemsManager::addEnabledCollectionsToDisplayedSystems(
|
||||
std::map<std::string, CollectionSystemData, stringComparator>* colSystemData)
|
||||
{
|
||||
// Add auto enabled collections.
|
||||
|
@ -1113,7 +1113,7 @@ void CollectionSystemManager::addEnabledCollectionsToDisplayedSystems(
|
|||
}
|
||||
}
|
||||
|
||||
std::vector<std::string> CollectionSystemManager::getSystemsFromConfig()
|
||||
std::vector<std::string> CollectionSystemsManager::getSystemsFromConfig()
|
||||
{
|
||||
std::vector<std::string> systems;
|
||||
std::string path = SystemData::getConfigPath(false);
|
||||
|
@ -1148,7 +1148,7 @@ std::vector<std::string> CollectionSystemManager::getSystemsFromConfig()
|
|||
}
|
||||
|
||||
// Get all folders from the current theme path.
|
||||
std::vector<std::string> CollectionSystemManager::getSystemsFromTheme()
|
||||
std::vector<std::string> CollectionSystemsManager::getSystemsFromTheme()
|
||||
{
|
||||
std::vector<std::string> systems;
|
||||
|
||||
|
@ -1185,7 +1185,7 @@ std::vector<std::string> CollectionSystemManager::getSystemsFromTheme()
|
|||
return systems;
|
||||
}
|
||||
|
||||
std::vector<std::string> CollectionSystemManager::getCollectionsFromConfigFolder()
|
||||
std::vector<std::string> CollectionSystemsManager::getCollectionsFromConfigFolder()
|
||||
{
|
||||
std::vector<std::string> systems;
|
||||
std::string configPath = getCollectionsFolder();
|
||||
|
@ -1215,7 +1215,7 @@ std::vector<std::string> CollectionSystemManager::getCollectionsFromConfigFolder
|
|||
return systems;
|
||||
}
|
||||
|
||||
std::vector<std::string> CollectionSystemManager::getCollectionThemeFolders(bool custom)
|
||||
std::vector<std::string> CollectionSystemsManager::getCollectionThemeFolders(bool custom)
|
||||
{
|
||||
std::vector<std::string> systems;
|
||||
for (std::map<std::string, CollectionSystemDecl, stringComparator>::const_iterator
|
||||
|
@ -1228,7 +1228,7 @@ std::vector<std::string> CollectionSystemManager::getCollectionThemeFolders(bool
|
|||
return systems;
|
||||
}
|
||||
|
||||
std::vector<std::string> CollectionSystemManager::getUserCollectionThemeFolders()
|
||||
std::vector<std::string> CollectionSystemsManager::getUserCollectionThemeFolders()
|
||||
{
|
||||
std::vector<std::string> systems;
|
||||
for (std::map<std::string, CollectionSystemData, stringComparator>::const_iterator
|
||||
|
@ -1238,7 +1238,7 @@ std::vector<std::string> CollectionSystemManager::getUserCollectionThemeFolders(
|
|||
return systems;
|
||||
}
|
||||
|
||||
void CollectionSystemManager::trimCollectionCount(FileData* rootFolder, int limit)
|
||||
void CollectionSystemsManager::trimCollectionCount(FileData* rootFolder, int limit)
|
||||
{
|
||||
SystemData* curSys = rootFolder->getSystem();
|
||||
while (static_cast<int>(rootFolder->getChildrenListToDisplay().size()) > limit) {
|
||||
|
@ -1248,13 +1248,13 @@ void CollectionSystemManager::trimCollectionCount(FileData* rootFolder, int limi
|
|||
}
|
||||
}
|
||||
|
||||
bool CollectionSystemManager::themeFolderExists(std::string folder)
|
||||
bool CollectionSystemsManager::themeFolderExists(std::string folder)
|
||||
{
|
||||
std::vector<std::string> themeSys = getSystemsFromTheme();
|
||||
return std::find(themeSys.cbegin(), themeSys.cend(), folder) != themeSys.cend();
|
||||
}
|
||||
|
||||
bool CollectionSystemManager::includeFileInAutoCollections(FileData* file)
|
||||
bool CollectionSystemsManager::includeFileInAutoCollections(FileData* file)
|
||||
{
|
||||
// We exclude non-game files from collections (i.e. "kodi", entries from non-game systems).
|
||||
// If/when there are more in the future, maybe this can be a more complex method, with a
|
||||
|
@ -1262,12 +1262,12 @@ bool CollectionSystemManager::includeFileInAutoCollections(FileData* file)
|
|||
return file->getName() != "kodi" && file->getSystem()->isGameSystem();
|
||||
}
|
||||
|
||||
std::string CollectionSystemManager::getCustomCollectionConfigPath(std::string collectionName)
|
||||
std::string CollectionSystemsManager::getCustomCollectionConfigPath(std::string collectionName)
|
||||
{
|
||||
return getCollectionsFolder() + "/custom-" + collectionName + ".cfg";
|
||||
}
|
||||
|
||||
std::string CollectionSystemManager::getCollectionsFolder()
|
||||
std::string CollectionSystemsManager::getCollectionsFolder()
|
||||
{
|
||||
return Utils::FileSystem::getGenericPath(Utils::FileSystem::getHomePath() +
|
||||
"/.emulationstation/collections");
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: MIT
|
||||
//
|
||||
// EmulationStation Desktop Edition
|
||||
// CollectionSystemManager.h
|
||||
// CollectionSystemsManager.h
|
||||
//
|
||||
// Manages collections of the following two types:
|
||||
// 1) Automatically populated (All games, Favorites and Recent/Last Played)
|
||||
|
@ -9,12 +9,12 @@
|
|||
//
|
||||
// The automatic collections are basically virtual systems that have no
|
||||
// gamelist.xml files and that only exist in memory during the program session.
|
||||
// SystemData sets up the basic data structures and CollectionSystemManager
|
||||
// SystemData sets up the basic data structures and CollectionSystemsManager
|
||||
// populates and manages the collections.
|
||||
//
|
||||
// The custom collections have simple data files which are just lists of ROM files.
|
||||
//
|
||||
// In addition to this, CollectionSystemManager also handles some logic for
|
||||
// In addition to this, CollectionSystemsManager also handles some logic for
|
||||
// normal systems such as adding and removing favorite games, including triggering
|
||||
// the required re-sort and refresh of the gamelists.
|
||||
//
|
||||
|
@ -62,13 +62,13 @@ struct stringComparator {
|
|||
}
|
||||
};
|
||||
|
||||
class CollectionSystemManager
|
||||
class CollectionSystemsManager
|
||||
{
|
||||
public:
|
||||
CollectionSystemManager(Window* window);
|
||||
~CollectionSystemManager();
|
||||
CollectionSystemsManager(Window* window);
|
||||
~CollectionSystemsManager();
|
||||
|
||||
static CollectionSystemManager* get();
|
||||
static CollectionSystemsManager* get();
|
||||
static void init(Window* window);
|
||||
static void deinit();
|
||||
void saveCustomCollection(SystemData* sys);
|
||||
|
@ -118,7 +118,7 @@ public:
|
|||
inline std::string getEditingCollection() { return mEditingCollection; };
|
||||
|
||||
private:
|
||||
static CollectionSystemManager* sInstance;
|
||||
static CollectionSystemsManager* sInstance;
|
||||
SystemEnvironmentData* mCollectionEnvData;
|
||||
std::map<std::string, CollectionSystemDecl, stringComparator> mCollectionSystemDeclsIndex;
|
||||
std::map<std::string, CollectionSystemData, stringComparator> mAutoCollectionSystemsData;
|
|
@ -15,7 +15,7 @@
|
|||
#include "utils/StringUtil.h"
|
||||
#include "utils/TimeUtil.h"
|
||||
#include "AudioManager.h"
|
||||
#include "CollectionSystemManager.h"
|
||||
#include "CollectionSystemsManager.h"
|
||||
#include "FileFilterIndex.h"
|
||||
#include "FileSorts.h"
|
||||
#include "Log.h"
|
||||
|
@ -464,7 +464,7 @@ void FileData::sort(ComparisonFunction& comparator, bool ascending,
|
|||
}
|
||||
}
|
||||
|
||||
// The main custom collections view is sorted during startup in CollectionSystemManager.
|
||||
// The main custom collections view is sorted during startup in CollectionSystemsManager.
|
||||
// The individual collections are however sorted as any normal systems/folders.
|
||||
if (mSystem->isCollection() && mSystem->getFullName() == "collections") {
|
||||
std::pair<unsigned int, unsigned int> tempGameCount = {};
|
||||
|
@ -560,7 +560,7 @@ void FileData::sortFavoritesOnTop(ComparisonFunction& comparator, bool ascending
|
|||
if (mSystem->isGroupedCustomCollection())
|
||||
gameCount = {};
|
||||
|
||||
// The main custom collections view is sorted during startup in CollectionSystemManager.
|
||||
// The main custom collections view is sorted during startup in CollectionSystemsManager.
|
||||
// The individual collections are however sorted as any normal systems/folders.
|
||||
if (mSystem->isCollection() && mSystem->getFullName() == "collections") {
|
||||
std::pair<unsigned int, unsigned int> tempGameCount = {};
|
||||
|
@ -964,7 +964,7 @@ void FileData::launchGame(Window* window)
|
|||
gameToUpdate->metadata.get("lastplayed"));
|
||||
}
|
||||
|
||||
CollectionSystemManager::get()->refreshCollectionSystems(gameToUpdate);
|
||||
CollectionSystemsManager::get()->refreshCollectionSystems(gameToUpdate);
|
||||
|
||||
gameToUpdate->mSystem->onMetaDataSavePoint();
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#include "views/gamelist/IGameListView.h"
|
||||
#include "views/UIModeController.h"
|
||||
#include "views/ViewController.h"
|
||||
#include "CollectionSystemManager.h"
|
||||
#include "CollectionSystemsManager.h"
|
||||
#include "FileFilterIndex.h"
|
||||
#include "FileSorts.h"
|
||||
#include "Gamelist.h"
|
||||
|
@ -74,7 +74,7 @@ SystemData::SystemData(
|
|||
indexAllGameFilters(mRootFolder);
|
||||
}
|
||||
else {
|
||||
// Virtual systems are updated afterwards by CollectionSystemManager.
|
||||
// Virtual systems are updated afterwards by CollectionSystemsManager.
|
||||
// We're just creating the data structure here.
|
||||
mRootFolder = new FileData(FOLDER, "" + name, mEnvData, this);
|
||||
setupSystemSortType(mRootFolder);
|
||||
|
@ -372,7 +372,7 @@ bool SystemData::loadConfig()
|
|||
|
||||
// Don't load any collections if there are no systems available.
|
||||
if (sSystemVector.size() > 0)
|
||||
CollectionSystemManager::get()->loadCollectionSystems();
|
||||
CollectionSystemsManager::get()->loadCollectionSystems();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#include "guis/GuiSettings.h"
|
||||
#include "guis/GuiTextEditPopup.h"
|
||||
#include "views/ViewController.h"
|
||||
#include "CollectionSystemManager.h"
|
||||
#include "CollectionSystemsManager.h"
|
||||
|
||||
GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(
|
||||
Window* window,
|
||||
|
@ -25,13 +25,13 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(
|
|||
mDeletedCustomCollection(false)
|
||||
{
|
||||
// Finish editing custom collection.
|
||||
if (CollectionSystemManager::get()->isEditing()) {
|
||||
if (CollectionSystemsManager::get()->isEditing()) {
|
||||
ComponentListRow row;
|
||||
row.addElement(std::make_shared<TextComponent>(mWindow, "FINISH EDITING '" +
|
||||
Utils::String::toUpper(CollectionSystemManager::get()->getEditingCollection()) +
|
||||
Utils::String::toUpper(CollectionSystemsManager::get()->getEditingCollection()) +
|
||||
"' COLLECTION", Font::get(FONT_SIZE_MEDIUM), 0x777777FF), true);
|
||||
row.makeAcceptInputHandler([this] {
|
||||
CollectionSystemManager::get()->exitEditMode();
|
||||
CollectionSystemsManager::get()->exitEditMode();
|
||||
delete this;
|
||||
});
|
||||
addRow(row);
|
||||
|
@ -41,7 +41,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(
|
|||
collection_systems_auto = std::make_shared<OptionListComponent<std::string>>
|
||||
(mWindow, getHelpStyle(), "SELECT COLLECTIONS", true);
|
||||
std::map<std::string, CollectionSystemData, stringComparator> autoSystems =
|
||||
CollectionSystemManager::get()->getAutoCollectionSystems();
|
||||
CollectionSystemsManager::get()->getAutoCollectionSystems();
|
||||
// Add automatic systems.
|
||||
for (std::map<std::string, CollectionSystemData, stringComparator>::const_iterator
|
||||
it = autoSystems.cbegin(); it != autoSystems.cend() ; it++)
|
||||
|
@ -53,8 +53,8 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(
|
|||
Utils::String::vectorToCommaString(collection_systems_auto->getSelectedObjects(), true);
|
||||
std::string autoSystemsConfig = Settings::getInstance()->getString("CollectionSystemsAuto");
|
||||
if (autoSystemsSelected != autoSystemsConfig) {
|
||||
if (CollectionSystemManager::get()->isEditing())
|
||||
CollectionSystemManager::get()->exitEditMode();
|
||||
if (CollectionSystemsManager::get()->isEditing())
|
||||
CollectionSystemsManager::get()->exitEditMode();
|
||||
Settings::getInstance()->setString("CollectionSystemsAuto", autoSystemsSelected);
|
||||
setNeedsSaving();
|
||||
setNeedsReloading();
|
||||
|
@ -68,7 +68,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(
|
|||
collection_systems_custom = std::make_shared<OptionListComponent<std::string>>
|
||||
(mWindow, getHelpStyle(), "SELECT COLLECTIONS", true);
|
||||
std::map<std::string, CollectionSystemData, stringComparator> customSystems =
|
||||
CollectionSystemManager::get()->getCustomCollectionSystems();
|
||||
CollectionSystemsManager::get()->getCustomCollectionSystems();
|
||||
// Add custom systems.
|
||||
for (std::map<std::string, CollectionSystemData, stringComparator>::const_iterator
|
||||
it = customSystems.cbegin(); it != customSystems.cend() ; it++)
|
||||
|
@ -82,8 +82,8 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(
|
|||
std::string customSystemsConfig = Settings::getInstance()->
|
||||
getString("CollectionSystemsCustom");
|
||||
if (customSystemsSelected != customSystemsConfig) {
|
||||
if (CollectionSystemManager::get()->isEditing())
|
||||
CollectionSystemManager::get()->exitEditMode();
|
||||
if (CollectionSystemsManager::get()->isEditing())
|
||||
CollectionSystemsManager::get()->exitEditMode();
|
||||
Settings::getInstance()->setString("CollectionSystemsCustom",
|
||||
customSystemsSelected);
|
||||
setNeedsSaving();
|
||||
|
@ -97,7 +97,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(
|
|||
|
||||
// Create custom collection from theme.
|
||||
std::vector<std::string> unusedFolders =
|
||||
CollectionSystemManager::get()->getUnusedSystemsFromTheme();
|
||||
CollectionSystemsManager::get()->getUnusedSystemsFromTheme();
|
||||
if (unusedFolders.size() > 0) {
|
||||
ComponentListRow row;
|
||||
auto themeCollection = std::make_shared<TextComponent>(mWindow,
|
||||
|
@ -186,8 +186,8 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(
|
|||
Utils::String::toUpper(name) + "'\n"
|
||||
"ARE YOU SURE?",
|
||||
"YES", [this, name] {
|
||||
if (CollectionSystemManager::get()->isEditing())
|
||||
CollectionSystemManager::get()->exitEditMode();
|
||||
if (CollectionSystemsManager::get()->isEditing())
|
||||
CollectionSystemsManager::get()->exitEditMode();
|
||||
mDeletedCustomCollection = true;
|
||||
std::vector<std::string> selectedCustomCollections =
|
||||
collection_systems_custom->getSelectedObjects();
|
||||
|
@ -212,7 +212,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(
|
|||
setNeedsSaving();
|
||||
setNeedsGoToSystemView(SystemData::sSystemVector.front());
|
||||
}
|
||||
CollectionSystemManager::get()->deleteCustomCollection(name);
|
||||
CollectionSystemsManager::get()->deleteCustomCollection(name);
|
||||
return true;
|
||||
},
|
||||
"NO", [this] {
|
||||
|
@ -295,15 +295,15 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(
|
|||
|
||||
void GuiCollectionSystemsOptions::createCustomCollection(std::string inName)
|
||||
{
|
||||
if (CollectionSystemManager::get()->isEditing())
|
||||
CollectionSystemManager::get()->exitEditMode();
|
||||
if (CollectionSystemsManager::get()->isEditing())
|
||||
CollectionSystemsManager::get()->exitEditMode();
|
||||
|
||||
std::string collectionName = CollectionSystemManager::get()->
|
||||
std::string collectionName = CollectionSystemsManager::get()->
|
||||
getValidNewCollectionName(inName);
|
||||
SystemData* newCollection = CollectionSystemManager::get()->
|
||||
SystemData* newCollection = CollectionSystemsManager::get()->
|
||||
addNewCustomCollection(collectionName);
|
||||
|
||||
CollectionSystemManager::get()->saveCustomCollection(newCollection);
|
||||
CollectionSystemsManager::get()->saveCustomCollection(newCollection);
|
||||
collection_systems_custom->add(collectionName, collectionName, true);
|
||||
|
||||
mAddedCustomCollection = true;
|
||||
|
@ -312,5 +312,5 @@ void GuiCollectionSystemsOptions::createCustomCollection(std::string inName)
|
|||
Window* window = mWindow;
|
||||
while (window->peekGui() && window->peekGui() != ViewController::get())
|
||||
delete window->peekGui();
|
||||
CollectionSystemManager::get()->setEditMode(collectionName);
|
||||
CollectionSystemsManager::get()->setEditMode(collectionName);
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#include "views/gamelist/IGameListView.h"
|
||||
#include "views/UIModeController.h"
|
||||
#include "views/ViewController.h"
|
||||
#include "CollectionSystemManager.h"
|
||||
#include "CollectionSystemsManager.h"
|
||||
#include "FileFilterIndex.h"
|
||||
#include "FileSorts.h"
|
||||
#include "GuiMetaDataEd.h"
|
||||
|
@ -152,7 +152,7 @@ GuiGamelistOptions::GuiGamelistOptions(
|
|||
|
||||
if (UIModeController::getInstance()->isUIModeFull() &&
|
||||
(isCustomCollection || isCustomCollectionGroup)) {
|
||||
if (CollectionSystemManager::get()->getEditingCollection() != customSystem) {
|
||||
if (CollectionSystemsManager::get()->getEditingCollection() != customSystem) {
|
||||
row.elements.clear();
|
||||
row.addElement(std::make_shared<TextComponent>(
|
||||
mWindow, "ADD/REMOVE GAMES TO THIS GAME COLLECTION",
|
||||
|
@ -163,11 +163,11 @@ GuiGamelistOptions::GuiGamelistOptions(
|
|||
}
|
||||
|
||||
if (UIModeController::getInstance()->isUIModeFull() &&
|
||||
CollectionSystemManager::get()->isEditing()) {
|
||||
CollectionSystemsManager::get()->isEditing()) {
|
||||
row.elements.clear();
|
||||
row.addElement(std::make_shared<TextComponent>(
|
||||
mWindow, "FINISH EDITING '" + Utils::String::toUpper(
|
||||
CollectionSystemManager::get()->getEditingCollection()) +
|
||||
CollectionSystemsManager::get()->getEditingCollection()) +
|
||||
"' COLLECTION",Font::get(FONT_SIZE_MEDIUM), 0x777777FF), true);
|
||||
row.makeAcceptInputHandler(std::bind(&GuiGamelistOptions::exitEditMode, this));
|
||||
mMenu.addRow(row);
|
||||
|
@ -272,7 +272,7 @@ void GuiGamelistOptions::startEditMode()
|
|||
std::string editingSystem = mSystem->getName();
|
||||
// Need to check if we're editing the collections bundle,
|
||||
// as we will want to edit the selected collection within.
|
||||
if (editingSystem == CollectionSystemManager::get()->getCustomCollectionsBundle()->getName()) {
|
||||
if (editingSystem == CollectionSystemsManager::get()->getCustomCollectionsBundle()->getName()) {
|
||||
FileData* file = getGamelist()->getCursor();
|
||||
// Do we have the cursor on a specific collection?.
|
||||
if (file->getType() == FOLDER)
|
||||
|
@ -281,7 +281,7 @@ void GuiGamelistOptions::startEditMode()
|
|||
// We are inside a specific collection. We want to edit that one.
|
||||
editingSystem = file->getSystem()->getName();
|
||||
}
|
||||
CollectionSystemManager::get()->setEditMode(editingSystem);
|
||||
CollectionSystemsManager::get()->setEditMode(editingSystem);
|
||||
|
||||
// Display the indication icons which show what games are part of the custom collection
|
||||
// currently being edited. This is done cheaply using onFileChanged() which will trigger
|
||||
|
@ -297,7 +297,7 @@ void GuiGamelistOptions::startEditMode()
|
|||
|
||||
void GuiGamelistOptions::exitEditMode()
|
||||
{
|
||||
CollectionSystemManager::get()->exitEditMode();
|
||||
CollectionSystemsManager::get()->exitEditMode();
|
||||
|
||||
for (auto it = SystemData::sSystemVector.begin();
|
||||
it != SystemData::sSystemVector.end(); it++) {
|
||||
|
@ -360,7 +360,7 @@ void GuiGamelistOptions::openMetaDataEd()
|
|||
deleteGameBtnFunc = [this, file] {
|
||||
LOG(LogInfo) << "Deleting the game file \"" << file->getFullPath() <<
|
||||
"\", all its media files and its gamelist.xml entry.";
|
||||
CollectionSystemManager::get()->deleteCollectionFiles(file);
|
||||
CollectionSystemsManager::get()->deleteCollectionFiles(file);
|
||||
ViewController::get()->getGameListView(
|
||||
file->getSystem()).get()->removeMedia(file);
|
||||
ViewController::get()->getGameListView(
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "views/gamelist/IGameListView.h"
|
||||
#include "views/UIModeController.h"
|
||||
#include "views/ViewController.h"
|
||||
#include "CollectionSystemManager.h"
|
||||
#include "CollectionSystemsManager.h"
|
||||
#include "EmulationStation.h"
|
||||
#include "FileSorts.h"
|
||||
#include "Platform.h"
|
||||
|
@ -165,7 +165,7 @@ void GuiMenu::openUISettings()
|
|||
if (theme_set->getSelected() != Settings::getInstance()->getString("ThemeSet")) {
|
||||
Scripting::fireEvent("theme-changed", theme_set->getSelected(),
|
||||
Settings::getInstance()->getString("ThemeSet"));
|
||||
CollectionSystemManager::get()->updateSystemsList();
|
||||
CollectionSystemsManager::get()->updateSystemsList();
|
||||
Settings::getInstance()->setString("ThemeSet", theme_set->getSelected());
|
||||
s->setNeedsSaving();
|
||||
s->setNeedsReloading();
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include "resources/Font.h"
|
||||
#include "utils/StringUtil.h"
|
||||
#include "views/ViewController.h"
|
||||
#include "CollectionSystemManager.h"
|
||||
#include "CollectionSystemsManager.h"
|
||||
#include "FileData.h"
|
||||
#include "FileFilterIndex.h"
|
||||
#include "Gamelist.h"
|
||||
|
@ -378,7 +378,7 @@ void GuiMetaDataEd::save()
|
|||
mScraperParams.system->getIndex()->addToIndex(mScraperParams.game);
|
||||
|
||||
// If it's a folder that has been updated, we need to manually sort the gamelist
|
||||
// as CollectionSystemManager ignores folders.
|
||||
// as CollectionSystemsManager ignores folders.
|
||||
if (mScraperParams.game->getType() == FOLDER)
|
||||
mScraperParams.system->sortSystem(false);
|
||||
|
||||
|
@ -386,7 +386,7 @@ void GuiMetaDataEd::save()
|
|||
mSavedCallback();
|
||||
|
||||
// Update respective Collection Entries.
|
||||
CollectionSystemManager::get()->refreshCollectionSystems(mScraperParams.game);
|
||||
CollectionSystemsManager::get()->refreshCollectionSystems(mScraperParams.game);
|
||||
|
||||
mScraperParams.system->onMetaDataSavePoint();
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include "resources/Font.h"
|
||||
#include "utils/StringUtil.h"
|
||||
#include "views/ViewController.h"
|
||||
#include "CollectionSystemManager.h"
|
||||
#include "CollectionSystemsManager.h"
|
||||
#include "FileData.h"
|
||||
#include "Log.h"
|
||||
#include "MameNames.h"
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include "guis/GuiTextEditPopup.h"
|
||||
#include "views/gamelist/IGameListView.h"
|
||||
#include "views/ViewController.h"
|
||||
#include "CollectionSystemManager.h"
|
||||
#include "CollectionSystemsManager.h"
|
||||
#include "Settings.h"
|
||||
#include "SystemData.h"
|
||||
#include "Window.h"
|
||||
|
@ -57,8 +57,8 @@ void GuiSettings::save()
|
|||
Settings::getInstance()->saveFile();
|
||||
|
||||
if (mNeedsCollectionsUpdate) {
|
||||
CollectionSystemManager::get()->loadEnabledListFromSettings();
|
||||
CollectionSystemManager::get()->updateSystemsList();
|
||||
CollectionSystemsManager::get()->loadEnabledListFromSettings();
|
||||
CollectionSystemsManager::get()->updateSystemsList();
|
||||
}
|
||||
|
||||
if (mNeedsReloading)
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include "utils/StringUtil.h"
|
||||
#include "views/ViewController.h"
|
||||
#include "AudioManager.h"
|
||||
#include "CollectionSystemManager.h"
|
||||
#include "CollectionSystemsManager.h"
|
||||
#include "EmulationStation.h"
|
||||
#include "InputManager.h"
|
||||
#include "Log.h"
|
||||
|
@ -451,7 +451,7 @@ int main(int argc, char* argv[])
|
|||
Window window;
|
||||
SystemScreensaver screensaver(&window);
|
||||
ViewController::init(&window);
|
||||
CollectionSystemManager::init(&window);
|
||||
CollectionSystemsManager::init(&window);
|
||||
window.pushGui(ViewController::get());
|
||||
|
||||
bool splashScreen = Settings::getInstance()->getBool("SplashScreen");
|
||||
|
@ -642,7 +642,7 @@ int main(int argc, char* argv[])
|
|||
window.deinit();
|
||||
|
||||
MameNames::deinit();
|
||||
CollectionSystemManager::deinit();
|
||||
CollectionSystemsManager::deinit();
|
||||
SystemData::deleteSystems();
|
||||
|
||||
// Call this ONLY when linking with FreeImage as a static library.
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include "utils/FileSystemUtil.h"
|
||||
#include "views/UIModeController.h"
|
||||
#include "views/ViewController.h"
|
||||
#include "CollectionSystemManager.h"
|
||||
#include "CollectionSystemsManager.h"
|
||||
#include "Settings.h"
|
||||
#include "SystemData.h"
|
||||
|
||||
|
@ -54,8 +54,8 @@ void BasicGameListView::populateList(const std::vector<FileData*>& files, FileDa
|
|||
std::string editingCollection;
|
||||
std::string inCollectionPrefix;
|
||||
|
||||
if (CollectionSystemManager::get()->isEditing()) {
|
||||
editingCollection = CollectionSystemManager::get()->getEditingCollection();
|
||||
if (CollectionSystemsManager::get()->isEditing()) {
|
||||
editingCollection = CollectionSystemsManager::get()->getEditingCollection();
|
||||
isEditing = true;
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ void BasicGameListView::populateList(const std::vector<FileData*>& files, FileDa
|
|||
// Add a leading tick mark icon to the game name if it's part of the custom collection
|
||||
// currently being edited.
|
||||
if (isEditing && (*it)->getType() == GAME) {
|
||||
if (CollectionSystemManager::get()->inCustomCollection(editingCollection, (*it)))
|
||||
if (CollectionSystemsManager::get()->inCustomCollection(editingCollection, (*it)))
|
||||
inCollectionPrefix = "\uF14A ";
|
||||
else
|
||||
inCollectionPrefix = "";
|
||||
|
@ -269,8 +269,8 @@ std::vector<HelpPrompt> BasicGameListView::getHelpPrompts()
|
|||
if (mRoot->getSystem()->isGameSystem() && !UIModeController::getInstance()->isUIModeKid() &&
|
||||
!UIModeController::getInstance()->isUIModeKiosk() &&
|
||||
(Settings::getInstance()->getBool("FavoritesAddButton") ||
|
||||
CollectionSystemManager::get()->isEditing())) {
|
||||
std::string prompt = CollectionSystemManager::get()->getEditingCollection();
|
||||
CollectionSystemsManager::get()->isEditing())) {
|
||||
std::string prompt = CollectionSystemsManager::get()->getEditingCollection();
|
||||
prompts.push_back(HelpPrompt("y", prompt));
|
||||
}
|
||||
return prompts;
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include "animations/LambdaAnimation.h"
|
||||
#include "views/ViewController.h"
|
||||
#include "CollectionSystemManager.h"
|
||||
#include "CollectionSystemsManager.h"
|
||||
#include "SystemData.h"
|
||||
|
||||
#define FADE_IN_START_OPACITY 0.5f
|
||||
|
@ -329,7 +329,7 @@ void DetailedGameListView::updateInfoPanel()
|
|||
// the first of these so that we can display its game media.
|
||||
if (file->getSystem()->isCustomCollection() &&
|
||||
file->getPath() == file->getSystem()->getName()) {
|
||||
FileData* randomGame = CollectionSystemManager::get()->
|
||||
FileData* randomGame = CollectionSystemsManager::get()->
|
||||
updateCollectionFolderMetadata(file->getSystem());
|
||||
if (randomGame) {
|
||||
mThumbnail.setImage(randomGame->getThumbnailPath());
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include "animations/LambdaAnimation.h"
|
||||
#include "views/UIModeController.h"
|
||||
#include "views/ViewController.h"
|
||||
#include "CollectionSystemManager.h"
|
||||
#include "CollectionSystemsManager.h"
|
||||
#include "Settings.h"
|
||||
#include "Sound.h"
|
||||
#include "SystemData.h"
|
||||
|
@ -637,7 +637,7 @@ std::vector<HelpPrompt> GridGameListView::getHelpPrompts()
|
|||
if (mRoot->getSystem()->isGameSystem())
|
||||
prompts.push_back(HelpPrompt("x", "random"));
|
||||
if (mRoot->getSystem()->isGameSystem() && !UIModeController::getInstance()->isUIModeKid()) {
|
||||
std::string prompt = CollectionSystemManager::get()->getEditingCollection();
|
||||
std::string prompt = CollectionSystemsManager::get()->getEditingCollection();
|
||||
prompts.push_back(HelpPrompt("y", prompt));
|
||||
}
|
||||
return prompts;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "utils/StringUtil.h"
|
||||
#include "views/UIModeController.h"
|
||||
#include "views/ViewController.h"
|
||||
#include "CollectionSystemManager.h"
|
||||
#include "CollectionSystemsManager.h"
|
||||
#include "FileFilterIndex.h"
|
||||
#include "Settings.h"
|
||||
#include "Sound.h"
|
||||
|
@ -201,7 +201,7 @@ bool ISimpleGameListView::input(InputConfig* config, Input input)
|
|||
}
|
||||
else if (config->isMappedTo("y", input) &&
|
||||
!Settings::getInstance()->getBool("FavoritesAddButton") &&
|
||||
!CollectionSystemManager::get()->isEditing()) {
|
||||
!CollectionSystemsManager::get()->isEditing()) {
|
||||
return true;
|
||||
}
|
||||
else if (config->isMappedTo("y", input) &&
|
||||
|
@ -217,7 +217,7 @@ bool ISimpleGameListView::input(InputConfig* config, Input input)
|
|||
FileData* entryToUpdate = getCursor();
|
||||
bool favoritesSorting;
|
||||
bool removedLastFavorite = false;
|
||||
bool isEditing = CollectionSystemManager::get()->isEditing();
|
||||
bool isEditing = CollectionSystemsManager::get()->isEditing();
|
||||
bool foldersOnTop = Settings::getInstance()->getBool("FoldersOnTop");
|
||||
// If the current list only contains folders, then treat it as if the folders
|
||||
// are not sorted on top, this way the logic should work exactly as for mixed
|
||||
|
@ -292,7 +292,7 @@ bool ISimpleGameListView::input(InputConfig* config, Input input)
|
|||
|
||||
// Marking folders as favorites don't make them part of any collections,
|
||||
// so it makes more sense to handle it here than to add the function to
|
||||
// CollectionSystemManager.
|
||||
// CollectionSystemsManager.
|
||||
if (entryToUpdate->getType() == FOLDER) {
|
||||
GuiInfoPopup* s;
|
||||
if (isEditing) {
|
||||
|
@ -340,7 +340,7 @@ bool ISimpleGameListView::input(InputConfig* config, Input input)
|
|||
"AS GAMES TO CUSTOM COLLECTIONS", 4000);
|
||||
mWindow->setInfoPopup(s);
|
||||
}
|
||||
else if (CollectionSystemManager::get()->toggleGameInCollection(entryToUpdate)) {
|
||||
else if (CollectionSystemsManager::get()->toggleGameInCollection(entryToUpdate)) {
|
||||
// Jump to the first entry in the gamelist if the last favorite was unmarked.
|
||||
if (foldersOnTop && removedLastFavorite &&
|
||||
!entryToUpdate->getSystem()->isCustomCollection())
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#if defined(_RPI_)
|
||||
#include "Settings.h"
|
||||
#endif
|
||||
#include "CollectionSystemManager.h"
|
||||
#include "CollectionSystemsManager.h"
|
||||
#include "SystemData.h"
|
||||
|
||||
#define FADE_IN_START_OPACITY 0.5f
|
||||
|
@ -355,7 +355,7 @@ void VideoGameListView::updateInfoPanel()
|
|||
// the first of these so that we can display its game media.
|
||||
if (file->getSystem()->isCustomCollection() &&
|
||||
file->getPath() == file->getSystem()->getName()) {
|
||||
FileData* randomGame = CollectionSystemManager::get()->
|
||||
FileData* randomGame = CollectionSystemsManager::get()->
|
||||
updateCollectionFolderMetadata(file->getSystem());
|
||||
if (randomGame) {
|
||||
mThumbnail.setImage(randomGame->getThumbnailPath());
|
||||
|
|
Loading…
Reference in a new issue