Add game filtering for spectator attributes (#4127)

This commit is contained in:
Kaitlin 2020-10-27 15:49:02 -04:00 committed by GitHub
parent 1a94261490
commit a49c4865bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 291 additions and 62 deletions

View file

@ -80,12 +80,15 @@ private:
// - filterAcceptsRow()
bool showBuddiesOnlyGames;
bool hideIgnoredUserGames;
bool unavailableGamesVisible;
bool showFullGames;
bool showGamesThatStarted;
bool showPasswordProtectedGames;
QString gameNameFilter, creatorNameFilter;
QSet<int> gameTypeFilter;
quint32 maxPlayersFilterMin, maxPlayersFilterMax;
QTime maxGameAge;
bool showOnlyIfSpectatorsCanWatch, showSpectatorPasswordProtected, showOnlyIfSpectatorsCanChat,
showOnlyIfSpectatorsCanSeeHands;
public:
GamesProxyModel(QObject *parent = nullptr, const TabSupervisor *_tabSupervisor = nullptr);
@ -100,11 +103,16 @@ public:
return hideIgnoredUserGames;
}
void setHideIgnoredUserGames(bool _hideIgnoredUserGames);
bool getUnavailableGamesVisible() const
bool getShowFullGames() const
{
return unavailableGamesVisible;
return showFullGames;
}
void setUnavailableGamesVisible(bool _unavailableGamesVisible);
void setShowFullGames(bool _showFullGames);
bool getShowGamesThatStarted() const
{
return showGamesThatStarted;
}
void setShowGamesThatStarted(bool _showGamesThatStarted);
bool getShowPasswordProtectedGames() const
{
return showPasswordProtectedGames;
@ -139,6 +147,26 @@ public:
return maxGameAge;
}
void setMaxGameAge(const QTime &_maxGameAge);
bool getShowOnlyIfSpectatorsCanWatch() const
{
return showOnlyIfSpectatorsCanWatch;
}
void setShowOnlyIfSpectatorsCanWatch(bool _showOnlyIfSpectatorsCanWatch);
bool getShowSpectatorPasswordProtected() const
{
return showSpectatorPasswordProtected;
}
void setShowSpectatorPasswordProtected(bool _showSpectatorPasswordProtected);
bool getShowOnlyIfSpectatorsCanChat() const
{
return showOnlyIfSpectatorsCanChat;
}
void setShowOnlyIfSpectatorsCanChat(bool _showOnlyIfSpectatorsCanChat);
bool getShowOnlyIfSpectatorsCanSeeHands() const
{
return showOnlyIfSpectatorsCanSeeHands;
}
void setShowOnlyIfSpectatorsCanSeeHands(bool _showOnlyIfSpectatorsCanSeeHands);
int getNumFilteredGames() const;
void resetFilterParameters();