interface() is a protected keyword for MSVC

Took 5 minutes

Took 5 seconds
This commit is contained in:
Lukas Brübach 2026-08-07 14:31:51 +02:00
parent 53b9ba0976
commit 84c8743fe3
25 changed files with 129 additions and 129 deletions

View file

@ -418,7 +418,7 @@ CardsDisplaySettings &SettingsCache::cardsDisplay() const
return *cardsDisplaySettings; return *cardsDisplaySettings;
} }
InterfaceSettings &SettingsCache::interface() const InterfaceSettings &SettingsCache::userInterface() const
{ {
return *interfaceSettings; return *interfaceSettings;
} }

View file

@ -144,7 +144,7 @@ public:
[[nodiscard]] UpdatesSettings &updates() const; [[nodiscard]] UpdatesSettings &updates() const;
[[nodiscard]] PersonalSettings &personal() const; [[nodiscard]] PersonalSettings &personal() const;
[[nodiscard]] CardsDisplaySettings &cardsDisplay() const; [[nodiscard]] CardsDisplaySettings &cardsDisplay() const;
[[nodiscard]] InterfaceSettings &interface() const; [[nodiscard]] InterfaceSettings &userInterface() const;
[[nodiscard]] DeckEditorSettings &deckEditor() const; [[nodiscard]] DeckEditorSettings &deckEditor() const;
[[nodiscard]] PathsSettings &paths() const; [[nodiscard]] PathsSettings &paths() const;
[[nodiscard]] VisualDeckStorageSettings &visualDeckStorage() const; [[nodiscard]] VisualDeckStorageSettings &visualDeckStorage() const;

View file

@ -69,7 +69,7 @@ void PlayerActions::playCard(CardItem *card, bool faceDown)
const CardInfo &info = exactCard.getInfo(); const CardInfo &info = exactCard.getInfo();
int tableRow = info.getUiAttributes().tableRow; int tableRow = info.getUiAttributes().tableRow;
bool playToStack = SettingsCache::instance().interface().getPlayToStack(); bool playToStack = SettingsCache::instance().userInterface().getPlayToStack();
QString currentZone = card->getZone()->getName(); QString currentZone = card->getZone()->getName();
if (!faceDown && currentZone == ZoneNames::STACK && tableRow == 3) { if (!faceDown && currentZone == ZoneNames::STACK && tableRow == 3) {
cmd.set_target_zone(ZoneNames::GRAVE); cmd.set_target_zone(ZoneNames::GRAVE);
@ -312,7 +312,7 @@ void PlayerActions::actDrawCard()
void PlayerActions::actRequestMulliganDialog() void PlayerActions::actRequestMulliganDialog()
{ {
int startSize = SettingsCache::instance().interface().getStartingHandSize(); int startSize = SettingsCache::instance().userInterface().getStartingHandSize();
int handSize = player->getHandZone()->getCards().size(); int handSize = player->getHandZone()->getCards().size();
int deckSize = player->getDeckZone()->getCards().size() + handSize; int deckSize = player->getDeckZone()->getCards().size() + handSize;
@ -328,7 +328,7 @@ void PlayerActions::actMulligan(int number)
} }
doMulligan(number); doMulligan(number);
SettingsCache::instance().interface().setStartingHandSize(number); SettingsCache::instance().userInterface().setStartingHandSize(number);
} }
void PlayerActions::actMulliganSameSize() void PlayerActions::actMulliganSameSize()
@ -932,13 +932,13 @@ void PlayerActions::setLastTokenInfo(CardInfoPtr cardInfo)
return; return;
} }
lastTokenInfo = {.name = cardInfo->getName(), lastTokenInfo = {
.name = cardInfo->getName(),
.color = cardInfo->getColors().isEmpty() ? QString() : cardInfo->getColors().left(1).toLower(), .color = cardInfo->getColors().isEmpty() ? QString() : cardInfo->getColors().left(1).toLower(),
.pt = cardInfo->getPowTough(), .pt = cardInfo->getPowTough(),
.annotation = SettingsCache::instance().interface().getAnnotateTokens() ? cardInfo->getText() : "", .annotation = SettingsCache::instance().userInterface().getAnnotateTokens() ? cardInfo->getText() : "",
.destroy = true, .destroy = true,
.providerId = .providerId = SettingsCache::instance().cardOverrides().getCardPreferenceOverride(cardInfo->getName())};
SettingsCache::instance().cardOverrides().getCardPreferenceOverride(cardInfo->getName())};
lastTokenTableRow = TableZone::tableRowToGridY(cardInfo->getUiAttributes().tableRow); lastTokenTableRow = TableZone::tableRowToGridY(cardInfo->getUiAttributes().tableRow);
@ -1171,7 +1171,7 @@ void PlayerActions::createCard(const CardItem *sourceCard,
} }
cmd.set_pt(cardInfo->getPowTough().toStdString()); cmd.set_pt(cardInfo->getPowTough().toStdString());
if (SettingsCache::instance().interface().getAnnotateTokens()) { if (SettingsCache::instance().userInterface().getAnnotateTokens()) {
cmd.set_annotation(cardInfo->getText().toStdString()); cmd.set_annotation(cardInfo->getText().toStdString());
} else { } else {
cmd.set_annotation(""); cmd.set_annotation("");

View file

@ -58,7 +58,7 @@ bool ZoneViewZoneLogic::prepareAddCard(int x)
// autoclose check is done both here and in removeCard // autoclose check is done both here and in removeCard
if (cards.isEmpty() && !doInsert && SettingsCache::instance().interface().getCloseEmptyCardView()) { if (cards.isEmpty() && !doInsert && SettingsCache::instance().userInterface().getCloseEmptyCardView()) {
emit closeView(); emit closeView();
} }
@ -145,7 +145,7 @@ void ZoneViewZoneLogic::removeCard(int position, bool toNewZone)
// card gets dragged within the view. // card gets dragged within the view.
// Another autoclose check is done in prepareAddCard so that the view autocloses if the last card was moved to an // Another autoclose check is done in prepareAddCard so that the view autocloses if the last card was moved to an
// unrevealed portion of the same zone. // unrevealed portion of the same zone.
if (cards.isEmpty() && SettingsCache::instance().interface().getCloseEmptyCardView() && toNewZone) { if (cards.isEmpty() && SettingsCache::instance().userInterface().getCloseEmptyCardView() && toNewZone) {
emit closeView(); emit closeView();
return; return;
} }

View file

@ -262,7 +262,7 @@ void ArrowDragItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
if (startZone->getName() == ZoneNames::HAND) { if (startZone->getName() == ZoneNames::HAND) {
startCard->playCard(false); startCard->playCard(false);
CardInfoPtr ci = startCard->getCard().getCardPtr(); CardInfoPtr ci = startCard->getCard().getCardPtr();
bool playToStack = SettingsCache::instance().interface().getPlayToStack(); bool playToStack = SettingsCache::instance().userInterface().getPlayToStack();
if (ci && ((!playToStack && ci->getUiAttributes().tableRow == 3) || if (ci && ((!playToStack && ci->getUiAttributes().tableRow == 3) ||
(playToStack && ci->getUiAttributes().tableRow != 0 && (playToStack && ci->getUiAttributes().tableRow != 0 &&
startCard->getZone()->getName() != ZoneNames::STACK))) { startCard->getZone()->getName() != ZoneNames::STACK))) {

View file

@ -281,7 +281,7 @@ void CardItem::drawArrow(const QColor &arrowColor)
auto *game = owner->getGame(); auto *game = owner->getGame();
PlayerLogic *arrowOwner = game->getPlayerManager()->getActiveLocalPlayer(game->getGameState()->getActivePlayer()); PlayerLogic *arrowOwner = game->getPlayerManager()->getActiveLocalPlayer(game->getGameState()->getActivePlayer());
int phase = 0; // 0 means to not set the phase int phase = 0; // 0 means to not set the phase
if (SettingsCache::instance().interface().getDoNotDeleteArrowsInSubPhases()) { if (SettingsCache::instance().userInterface().getDoNotDeleteArrowsInSubPhases()) {
int currentPhase = game->getGameState()->getCurrentPhase(); int currentPhase = game->getGameState()->getCurrentPhase();
phase = Phases::getLastSubphase(currentPhase) + 1; phase = Phases::getLastSubphase(currentPhase) + 1;
} }
@ -400,7 +400,7 @@ void CardItem::playCard(bool faceDown)
if (tz) { if (tz) {
emit tz->toggleTapped(); emit tz->toggleTapped();
} else { } else {
if (SettingsCache::instance().interface().getClickPlaysAllSelected()) { if (SettingsCache::instance().userInterface().getClickPlaysAllSelected()) {
if (faceDown) { if (faceDown) {
emit playSelectedFaceDown(this); emit playSelectedFaceDown(this);
} else { } else {
@ -464,7 +464,7 @@ static bool isUnwritableRevealZone(CardZoneLogic *zone)
void CardItem::handleClickedToPlay(bool shiftHeld) void CardItem::handleClickedToPlay(bool shiftHeld)
{ {
if (isUnwritableRevealZone(state->getZone())) { if (isUnwritableRevealZone(state->getZone())) {
if (SettingsCache::instance().interface().getClickPlaysAllSelected()) { if (SettingsCache::instance().userInterface().getClickPlaysAllSelected()) {
emit hideSelected(this); emit hideSelected(this);
} else { } else {
state->getZone()->removeCard(this); state->getZone()->removeCard(this);
@ -481,7 +481,7 @@ void CardItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
return; return;
} }
if ((event->modifiers() != Qt::AltModifier) && (event->button() == Qt::LeftButton) && if ((event->modifiers() != Qt::AltModifier) && (event->button() == Qt::LeftButton) &&
(!SettingsCache::instance().interface().getDoubleClickToPlay())) { (!SettingsCache::instance().userInterface().getDoubleClickToPlay())) {
handleClickedToPlay(event->modifiers().testFlag(Qt::ShiftModifier)); handleClickedToPlay(event->modifiers().testFlag(Qt::ShiftModifier));
} }
if (owner != nullptr) { if (owner != nullptr) {
@ -493,7 +493,7 @@ void CardItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
void CardItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) void CardItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
{ {
if ((event->modifiers() != Qt::AltModifier) && (event->buttons() == Qt::LeftButton) && if ((event->modifiers() != Qt::AltModifier) && (event->buttons() == Qt::LeftButton) &&
(SettingsCache::instance().interface().getDoubleClickToPlay())) { (SettingsCache::instance().userInterface().getDoubleClickToPlay())) {
handleClickedToPlay(event->modifiers().testFlag(Qt::ShiftModifier)); handleClickedToPlay(event->modifiers().testFlag(Qt::ShiftModifier));
} }
event->accept(); event->accept();

View file

@ -189,7 +189,7 @@ void DlgCreateToken::tokenSelectionChanged(const QModelIndex &current, const QMo
const QChar cardColor = cardInfo->getColorChar(); const QChar cardColor = cardInfo->getColorChar();
colorEdit->setCurrentIndex(colorEdit->findData(cardColor, Qt::UserRole, Qt::MatchFixedString)); colorEdit->setCurrentIndex(colorEdit->findData(cardColor, Qt::UserRole, Qt::MatchFixedString));
ptEdit->setText(cardInfo->getPowTough()); ptEdit->setText(cardInfo->getPowTough());
if (SettingsCache::instance().interface().getAnnotateTokens()) { if (SettingsCache::instance().userInterface().getAnnotateTokens()) {
annotationEdit->setText(cardInfo->getText()); annotationEdit->setText(cardInfo->getText());
} }
} else { } else {

View file

@ -37,7 +37,7 @@ GameScene::GameScene(PhasesToolbar *_phasesToolbar, QObject *parent)
{ {
animationTimer = new QBasicTimer; animationTimer = new QBasicTimer;
addItem(phasesToolbar); addItem(phasesToolbar);
connect(&SettingsCache::instance().interface(), &InterfaceSettings::minPlayersForMultiColumnLayoutChanged, this, connect(&SettingsCache::instance().userInterface(), &InterfaceSettings::minPlayersForMultiColumnLayoutChanged, this,
&GameScene::rearrange); &GameScene::rearrange);
rearrange(); rearrange();
@ -336,7 +336,7 @@ QList<PlayerLogic *> GameScene::rotatePlayers(const QList<PlayerLogic *> &active
int GameScene::determineColumnCount(int playerCount) int GameScene::determineColumnCount(int playerCount)
{ {
return playerCount < SettingsCache::instance().interface().getMinPlayersForMultiColumnLayout() ? 1 : 2; return playerCount < SettingsCache::instance().userInterface().getMinPlayersForMultiColumnLayout() ? 1 : 2;
} }
/** /**

View file

@ -47,11 +47,11 @@ GameView::GameView(GameScene *scene, QWidget *parent) : QGraphicsView(scene, par
connect(scene, &GameScene::sigResizeRubberBand, this, &GameView::resizeRubberBand); connect(scene, &GameScene::sigResizeRubberBand, this, &GameView::resizeRubberBand);
connect(scene, &GameScene::sigStopRubberBand, this, &GameView::stopRubberBand); connect(scene, &GameScene::sigStopRubberBand, this, &GameView::stopRubberBand);
connect(scene, &QGraphicsScene::selectionChanged, this, [this]() { updateTotalSelectionCount(); }); connect(scene, &QGraphicsScene::selectionChanged, this, [this]() { updateTotalSelectionCount(); });
connect(&SettingsCache::instance().interface(), &InterfaceSettings::tallyTypeChanged, this, connect(&SettingsCache::instance().userInterface(), &InterfaceSettings::tallyTypeChanged, this,
[this] { updateTotalSelectionCount(); }); [this] { updateTotalSelectionCount(); });
setFocusDisabled(SettingsCache::instance().interface().getKeepGameChatFocus()); setFocusDisabled(SettingsCache::instance().userInterface().getKeepGameChatFocus());
connect(&SettingsCache::instance().interface(), &InterfaceSettings::keepGameChatFocusChanged, this, connect(&SettingsCache::instance().userInterface(), &InterfaceSettings::keepGameChatFocusChanged, this,
&GameView::setFocusDisabled); &GameView::setFocusDisabled);
aCloseMostRecentZoneView = new QAction(this); aCloseMostRecentZoneView = new QAction(this);
@ -130,7 +130,7 @@ void GameView::resizeRubberBand(const QPointF &cursorPoint, int selectedCount)
QRect rect = QRect(mapFromScene(selectionOrigin), cursor).normalized(); QRect rect = QRect(mapFromScene(selectionOrigin), cursor).normalized();
rubberBand->setGeometry(rect); rubberBand->setGeometry(rect);
if (!SettingsCache::instance().interface().getShowDragSelectionCount()) { if (!SettingsCache::instance().userInterface().getShowDragSelectionCount()) {
dragCountLabel->hide(); dragCountLabel->hide();
return; return;
} }
@ -239,7 +239,7 @@ void GameView::updateTotalSelectionCount(const QSize &viewSize)
int count = scene()->selectedItems().count(); int count = scene()->selectedItems().count();
if (!SettingsCache::instance().interface().getShowTotalSelectionCount() || count <= 1) { if (!SettingsCache::instance().userInterface().getShowTotalSelectionCount() || count <= 1) {
totalCountLabel->hide(); totalCountLabel->hide();
} else { } else {
totalCountLabel->setText(QString::number(count)); totalCountLabel->setText(QString::number(count));
@ -251,7 +251,7 @@ void GameView::updateTotalSelectionCount(const QSize &viewSize)
totalCountLabel->show(); totalCountLabel->show();
} }
TallyType tallyType = Tally::intToType(SettingsCache::instance().interface().getTallyType()); TallyType tallyType = Tally::intToType(SettingsCache::instance().userInterface().getTallyType());
GameScene *gameScene = static_cast<GameScene *>(scene()); GameScene *gameScene = static_cast<GameScene *>(scene());
QList<TallyRow> entries = Tally::compute(gameScene->selectedCards(), tallyType); QList<TallyRow> entries = Tally::compute(gameScene->selectedCards(), tallyType);

View file

@ -23,14 +23,14 @@ TallyMenu::TallyMenu()
QAction *TallyMenu::createTallyAction(TallyType tallyType) QAction *TallyMenu::createTallyAction(TallyType tallyType)
{ {
TallyType currentType = Tally::intToType(SettingsCache::instance().interface().getTallyType()); TallyType currentType = Tally::intToType(SettingsCache::instance().userInterface().getTallyType());
QAction *action = new QAction(this); QAction *action = new QAction(this);
action->setCheckable(true); action->setCheckable(true);
action->setChecked(tallyType == currentType); action->setChecked(tallyType == currentType);
connect(action, &QAction::triggered, &SettingsCache::instance().interface(), connect(action, &QAction::triggered, &SettingsCache::instance().userInterface(),
[tallyType] { SettingsCache::instance().interface().setTallyType(static_cast<int>(tallyType)); }); [tallyType] { SettingsCache::instance().userInterface().setTallyType(static_cast<int>(tallyType)); });
actionGroup->addAction(action); actionGroup->addAction(action);

View file

@ -17,9 +17,9 @@
PlayerGraphicsItem::PlayerGraphicsItem(PlayerLogic *_player) : player(_player) PlayerGraphicsItem::PlayerGraphicsItem(PlayerLogic *_player) : player(_player)
{ {
connect(&SettingsCache::instance().interface(), &InterfaceSettings::horizontalHandChanged, this, connect(&SettingsCache::instance().userInterface(), &InterfaceSettings::horizontalHandChanged, this,
&PlayerGraphicsItem::rearrangeZones); &PlayerGraphicsItem::rearrangeZones);
connect(&SettingsCache::instance().interface(), &InterfaceSettings::handJustificationChanged, this, connect(&SettingsCache::instance().userInterface(), &InterfaceSettings::handJustificationChanged, this,
&PlayerGraphicsItem::rearrangeZones); &PlayerGraphicsItem::rearrangeZones);
connect(player, &PlayerLogic::rearrangeCounters, this, &PlayerGraphicsItem::rearrangeCounters); connect(player, &PlayerLogic::rearrangeCounters, this, &PlayerGraphicsItem::rearrangeCounters);
connect(player, &PlayerLogic::activeChanged, this, &PlayerGraphicsItem::onPlayerActiveChanged); connect(player, &PlayerLogic::activeChanged, this, &PlayerGraphicsItem::onPlayerActiveChanged);
@ -149,7 +149,7 @@ qreal PlayerGraphicsItem::getMinimumWidth() const
{ {
qreal result = tableZoneGraphicsItem->getMinimumWidth() + CardDimensions::HEIGHT_F + 15 + counterAreaWidth + qreal result = tableZoneGraphicsItem->getMinimumWidth() + CardDimensions::HEIGHT_F + 15 + counterAreaWidth +
stackZoneGraphicsItem->boundingRect().width(); stackZoneGraphicsItem->boundingRect().width();
if (!SettingsCache::instance().interface().getHorizontalHand()) { if (!SettingsCache::instance().userInterface().getHorizontalHand()) {
result += handZoneGraphicsItem->boundingRect().width(); result += handZoneGraphicsItem->boundingRect().width();
} }
return result; return result;
@ -166,7 +166,7 @@ void PlayerGraphicsItem::processSceneSizeChange(int newPlayerWidth)
// Extend table (and hand, if horizontal) to accommodate the new player width. // Extend table (and hand, if horizontal) to accommodate the new player width.
qreal tableWidth = newPlayerWidth - CardDimensions::HEIGHT_F - 15 - counterAreaWidth - qreal tableWidth = newPlayerWidth - CardDimensions::HEIGHT_F - 15 - counterAreaWidth -
stackZoneGraphicsItem->boundingRect().width(); stackZoneGraphicsItem->boundingRect().width();
if (!SettingsCache::instance().interface().getHorizontalHand()) { if (!SettingsCache::instance().userInterface().getHorizontalHand()) {
tableWidth -= handZoneGraphicsItem->boundingRect().width(); tableWidth -= handZoneGraphicsItem->boundingRect().width();
} }
@ -234,7 +234,7 @@ void PlayerGraphicsItem::rearrangeCounters()
void PlayerGraphicsItem::rearrangeZones() void PlayerGraphicsItem::rearrangeZones()
{ {
auto base = QPointF(CardDimensions::HEIGHT_F + counterAreaWidth + 15, 0); auto base = QPointF(CardDimensions::HEIGHT_F + counterAreaWidth + 15, 0);
if (SettingsCache::instance().interface().getHorizontalHand()) { if (SettingsCache::instance().userInterface().getHorizontalHand()) {
if (mirrored) { if (mirrored) {
if (player->getHandZone()->contentsKnown()) { if (player->getHandZone()->contentsKnown()) {
handVisible = true; handVisible = true;
@ -285,7 +285,7 @@ void PlayerGraphicsItem::updateBoundingRect()
{ {
prepareGeometryChange(); prepareGeometryChange();
qreal width = CardDimensions::HEIGHT_F + 15 + counterAreaWidth + stackZoneGraphicsItem->boundingRect().width(); qreal width = CardDimensions::HEIGHT_F + 15 + counterAreaWidth + stackZoneGraphicsItem->boundingRect().width();
if (SettingsCache::instance().interface().getHorizontalHand()) { if (SettingsCache::instance().userInterface().getHorizontalHand()) {
qreal handHeight = handVisible ? handZoneGraphicsItem->boundingRect().height() : 0; qreal handHeight = handVisible ? handZoneGraphicsItem->boundingRect().height() : 0;
bRect = QRectF(0, 0, width + tableZoneGraphicsItem->boundingRect().width(), bRect = QRectF(0, 0, width + tableZoneGraphicsItem->boundingRect().width(),
tableZoneGraphicsItem->boundingRect().height() + handHeight); tableZoneGraphicsItem->boundingRect().height() + handHeight);

View file

@ -34,7 +34,7 @@ void HandZone::handleDropEvent(const QList<CardDragItem *> &dragItems,
QPoint point = dropPoint + scenePos().toPoint(); QPoint point = dropPoint + scenePos().toPoint();
int x = -1; int x = -1;
if (SettingsCache::instance().interface().getHorizontalHand()) { if (SettingsCache::instance().userInterface().getHorizontalHand()) {
for (x = 0; x < getLogic()->getCards().size(); x++) { for (x = 0; x < getLogic()->getCards().size(); x++) {
if (point.x() < static_cast<CardItem *>(getLogic()->getCards().at(x))->scenePos().x()) { if (point.x() < static_cast<CardItem *>(getLogic()->getCards().at(x))->scenePos().x()) {
break; break;
@ -61,7 +61,7 @@ void HandZone::handleDropEvent(const QList<CardDragItem *> &dragItems,
QRectF HandZone::boundingRect() const QRectF HandZone::boundingRect() const
{ {
if (SettingsCache::instance().interface().getHorizontalHand()) { if (SettingsCache::instance().userInterface().getHorizontalHand()) {
return QRectF(0, 0, width, CardDimensions::HEIGHT_F + 10); return QRectF(0, 0, width, CardDimensions::HEIGHT_F + 10);
} else { } else {
return QRectF(0, 0, CardDimensions::WIDTH_F * 1.5, zoneHeight); return QRectF(0, 0, CardDimensions::WIDTH_F * 1.5, zoneHeight);
@ -78,8 +78,8 @@ void HandZone::reorganizeCards()
{ {
if (!getLogic()->getCards().isEmpty()) { if (!getLogic()->getCards().isEmpty()) {
const int cardCount = getLogic()->getCards().size(); const int cardCount = getLogic()->getCards().size();
if (SettingsCache::instance().interface().getHorizontalHand()) { if (SettingsCache::instance().userInterface().getHorizontalHand()) {
bool leftJustified = SettingsCache::instance().interface().getLeftJustified(); bool leftJustified = SettingsCache::instance().userInterface().getLeftJustified();
qreal cardWidth = getLogic()->getCards().at(0)->boundingRect().width(); qreal cardWidth = getLogic()->getCards().at(0)->boundingRect().width();
const int xPadding = leftJustified ? cardWidth * 1.4 : 5; const int xPadding = leftJustified ? cardWidth * 1.4 : 5;
qreal totalWidth = qreal totalWidth =
@ -127,7 +127,7 @@ void HandZone::sortHand(const QList<CardList::SortOption> &options)
void HandZone::setWidth(qreal _width) void HandZone::setWidth(qreal _width)
{ {
if (SettingsCache::instance().interface().getHorizontalHand()) { if (SettingsCache::instance().userInterface().getHorizontalHand()) {
prepareGeometryChange(); prepareGeometryChange();
width = _width; width = _width;
reorganizeCards(); reorganizeCards();

View file

@ -29,7 +29,7 @@ TableZone::TableZone(TableZoneLogic *_logic, bool _mirrored, QGraphicsItem *pare
connect(_logic, &TableZoneLogic::contentSizeChanged, this, &TableZone::resizeToContents); connect(_logic, &TableZoneLogic::contentSizeChanged, this, &TableZone::resizeToContents);
connect(_logic, &TableZoneLogic::toggleTapped, this, &TableZone::toggleTapped); connect(_logic, &TableZoneLogic::toggleTapped, this, &TableZone::toggleTapped);
connect(themeManager, &ThemeManager::themeChanged, this, &TableZone::updateBg); connect(themeManager, &ThemeManager::themeChanged, this, &TableZone::updateBg);
connect(&SettingsCache::instance().interface(), &InterfaceSettings::invertVerticalCoordinateChanged, this, connect(&SettingsCache::instance().userInterface(), &InterfaceSettings::invertVerticalCoordinateChanged, this,
&TableZone::reorganizeCards); &TableZone::reorganizeCards);
updateBg(); updateBg();
@ -60,8 +60,8 @@ void TableZone::setMirrored(bool isMirrored)
bool TableZone::isInverted() const bool TableZone::isInverted() const
{ {
return ((mirrored && !SettingsCache::instance().interface().getInvertVerticalCoordinate()) || return ((mirrored && !SettingsCache::instance().userInterface().getInvertVerticalCoordinate()) ||
(!mirrored && SettingsCache::instance().interface().getInvertVerticalCoordinate())); (!mirrored && SettingsCache::instance().userInterface().getInvertVerticalCoordinate()));
} }
void TableZone::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*option*/, QWidget * /*widget*/) void TableZone::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*option*/, QWidget * /*widget*/)

View file

@ -66,7 +66,7 @@ ZoneViewWidget::ZoneViewWidget(PlayerLogic *_player,
connect(help, &QAction::triggered, this, [this] { createSearchSyntaxHelpWindow(&searchEdit); }); connect(help, &QAction::triggered, this, [this] { createSearchSyntaxHelpWindow(&searchEdit); });
if (SettingsCache::instance().interface().getFocusCardViewSearchBar()) { if (SettingsCache::instance().userInterface().getFocusCardViewSearchBar()) {
this->setActive(true); this->setActive(true);
searchEdit.setFocus(); searchEdit.setFocus();
} }
@ -77,9 +77,9 @@ ZoneViewWidget::ZoneViewWidget(PlayerLogic *_player,
vbox->addItem(searchEditProxy); vbox->addItem(searchEditProxy);
// hide search bar if chat autofocus setting is enabled, since typing into it will no longer work anyway // hide search bar if chat autofocus setting is enabled, since typing into it will no longer work anyway
searchEditProxy->setVisible(!SettingsCache::instance().interface().getKeepGameChatFocus()); searchEditProxy->setVisible(!SettingsCache::instance().userInterface().getKeepGameChatFocus());
connect(&SettingsCache::instance().interface(), &InterfaceSettings::keepGameChatFocusChanged, searchEditProxy, connect(&SettingsCache::instance().userInterface(), &InterfaceSettings::keepGameChatFocusChanged,
[searchEditProxy](bool keepFocus) { searchEditProxy->setVisible(!keepFocus); }); searchEditProxy, [searchEditProxy](bool keepFocus) { searchEditProxy->setVisible(!keepFocus); });
// top row // top row
QGraphicsLinearLayout *hTopRow = new QGraphicsLinearLayout(Qt::Horizontal); QGraphicsLinearLayout *hTopRow = new QGraphicsLinearLayout(Qt::Horizontal);
@ -159,9 +159,9 @@ ZoneViewWidget::ZoneViewWidget(PlayerLogic *_player,
connect(&sortBySelector, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, connect(&sortBySelector, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
&ZoneViewWidget::processSortBy); &ZoneViewWidget::processSortBy);
connect(&pileViewCheckBox, &QCheckBox::QT_STATE_CHANGED, this, &ZoneViewWidget::processSetPileView); connect(&pileViewCheckBox, &QCheckBox::QT_STATE_CHANGED, this, &ZoneViewWidget::processSetPileView);
groupBySelector.setCurrentIndex(SettingsCache::instance().interface().getZoneViewGroupByIndex()); groupBySelector.setCurrentIndex(SettingsCache::instance().userInterface().getZoneViewGroupByIndex());
sortBySelector.setCurrentIndex(SettingsCache::instance().interface().getZoneViewSortByIndex()); sortBySelector.setCurrentIndex(SettingsCache::instance().userInterface().getZoneViewSortByIndex());
pileViewCheckBox.setChecked(SettingsCache::instance().interface().getZoneViewPileView()); pileViewCheckBox.setChecked(SettingsCache::instance().userInterface().getZoneViewPileView());
if (CardList::NoSort == static_cast<CardList::SortOption>(groupBySelector.currentData().toInt())) { if (CardList::NoSort == static_cast<CardList::SortOption>(groupBySelector.currentData().toInt())) {
pileViewCheckBox.setEnabled(false); pileViewCheckBox.setEnabled(false);
@ -191,7 +191,7 @@ ZoneViewWidget::ZoneViewWidget(PlayerLogic *_player,
void ZoneViewWidget::processGroupBy(int index) void ZoneViewWidget::processGroupBy(int index)
{ {
auto option = static_cast<CardList::SortOption>(groupBySelector.itemData(index).toInt()); auto option = static_cast<CardList::SortOption>(groupBySelector.itemData(index).toInt());
SettingsCache::instance().interface().setZoneViewGroupByIndex(index); SettingsCache::instance().userInterface().setZoneViewGroupByIndex(index);
zone->setGroupBy(option); zone->setGroupBy(option);
// disable pile view checkbox if we're not grouping by anything // disable pile view checkbox if we're not grouping by anything
@ -215,13 +215,13 @@ void ZoneViewWidget::processSortBy(int index)
return; return;
} }
SettingsCache::instance().interface().setZoneViewSortByIndex(index); SettingsCache::instance().userInterface().setZoneViewSortByIndex(index);
zone->setSortBy(option); zone->setSortBy(option);
} }
void ZoneViewWidget::processSetPileView(QT_STATE_CHANGED_T value) void ZoneViewWidget::processSetPileView(QT_STATE_CHANGED_T value)
{ {
SettingsCache::instance().interface().setZoneViewPileView(value); SettingsCache::instance().userInterface().setZoneViewPileView(value);
zone->setPileView(value); zone->setPileView(value);
} }
@ -478,7 +478,7 @@ static qreal rowsToHeight(int rows)
**/ **/
static qreal calcMaxInitialHeight() static qreal calcMaxInitialHeight()
{ {
return rowsToHeight(SettingsCache::instance().interface().getCardViewInitialRowsMax()); return rowsToHeight(SettingsCache::instance().userInterface().getCardViewInitialRowsMax());
} }
/** /**
@ -560,7 +560,7 @@ void ZoneViewWidget::initStyleOption(QStyleOption *option) const
void ZoneViewWidget::expandWindow() void ZoneViewWidget::expandWindow()
{ {
qreal maxInitialHeight = calcMaxInitialHeight(); qreal maxInitialHeight = calcMaxInitialHeight();
qreal maxExpandedHeight = rowsToHeight(SettingsCache::instance().interface().getCardViewExpandedRowsMax()); qreal maxExpandedHeight = rowsToHeight(SettingsCache::instance().userInterface().getCardViewExpandedRowsMax());
qreal height = rect().height() - extraHeight - 10; qreal height = rect().height() - extraHeight - 10;
qreal maxHeight = maximumHeight() - extraHeight - 10; qreal maxHeight = maximumHeight() - extraHeight - 10;

View file

@ -16,16 +16,16 @@ class TearOffMenu : public QMenu
public: public:
explicit TearOffMenu(const QString &title, QWidget *parent = nullptr) : QMenu(title, parent) explicit TearOffMenu(const QString &title, QWidget *parent = nullptr) : QMenu(title, parent)
{ {
connect(&SettingsCache::instance().interface(), &InterfaceSettings::useTearOffMenusChanged, this, connect(&SettingsCache::instance().userInterface(), &InterfaceSettings::useTearOffMenusChanged, this,
[this](const bool state) { setTearOffEnabled(state); }); [this](const bool state) { setTearOffEnabled(state); });
setTearOffEnabled(SettingsCache::instance().interface().getUseTearOffMenus()); setTearOffEnabled(SettingsCache::instance().userInterface().getUseTearOffMenus());
} }
explicit TearOffMenu(QWidget *parent = nullptr) : QMenu(parent) explicit TearOffMenu(QWidget *parent = nullptr) : QMenu(parent)
{ {
connect(&SettingsCache::instance().interface(), &InterfaceSettings::useTearOffMenusChanged, this, connect(&SettingsCache::instance().userInterface(), &InterfaceSettings::useTearOffMenusChanged, this,
[this](const bool state) { setTearOffEnabled(state); }); [this](const bool state) { setTearOffEnabled(state); });
setTearOffEnabled(SettingsCache::instance().interface().getUseTearOffMenus()); setTearOffEnabled(SettingsCache::instance().userInterface().getUseTearOffMenus());
} }
TearOffMenu *addTearOffMenu(const QString &title) TearOffMenu *addTearOffMenu(const QString &title)

View file

@ -94,7 +94,7 @@ void ReplayManager::handleBackwardsSkip(bool doRewindBuffering)
// The rewind only happens once the timer runs out. // The rewind only happens once the timer runs out.
// If another backwards skip happens, the timer will just get reset instead of rewinding. // If another backwards skip happens, the timer will just get reset instead of rewinding.
rewindBufferingTimer->stop(); rewindBufferingTimer->stop();
rewindBufferingTimer->start(SettingsCache::instance().interface().getRewindBufferingMs()); rewindBufferingTimer->start(SettingsCache::instance().userInterface().getRewindBufferingMs());
} else { } else {
// otherwise, process the rewind immediately // otherwise, process the rewind immediately
processRewind(); processRewind();

View file

@ -14,7 +14,7 @@ ReplayQuickSettingsWidget::ReplayQuickSettingsWidget(QWidget *parent) : Settings
fastForwardSpeedBox.setMinimum(1); fastForwardSpeedBox.setMinimum(1);
fastForwardSpeedBox.setMaximum(99.9); fastForwardSpeedBox.setMaximum(99.9);
fastForwardSpeedBox.setDecimals(1); fastForwardSpeedBox.setDecimals(1);
fastForwardSpeedBox.setValue(SettingsCache::instance().interface().getFastForwardSpeed()); fastForwardSpeedBox.setValue(SettingsCache::instance().userInterface().getFastForwardSpeed());
connect(&fastForwardSpeedBox, qOverload<double>(&QDoubleSpinBox::valueChanged), this, connect(&fastForwardSpeedBox, qOverload<double>(&QDoubleSpinBox::valueChanged), this,
&ReplayQuickSettingsWidget::actUpdateFastForwardSpeed); &ReplayQuickSettingsWidget::actUpdateFastForwardSpeed);
@ -40,6 +40,6 @@ void ReplayQuickSettingsWidget::retranslateUi()
void ReplayQuickSettingsWidget::actUpdateFastForwardSpeed(qreal value) void ReplayQuickSettingsWidget::actUpdateFastForwardSpeed(qreal value)
{ {
SettingsCache::instance().interface().setFastForwardSpeed(value); SettingsCache::instance().userInterface().setFastForwardSpeed(value);
emit fastForwardSpeedChanged(value); emit fastForwardSpeedChanged(value);
} }

View file

@ -98,7 +98,7 @@ void ReplayWidget::replayPlayButtonToggled(bool checked)
void ReplayWidget::updateTimeScaleFactor(bool isFastForward) void ReplayWidget::updateTimeScaleFactor(bool isFastForward)
{ {
qreal factor = isFastForward ? SettingsCache::instance().interface().getFastForwardSpeed() : 1.0; qreal factor = isFastForward ? SettingsCache::instance().userInterface().getFastForwardSpeed() : 1.0;
replayManager->setTimeScaleFactor(factor); replayManager->setTimeScaleFactor(factor);
} }

View file

@ -80,12 +80,12 @@ GameSelector::GameSelector(AbstractClient *_client,
if (showFilters && restoresettings) { if (showFilters && restoresettings) {
quickFilterToolBar = new GameSelectorQuickFilterToolBar(this, tabSupervisor, gameListProxyModel, gameTypeMap); quickFilterToolBar = new GameSelectorQuickFilterToolBar(this, tabSupervisor, gameListProxyModel, gameTypeMap);
quickFilterToolBar->setVisible(showFilters && restoresettings && quickFilterToolBar->setVisible(showFilters && restoresettings &&
SettingsCache::instance().interface().getShowGameSelectorFilterToolbar()); SettingsCache::instance().userInterface().getShowGameSelectorFilterToolbar());
connect(&SettingsCache::instance().interface(), &InterfaceSettings::showGameSelectorFilterToolbarChanged, this, connect(&SettingsCache::instance().userInterface(), &InterfaceSettings::showGameSelectorFilterToolbarChanged,
[this] { this, [this] {
quickFilterToolBar->setVisible( quickFilterToolBar->setVisible(
SettingsCache::instance().interface().getShowGameSelectorFilterToolbar()); SettingsCache::instance().userInterface().getShowGameSelectorFilterToolbar());
}); });
} else { } else {
quickFilterToolBar = nullptr; quickFilterToolBar = nullptr;

View file

@ -209,12 +209,12 @@ AppearanceSettingsPage::AppearanceSettingsPage()
&CardsDisplaySettings::setStackCardOverlapPercent); &CardsDisplaySettings::setStackCardOverlapPercent);
cardViewInitialRowsMaxBox.setRange(1, 999); cardViewInitialRowsMaxBox.setRange(1, 999);
cardViewInitialRowsMaxBox.setValue(SettingsCache::instance().interface().getCardViewInitialRowsMax()); cardViewInitialRowsMaxBox.setValue(SettingsCache::instance().userInterface().getCardViewInitialRowsMax());
connect(&cardViewInitialRowsMaxBox, qOverload<int>(&QSpinBox::valueChanged), this, connect(&cardViewInitialRowsMaxBox, qOverload<int>(&QSpinBox::valueChanged), this,
&AppearanceSettingsPage::cardViewInitialRowsMaxChanged); &AppearanceSettingsPage::cardViewInitialRowsMaxChanged);
cardViewExpandedRowsMaxBox.setRange(1, 999); cardViewExpandedRowsMaxBox.setRange(1, 999);
cardViewExpandedRowsMaxBox.setValue(SettingsCache::instance().interface().getCardViewExpandedRowsMax()); cardViewExpandedRowsMaxBox.setValue(SettingsCache::instance().userInterface().getCardViewExpandedRowsMax());
connect(&cardViewExpandedRowsMaxBox, qOverload<int>(&QSpinBox::valueChanged), this, connect(&cardViewExpandedRowsMaxBox, qOverload<int>(&QSpinBox::valueChanged), this,
&AppearanceSettingsPage::cardViewExpandedRowsMaxChanged); &AppearanceSettingsPage::cardViewExpandedRowsMaxChanged);
@ -276,12 +276,12 @@ AppearanceSettingsPage::AppearanceSettingsPage()
cardCountersGroupBox->setLayout(cardCountersLayout); cardCountersGroupBox->setLayout(cardCountersLayout);
// Hand layout // Hand layout
horizontalHandCheckBox.setChecked(settings.interface().getHorizontalHand()); horizontalHandCheckBox.setChecked(settings.userInterface().getHorizontalHand());
connect(&horizontalHandCheckBox, &QCheckBox::QT_STATE_CHANGED, &settings.interface(), connect(&horizontalHandCheckBox, &QCheckBox::QT_STATE_CHANGED, &settings.userInterface(),
&InterfaceSettings::setHorizontalHand); &InterfaceSettings::setHorizontalHand);
leftJustifiedHandCheckBox.setChecked(settings.interface().getLeftJustified()); leftJustifiedHandCheckBox.setChecked(settings.userInterface().getLeftJustified());
connect(&leftJustifiedHandCheckBox, &QCheckBox::QT_STATE_CHANGED, &settings.interface(), connect(&leftJustifiedHandCheckBox, &QCheckBox::QT_STATE_CHANGED, &settings.userInterface(),
&InterfaceSettings::setLeftJustified); &InterfaceSettings::setLeftJustified);
auto *handGrid = new QGridLayout; auto *handGrid = new QGridLayout;
@ -292,13 +292,13 @@ AppearanceSettingsPage::AppearanceSettingsPage()
handGroupBox->setLayout(handGrid); handGroupBox->setLayout(handGrid);
// table grid layout // table grid layout
invertVerticalCoordinateCheckBox.setChecked(settings.interface().getInvertVerticalCoordinate()); invertVerticalCoordinateCheckBox.setChecked(settings.userInterface().getInvertVerticalCoordinate());
connect(&invertVerticalCoordinateCheckBox, &QCheckBox::QT_STATE_CHANGED, &settings.interface(), connect(&invertVerticalCoordinateCheckBox, &QCheckBox::QT_STATE_CHANGED, &settings.userInterface(),
&InterfaceSettings::setInvertVerticalCoordinate); &InterfaceSettings::setInvertVerticalCoordinate);
minPlayersForMultiColumnLayoutEdit.setMinimum(2); minPlayersForMultiColumnLayoutEdit.setMinimum(2);
minPlayersForMultiColumnLayoutEdit.setValue(settings.interface().getMinPlayersForMultiColumnLayout()); minPlayersForMultiColumnLayoutEdit.setValue(settings.userInterface().getMinPlayersForMultiColumnLayout());
connect(&minPlayersForMultiColumnLayoutEdit, qOverload<int>(&QSpinBox::valueChanged), &settings.interface(), connect(&minPlayersForMultiColumnLayoutEdit, qOverload<int>(&QSpinBox::valueChanged), &settings.userInterface(),
&InterfaceSettings::setMinPlayersForMultiColumnLayout); &InterfaceSettings::setMinPlayersForMultiColumnLayout);
minPlayersForMultiColumnLayoutLabel.setBuddy(&minPlayersForMultiColumnLayoutEdit); minPlayersForMultiColumnLayoutLabel.setBuddy(&minPlayersForMultiColumnLayoutEdit);
@ -390,7 +390,7 @@ void AppearanceSettingsPage::overrideAllCardArtWithPersonalPreferenceToggled(QT_
*/ */
void AppearanceSettingsPage::cardViewInitialRowsMaxChanged(int value) void AppearanceSettingsPage::cardViewInitialRowsMaxChanged(int value)
{ {
SettingsCache::instance().interface().setCardViewInitialRowsMax(value); SettingsCache::instance().userInterface().setCardViewInitialRowsMax(value);
if (cardViewExpandedRowsMaxBox.value() < value) { if (cardViewExpandedRowsMaxBox.value() < value) {
cardViewExpandedRowsMaxBox.setValue(value); cardViewExpandedRowsMaxBox.setValue(value);
} }
@ -403,7 +403,7 @@ void AppearanceSettingsPage::cardViewInitialRowsMaxChanged(int value)
*/ */
void AppearanceSettingsPage::cardViewExpandedRowsMaxChanged(int value) void AppearanceSettingsPage::cardViewExpandedRowsMaxChanged(int value)
{ {
SettingsCache::instance().interface().setCardViewExpandedRowsMax(value); SettingsCache::instance().userInterface().setCardViewExpandedRowsMax(value);
if (cardViewInitialRowsMaxBox.value() > value) { if (cardViewInitialRowsMaxBox.value() > value) {
cardViewInitialRowsMaxBox.setValue(value); cardViewInitialRowsMaxBox.setValue(value);
} }

View file

@ -20,80 +20,80 @@ enum visualDeckStoragePromptForConversionIndex
UserInterfaceSettingsPage::UserInterfaceSettingsPage() UserInterfaceSettingsPage::UserInterfaceSettingsPage()
{ {
// general settings and notification settings // general settings and notification settings
notificationsEnabledCheckBox.setChecked(SettingsCache::instance().interface().getNotificationsEnabled()); notificationsEnabledCheckBox.setChecked(SettingsCache::instance().userInterface().getNotificationsEnabled());
connect(&notificationsEnabledCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().interface(), connect(&notificationsEnabledCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
&InterfaceSettings::setNotificationsEnabled); &InterfaceSettings::setNotificationsEnabled);
connect(&notificationsEnabledCheckBox, &QCheckBox::QT_STATE_CHANGED, this, connect(&notificationsEnabledCheckBox, &QCheckBox::QT_STATE_CHANGED, this,
&UserInterfaceSettingsPage::setNotificationEnabled); &UserInterfaceSettingsPage::setNotificationEnabled);
specNotificationsEnabledCheckBox.setChecked( specNotificationsEnabledCheckBox.setChecked(
SettingsCache::instance().interface().getSpectatorNotificationsEnabled()); SettingsCache::instance().userInterface().getSpectatorNotificationsEnabled());
specNotificationsEnabledCheckBox.setEnabled(SettingsCache::instance().interface().getNotificationsEnabled()); specNotificationsEnabledCheckBox.setEnabled(SettingsCache::instance().userInterface().getNotificationsEnabled());
connect(&specNotificationsEnabledCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().interface(), connect(&specNotificationsEnabledCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
&InterfaceSettings::setSpectatorNotificationsEnabled); &InterfaceSettings::setSpectatorNotificationsEnabled);
buddyConnectNotificationsEnabledCheckBox.setChecked( buddyConnectNotificationsEnabledCheckBox.setChecked(
SettingsCache::instance().interface().getBuddyConnectNotificationsEnabled()); SettingsCache::instance().userInterface().getBuddyConnectNotificationsEnabled());
buddyConnectNotificationsEnabledCheckBox.setEnabled( buddyConnectNotificationsEnabledCheckBox.setEnabled(
SettingsCache::instance().interface().getNotificationsEnabled()); SettingsCache::instance().userInterface().getNotificationsEnabled());
connect(&buddyConnectNotificationsEnabledCheckBox, &QCheckBox::QT_STATE_CHANGED, connect(&buddyConnectNotificationsEnabledCheckBox, &QCheckBox::QT_STATE_CHANGED,
&SettingsCache::instance().interface(), &InterfaceSettings::setBuddyConnectNotificationsEnabled); &SettingsCache::instance().userInterface(), &InterfaceSettings::setBuddyConnectNotificationsEnabled);
doubleClickToPlayCheckBox.setChecked(SettingsCache::instance().interface().getDoubleClickToPlay()); doubleClickToPlayCheckBox.setChecked(SettingsCache::instance().userInterface().getDoubleClickToPlay());
connect(&doubleClickToPlayCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().interface(), connect(&doubleClickToPlayCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
&InterfaceSettings::setDoubleClickToPlay); &InterfaceSettings::setDoubleClickToPlay);
clickPlaysAllSelectedCheckBox.setChecked(SettingsCache::instance().interface().getClickPlaysAllSelected()); clickPlaysAllSelectedCheckBox.setChecked(SettingsCache::instance().userInterface().getClickPlaysAllSelected());
connect(&clickPlaysAllSelectedCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().interface(), connect(&clickPlaysAllSelectedCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
&InterfaceSettings::setClickPlaysAllSelected); &InterfaceSettings::setClickPlaysAllSelected);
playToStackCheckBox.setChecked(SettingsCache::instance().interface().getPlayToStack()); playToStackCheckBox.setChecked(SettingsCache::instance().userInterface().getPlayToStack());
connect(&playToStackCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().interface(), connect(&playToStackCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
&InterfaceSettings::setPlayToStack); &InterfaceSettings::setPlayToStack);
doNotDeleteArrowsInSubPhasesCheckBox.setChecked( doNotDeleteArrowsInSubPhasesCheckBox.setChecked(
SettingsCache::instance().interface().getDoNotDeleteArrowsInSubPhases()); SettingsCache::instance().userInterface().getDoNotDeleteArrowsInSubPhases());
connect(&doNotDeleteArrowsInSubPhasesCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().interface(), connect(&doNotDeleteArrowsInSubPhasesCheckBox, &QCheckBox::QT_STATE_CHANGED,
&InterfaceSettings::setDoNotDeleteArrowsInSubPhases); &SettingsCache::instance().userInterface(), &InterfaceSettings::setDoNotDeleteArrowsInSubPhases);
closeEmptyCardViewCheckBox.setChecked(SettingsCache::instance().interface().getCloseEmptyCardView()); closeEmptyCardViewCheckBox.setChecked(SettingsCache::instance().userInterface().getCloseEmptyCardView());
connect(&closeEmptyCardViewCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().interface(), connect(&closeEmptyCardViewCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
&InterfaceSettings::setCloseEmptyCardView); &InterfaceSettings::setCloseEmptyCardView);
focusCardViewSearchBarCheckBox.setChecked(SettingsCache::instance().interface().getFocusCardViewSearchBar()); focusCardViewSearchBarCheckBox.setChecked(SettingsCache::instance().userInterface().getFocusCardViewSearchBar());
connect(&focusCardViewSearchBarCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().interface(), connect(&focusCardViewSearchBarCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
&InterfaceSettings::setFocusCardViewSearchBar); &InterfaceSettings::setFocusCardViewSearchBar);
annotateTokensCheckBox.setChecked(SettingsCache::instance().interface().getAnnotateTokens()); annotateTokensCheckBox.setChecked(SettingsCache::instance().userInterface().getAnnotateTokens());
connect(&annotateTokensCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().interface(), connect(&annotateTokensCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
&InterfaceSettings::setAnnotateTokens); &InterfaceSettings::setAnnotateTokens);
showDragSelectionCountCheckBox.setChecked(SettingsCache::instance().interface().getShowDragSelectionCount()); showDragSelectionCountCheckBox.setChecked(SettingsCache::instance().userInterface().getShowDragSelectionCount());
connect(&showDragSelectionCountCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().interface(), connect(&showDragSelectionCountCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
&InterfaceSettings::setShowDragSelectionCount); &InterfaceSettings::setShowDragSelectionCount);
showTotalSelectionCountCheckBox.setChecked(SettingsCache::instance().interface().getShowTotalSelectionCount()); showTotalSelectionCountCheckBox.setChecked(SettingsCache::instance().userInterface().getShowTotalSelectionCount());
connect(&showTotalSelectionCountCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().interface(), connect(&showTotalSelectionCountCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
&InterfaceSettings::setShowTotalSelectionCount); &InterfaceSettings::setShowTotalSelectionCount);
useTearOffMenusCheckBox.setChecked(SettingsCache::instance().interface().getUseTearOffMenus()); useTearOffMenusCheckBox.setChecked(SettingsCache::instance().userInterface().getUseTearOffMenus());
connect(&useTearOffMenusCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().interface(), connect(&useTearOffMenusCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
[](const QT_STATE_CHANGED_T state) { [](const QT_STATE_CHANGED_T state) {
SettingsCache::instance().interface().setUseTearOffMenus(state == Qt::Checked); SettingsCache::instance().userInterface().setUseTearOffMenus(state == Qt::Checked);
}); });
keepGameChatFocusCheckBox.setChecked(SettingsCache::instance().interface().getKeepGameChatFocus()); keepGameChatFocusCheckBox.setChecked(SettingsCache::instance().userInterface().getKeepGameChatFocus());
connect(&keepGameChatFocusCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().interface(), connect(&keepGameChatFocusCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
&InterfaceSettings::setKeepGameChatFocus); &InterfaceSettings::setKeepGameChatFocus);
showShortcutsCheckBox.setChecked(SettingsCache::instance().interface().getShowShortcuts()); showShortcutsCheckBox.setChecked(SettingsCache::instance().userInterface().getShowShortcuts());
connect(&showShortcutsCheckBox, &QCheckBox::QT_STATE_CHANGED, this, connect(&showShortcutsCheckBox, &QCheckBox::QT_STATE_CHANGED, this,
&UserInterfaceSettingsPage::showShortcutsChanged); &UserInterfaceSettingsPage::showShortcutsChanged);
showGameSelectorFilterToolbarCheckBox.setChecked( showGameSelectorFilterToolbarCheckBox.setChecked(
SettingsCache::instance().interface().getShowGameSelectorFilterToolbar()); SettingsCache::instance().userInterface().getShowGameSelectorFilterToolbar());
connect(&showGameSelectorFilterToolbarCheckBox, &QCheckBox::QT_STATE_CHANGED, connect(&showGameSelectorFilterToolbarCheckBox, &QCheckBox::QT_STATE_CHANGED,
&SettingsCache::instance().interface(), &InterfaceSettings::setShowGameSelectorFilterToolbar); &SettingsCache::instance().userInterface(), &InterfaceSettings::setShowGameSelectorFilterToolbar);
auto *generalGrid = new QGridLayout; auto *generalGrid = new QGridLayout;
generalGrid->addWidget(&doubleClickToPlayCheckBox, 0, 0); generalGrid->addWidget(&doubleClickToPlayCheckBox, 0, 0);
@ -186,8 +186,8 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage()
// replay settings // replay settings
rewindBufferingMsBox.setRange(0, 9999); rewindBufferingMsBox.setRange(0, 9999);
rewindBufferingMsBox.setValue(SettingsCache::instance().interface().getRewindBufferingMs()); rewindBufferingMsBox.setValue(SettingsCache::instance().userInterface().getRewindBufferingMs());
connect(&rewindBufferingMsBox, qOverload<int>(&QSpinBox::valueChanged), &SettingsCache::instance().interface(), connect(&rewindBufferingMsBox, qOverload<int>(&QSpinBox::valueChanged), &SettingsCache::instance().userInterface(),
&InterfaceSettings::setRewindBufferingMs); &InterfaceSettings::setRewindBufferingMs);
auto *replayGrid = new QGridLayout; auto *replayGrid = new QGridLayout;
@ -225,7 +225,7 @@ void UserInterfaceSettingsPage::setNotificationEnabled(QT_STATE_CHANGED_T i)
void UserInterfaceSettingsPage::showShortcutsChanged(QT_STATE_CHANGED_T value) void UserInterfaceSettingsPage::showShortcutsChanged(QT_STATE_CHANGED_T value)
{ {
SettingsCache::instance().interface().setShowShortcuts(value); SettingsCache::instance().userInterface().setShowShortcuts(value);
qApp->setAttribute(Qt::AA_DontShowShortcutsInContextMenus, value == 0); // 0 = unchecked qApp->setAttribute(Qt::AA_DontShowShortcutsInContextMenus, value == 0); // 0 = unchecked
} }

View file

@ -258,7 +258,7 @@ void TabGame::resetChatAndPhase()
void TabGame::emitUserEvent() void TabGame::emitUserEvent()
{ {
bool globalEvent = !game->getPlayerManager()->isSpectator() || bool globalEvent = !game->getPlayerManager()->isSpectator() ||
SettingsCache::instance().interface().getSpectatorNotificationsEnabled(); SettingsCache::instance().userInterface().getSpectatorNotificationsEnabled();
emit userEvent(globalEvent); emit userEvent(globalEvent);
updatePlayerListDockTitle(); updatePlayerListDockTitle();
} }

View file

@ -1009,7 +1009,7 @@ void TabSupervisor::tabUserEvent(bool globalEvent)
tab->setContentsChanged(true); tab->setContentsChanged(true);
setTabIcon(indexOf(tab), QPixmap("theme:icons/tab_changed")); setTabIcon(indexOf(tab), QPixmap("theme:icons/tab_changed"));
} }
if (globalEvent && SettingsCache::instance().interface().getNotificationsEnabled()) { if (globalEvent && SettingsCache::instance().userInterface().getNotificationsEnabled()) {
QApplication::alert(this); QApplication::alert(this);
} }
} }
@ -1104,7 +1104,7 @@ void TabSupervisor::processUserJoined(const ServerInfo_User &userInfoJoined)
} }
} }
if (SettingsCache::instance().interface().getBuddyConnectNotificationsEnabled()) { if (SettingsCache::instance().userInterface().getBuddyConnectNotificationsEnabled()) {
QApplication::alert(this); QApplication::alert(this);
this->actShowPopup(tr("Your buddy %1 has signed on!").arg(userName)); this->actShowPopup(tr("Your buddy %1 has signed on!").arg(userName));
} }

View file

@ -393,8 +393,8 @@ void MainWindow::createActions()
connect(aCheckCardUpdatesBackground, &QAction::triggered, this, &MainWindow::actCheckCardUpdatesBackground); connect(aCheckCardUpdatesBackground, &QAction::triggered, this, &MainWindow::actCheckCardUpdatesBackground);
aStatusBar = new QAction(this); aStatusBar = new QAction(this);
aStatusBar->setCheckable(true); aStatusBar->setCheckable(true);
aStatusBar->setChecked(SettingsCache::instance().interface().getShowStatusBar()); aStatusBar->setChecked(SettingsCache::instance().userInterface().getShowStatusBar());
connect(aStatusBar, &QAction::triggered, &SettingsCache::instance().interface(), connect(aStatusBar, &QAction::triggered, &SettingsCache::instance().userInterface(),
&InterfaceSettings::setShowStatusBar); &InterfaceSettings::setShowStatusBar);
aViewLog = new QAction(this); aViewLog = new QAction(this);
connect(aViewLog, &QAction::triggered, this, &MainWindow::actViewLog); connect(aViewLog, &QAction::triggered, this, &MainWindow::actViewLog);
@ -520,9 +520,9 @@ MainWindow::MainWindow(QWidget *parent)
} }
// status bar // status bar
connect(&SettingsCache::instance().interface(), &InterfaceSettings::showStatusBarChanged, this, connect(&SettingsCache::instance().userInterface(), &InterfaceSettings::showStatusBarChanged, this,
[this](bool show) { statusBar()->setVisible(show); }); [this](bool show) { statusBar()->setVisible(show); });
statusBar()->setVisible(SettingsCache::instance().interface().getShowStatusBar()); statusBar()->setVisible(SettingsCache::instance().userInterface().getShowStatusBar());
connect(&SettingsCache::instance().shortcuts(), &ShortcutsSettings::shortCutChanged, this, connect(&SettingsCache::instance().shortcuts(), &ShortcutsSettings::shortCutChanged, this,
&MainWindow::refreshShortcuts); &MainWindow::refreshShortcuts);

View file

@ -295,7 +295,7 @@ int main(int argc, char *argv[])
// force shortcuts to be shown/hidden in right-click menus, regardless of system defaults // force shortcuts to be shown/hidden in right-click menus, regardless of system defaults
qApp->setAttribute(Qt::AA_DontShowShortcutsInContextMenus, qApp->setAttribute(Qt::AA_DontShowShortcutsInContextMenus,
!SettingsCache::instance().interface().getShowShortcuts()); !SettingsCache::instance().userInterface().getShowShortcuts());
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
app.setAttribute(Qt::AA_UseHighDpiPixmaps); app.setAttribute(Qt::AA_UseHighDpiPixmaps);