mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-24 23:53:54 -07:00
add sort options to card view window (#5206)
* refactor to allow for sorting by property of choice * implement thing * prevent overlapping sort properties * enable/disable pile view checkbox if groupBy is off * fix compiler warnings * check to disable pile view checkbox on init * Fix builds on Qt5 * Fix builds on Qt5 --------- Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
This commit is contained in:
parent
37bb1367db
commit
17eabf2004
10 changed files with 183 additions and 80 deletions
|
|
@ -252,8 +252,8 @@ SettingsCache::SettingsCache()
|
|||
chatMentionColor = settings->value("chat/mentioncolor", "A6120D").toString();
|
||||
chatHighlightColor = settings->value("chat/highlightcolor", "A6120D").toString();
|
||||
|
||||
zoneViewSortByName = settings->value("zoneview/sortbyname", true).toBool();
|
||||
zoneViewSortByType = settings->value("zoneview/sortbytype", true).toBool();
|
||||
zoneViewGroupBy = settings->value("zoneview/groupby", 2).toInt();
|
||||
zoneViewSortBy = settings->value("zoneview/sortby", 1).toInt();
|
||||
zoneViewPileView = settings->value("zoneview/pileview", true).toBool();
|
||||
|
||||
soundEnabled = settings->value("sound/enabled", false).toBool();
|
||||
|
|
@ -582,16 +582,16 @@ void SettingsCache::setChatHighlightColor(const QString &_chatHighlightColor)
|
|||
settings->setValue("chat/highlightcolor", chatHighlightColor);
|
||||
}
|
||||
|
||||
void SettingsCache::setZoneViewSortByName(QT_STATE_CHANGED_T _zoneViewSortByName)
|
||||
void SettingsCache::setZoneViewGroupBy(int _zoneViewGroupBy)
|
||||
{
|
||||
zoneViewSortByName = static_cast<bool>(_zoneViewSortByName);
|
||||
settings->setValue("zoneview/sortbyname", zoneViewSortByName);
|
||||
zoneViewGroupBy = _zoneViewGroupBy;
|
||||
settings->setValue("zoneview/groupby", zoneViewGroupBy);
|
||||
}
|
||||
|
||||
void SettingsCache::setZoneViewSortByType(QT_STATE_CHANGED_T _zoneViewSortByType)
|
||||
void SettingsCache::setZoneViewSortBy(int _zoneViewSortBy)
|
||||
{
|
||||
zoneViewSortByType = static_cast<bool>(_zoneViewSortByType);
|
||||
settings->setValue("zoneview/sortbytype", zoneViewSortByType);
|
||||
zoneViewSortBy = _zoneViewSortBy;
|
||||
settings->setValue("zoneview/sortby", zoneViewSortBy);
|
||||
}
|
||||
|
||||
void SettingsCache::setZoneViewPileView(QT_STATE_CHANGED_T _zoneViewPileView)
|
||||
|
|
|
|||
|
|
@ -109,7 +109,8 @@ private:
|
|||
QString chatHighlightColor;
|
||||
bool chatMentionForeground;
|
||||
bool chatHighlightForeground;
|
||||
bool zoneViewSortByName, zoneViewSortByType, zoneViewPileView;
|
||||
int zoneViewSortBy, zoneViewGroupBy;
|
||||
bool zoneViewPileView;
|
||||
bool soundEnabled;
|
||||
QString soundThemeName;
|
||||
bool ignoreUnregisteredUsers;
|
||||
|
|
@ -327,13 +328,13 @@ public:
|
|||
{
|
||||
return chatHighlightForeground;
|
||||
}
|
||||
bool getZoneViewSortByName() const
|
||||
int getZoneViewGroupBy() const
|
||||
{
|
||||
return zoneViewSortByName;
|
||||
return zoneViewGroupBy;
|
||||
}
|
||||
bool getZoneViewSortByType() const
|
||||
int getZoneViewSortBy() const
|
||||
{
|
||||
return zoneViewSortByType;
|
||||
return zoneViewSortBy;
|
||||
}
|
||||
/**
|
||||
Returns if the view should be sorted into pile view.
|
||||
|
|
@ -563,8 +564,8 @@ public slots:
|
|||
void setChatMentionCompleter(QT_STATE_CHANGED_T _chatMentionCompleter);
|
||||
void setChatMentionForeground(QT_STATE_CHANGED_T _chatMentionForeground);
|
||||
void setChatHighlightForeground(QT_STATE_CHANGED_T _chatHighlightForeground);
|
||||
void setZoneViewSortByName(QT_STATE_CHANGED_T _zoneViewSortByName);
|
||||
void setZoneViewSortByType(QT_STATE_CHANGED_T _zoneViewSortByType);
|
||||
void setZoneViewGroupBy(const int _zoneViewGroupBy);
|
||||
void setZoneViewSortBy(const int _zoneViewSortBy);
|
||||
void setZoneViewPileView(QT_STATE_CHANGED_T _zoneViewPileView);
|
||||
void setSoundEnabled(QT_STATE_CHANGED_T _soundEnabled);
|
||||
void setSoundThemeName(const QString &_soundThemeName);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue