Game filter for games created by buddy (#5991)

This commit is contained in:
RickyRister 2025-06-14 08:10:24 -07:00 committed by GitHub
parent 6cb4e203f1
commit 61a6b32137
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 45 additions and 2 deletions

View file

@ -37,6 +37,9 @@ DlgFilterGames::DlgFilterGames(const QMap<int, QString> &_allGameTypes,
hideIgnoredUserGames = new QCheckBox(tr("Hide 'ignored user' games"));
hideIgnoredUserGames->setChecked(gamesProxyModel->getHideIgnoredUserGames());
hideNotBuddyCreatedGames = new QCheckBox(tr("Hide games not created by buddy"));
hideNotBuddyCreatedGames->setChecked(gamesProxyModel->getHideNotBuddyCreatedGames());
maxGameAgeComboBox = new QComboBox();
maxGameAgeComboBox->setEditable(false);
maxGameAgeComboBox->addItems(gameAgeMap.values());
@ -111,6 +114,7 @@ DlgFilterGames::DlgFilterGames(const QMap<int, QString> &_allGameTypes,
restrictionsLayout->addWidget(hidePasswordProtectedGames, 2, 0);
restrictionsLayout->addWidget(hideBuddiesOnlyGames, 3, 0);
restrictionsLayout->addWidget(hideIgnoredUserGames, 4, 0);
restrictionsLayout->addWidget(hideNotBuddyCreatedGames, 5, 0);
auto *restrictionsGroupBox = new QGroupBox(tr("Restrictions"));
restrictionsGroupBox->setLayout(restrictionsLayout);
@ -209,6 +213,11 @@ bool DlgFilterGames::getHideIgnoredUserGames() const
return hideIgnoredUserGames->isChecked();
}
bool DlgFilterGames::getHideNotBuddyCreatedGames() const
{
return hideNotBuddyCreatedGames->isChecked();
}
QString DlgFilterGames::getGameNameFilter() const
{
return gameNameFilterEdit->text();

View file

@ -26,6 +26,7 @@ private:
QCheckBox *hideGamesThatStarted;
QCheckBox *hidePasswordProtectedGames;
QCheckBox *hideIgnoredUserGames;
QCheckBox *hideNotBuddyCreatedGames;
QLineEdit *gameNameFilterEdit;
QLineEdit *creatorNameFilterEdit;
QMap<int, QCheckBox *> gameTypeFilterCheckBoxes;
@ -58,6 +59,7 @@ public:
void setHideBuddiesOnlyGames(bool _hideBuddiesOnlyGames);
bool getHideIgnoredUserGames() const;
void setHideIgnoredUserGames(bool _hideIgnoredUserGames);
bool getHideNotBuddyCreatedGames() const;
QString getGameNameFilter() const;
void setGameNameFilter(const QString &_gameNameFilter);
QString getCreatorNameFilter() const;