mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 23:55:38 +00:00
Made filters applicable per custom collection (if grouped).
This commit is contained in:
parent
127d900212
commit
e51c7ddf8c
|
@ -312,7 +312,7 @@ const std::string FileData::getVideoPath() const
|
||||||
const std::vector<FileData*>& FileData::getChildrenListToDisplay()
|
const std::vector<FileData*>& FileData::getChildrenListToDisplay()
|
||||||
{
|
{
|
||||||
|
|
||||||
FileFilterIndex* idx = CollectionSystemManager::get()->getSystemToView(mSystem)->getIndex();
|
FileFilterIndex* idx = mSystem->getIndex();
|
||||||
if (idx->isFiltered()) {
|
if (idx->isFiltered()) {
|
||||||
mFilteredChildren.clear();
|
mFilteredChildren.clear();
|
||||||
for (auto it = mChildren.cbegin(); it != mChildren.cend(); it++) {
|
for (auto it = mChildren.cbegin(); it != mChildren.cend(); it++) {
|
||||||
|
|
|
@ -102,9 +102,9 @@ void GuiGamelistFilter::addFiltersToMenu()
|
||||||
void GuiGamelistFilter::applyFilters()
|
void GuiGamelistFilter::applyFilters()
|
||||||
{
|
{
|
||||||
std::vector<FilterDataDecl> decls = mFilterIndex->getFilterDataDecls();
|
std::vector<FilterDataDecl> decls = mFilterIndex->getFilterDataDecls();
|
||||||
for (std::map<FilterIndexType, std::shared_ptr< OptionListComponent<std::string>
|
for (std::map<FilterIndexType, std::shared_ptr<OptionListComponent<std::string>>>::
|
||||||
>>::const_iterator it = mFilterOptions.cbegin(); it != mFilterOptions.cend(); ++it ) {
|
const_iterator it = mFilterOptions.cbegin(); it != mFilterOptions.cend(); ++it ) {
|
||||||
std::shared_ptr< OptionListComponent<std::string> > optionList = it->second;
|
std::shared_ptr<OptionListComponent<std::string>> optionList = it->second;
|
||||||
std::vector<std::string> filters = optionList->getSelectedObjects();
|
std::vector<std::string> filters = optionList->getSelectedObjects();
|
||||||
mFilterIndex->setFilter(it->first, &filters);
|
mFilterIndex->setFilter(it->first, &filters);
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ GuiGamelistOptions::GuiGamelistOptions(
|
||||||
|
|
||||||
// Read the applicable favorite sorting setting depending on whether the
|
// Read the applicable favorite sorting setting depending on whether the
|
||||||
// system is a custom collection or not.
|
// system is a custom collection or not.
|
||||||
if (CollectionSystemManager::get()->getIsCustomCollection(file->getSystem()))
|
if (isCustomCollection)
|
||||||
mFavoritesSorting = Settings::getInstance()->getBool("FavFirstCustom");
|
mFavoritesSorting = Settings::getInstance()->getBool("FavFirstCustom");
|
||||||
else
|
else
|
||||||
mFavoritesSorting = Settings::getInstance()->getBool("FavoritesFirst");
|
mFavoritesSorting = Settings::getInstance()->getBool("FavoritesFirst");
|
||||||
|
@ -253,8 +253,14 @@ GuiGamelistOptions::~GuiGamelistOptions()
|
||||||
|
|
||||||
void GuiGamelistOptions::openGamelistFilter()
|
void GuiGamelistOptions::openGamelistFilter()
|
||||||
{
|
{
|
||||||
|
GuiGamelistFilter* ggf;
|
||||||
mFiltersChanged = true;
|
mFiltersChanged = true;
|
||||||
GuiGamelistFilter* ggf = new GuiGamelistFilter(mWindow, mSystem);
|
|
||||||
|
if (isCustomCollection)
|
||||||
|
ggf = new GuiGamelistFilter(mWindow, getGamelist()->getCursor()->getSystem());
|
||||||
|
else
|
||||||
|
ggf = new GuiGamelistFilter(mWindow, mSystem);
|
||||||
|
|
||||||
mWindow->pushGui(ggf);
|
mWindow->pushGui(ggf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -134,9 +134,6 @@ bool ISimpleGameListView::input(InputConfig* config, Input input)
|
||||||
onFocusLost();
|
onFocusLost();
|
||||||
stopListScrolling();
|
stopListScrolling();
|
||||||
SystemData* systemToView = getCursor()->getSystem();
|
SystemData* systemToView = getCursor()->getSystem();
|
||||||
if (systemToView->isCollection())
|
|
||||||
systemToView = CollectionSystemManager::get()->getSystemToView(systemToView);
|
|
||||||
|
|
||||||
ViewController::get()->goToSystemView(systemToView);
|
ViewController::get()->goToSystemView(systemToView);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue