mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-04 04:23:55 -07:00
Fix #3957: Properly set filters to defaults on initial load and disable "Clear filters" button if filters are set to defaults. (#4088)
* Fix #3957: Properly set filters to defaults on initial load and disable "Clear filters" button if filters are set to defaults * Reuse resetFilterParameters() in GamesProxyModel constructor, and remove "off" designation for player min/max (as a default of 1/99 is enforced by the UI).
This commit is contained in:
parent
ade3e81682
commit
79f590c99a
3 changed files with 32 additions and 11 deletions
|
|
@ -76,6 +76,11 @@ private:
|
|||
QSet<int> gameTypeFilter;
|
||||
int maxPlayersFilterMin, maxPlayersFilterMax;
|
||||
|
||||
static const bool DEFAULT_UNAVAILABLE_GAMES_VISIBLE = false;
|
||||
static const bool DEFAULT_SHOW_PASSWORD_PROTECTED_GAMES = true;
|
||||
static const bool DEFAULT_SHOW_BUDDIES_ONLY_GAMES = true;
|
||||
static const bool DEFAULT_HIDE_IGNORED_USER_GAMES = false;
|
||||
static const int DEFAULT_MAX_PLAYERS_MIN = 1;
|
||||
static const int DEFAULT_MAX_PLAYERS_MAX = 99;
|
||||
|
||||
public:
|
||||
|
|
@ -127,6 +132,7 @@ public:
|
|||
void setMaxPlayersFilter(int _maxPlayersFilterMin, int _maxPlayersFilterMax);
|
||||
int getNumFilteredGames() const;
|
||||
void resetFilterParameters();
|
||||
bool areFilterParametersSetToDefaults() const;
|
||||
void loadFilterParameters(const QMap<int, QString> &allGameTypes);
|
||||
void saveFilterParameters(const QMap<int, QString> &allGameTypes);
|
||||
void refresh();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue