mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-23 01:55:10 -07:00
[Settings] Shuffle some settings around (#7084)
* [Settings] Shuffle some settings around Took 21 minutes Took 1 hour 25 minutes * [Settings] Camel case everything * Revert debug schema change * Add new classes * Fix card counters writing to global * Fix CI tests * Fix Windows CI * interface() is a protected keyword for MSVC Took 5 minutes Took 5 seconds * [Settings] Keep menu settings on the appearance settings page Leave the 'Menu settings' group box on the appearance settings page for now; relocating it to the user interface settings page will be done in a separate PR. Took 6 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
bf6b2a90bc
commit
adf574e038
79 changed files with 1899 additions and 1123 deletions
|
|
@ -15,6 +15,7 @@
|
|||
#include <QMessageBox>
|
||||
#include <QStyleFactory>
|
||||
#include <QTimer>
|
||||
#include <libcockatrice/settings/appearance_settings.h>
|
||||
#include <libcockatrice/settings/cards_display_settings.h>
|
||||
#include <libcockatrice/settings/interface_settings.h>
|
||||
#include <libcockatrice/settings/paths_settings.h>
|
||||
|
|
@ -104,7 +105,7 @@ AppearanceSettingsPage::AppearanceSettingsPage()
|
|||
homeTabBackgroundSourceBox.addItem(QObject::tr(entry.trKey), QVariant::fromValue(entry.type));
|
||||
}
|
||||
|
||||
QString homeTabBackgroundSource = SettingsCache::instance().personal().getHomeTabBackgroundSource();
|
||||
QString homeTabBackgroundSource = settings.appearance().getHomeTabBackgroundSource();
|
||||
int homeTabBackgroundSourceId =
|
||||
homeTabBackgroundSourceBox.findData(BackgroundSources::fromId(homeTabBackgroundSource));
|
||||
if (homeTabBackgroundSourceId != -1) {
|
||||
|
|
@ -113,20 +114,19 @@ AppearanceSettingsPage::AppearanceSettingsPage()
|
|||
|
||||
connect(&homeTabBackgroundSourceBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this]() {
|
||||
auto type = homeTabBackgroundSourceBox.currentData().value<BackgroundSources::Type>();
|
||||
SettingsCache::instance().personal().setHomeTabBackgroundSource(BackgroundSources::toId(type));
|
||||
SettingsCache::instance().appearance().setHomeTabBackgroundSource(BackgroundSources::toId(type));
|
||||
updateHomeTabSettingsVisibility();
|
||||
});
|
||||
|
||||
homeTabBackgroundShuffleFrequencySpinBox.setRange(0, 3600);
|
||||
homeTabBackgroundShuffleFrequencySpinBox.setSuffix(tr(" seconds"));
|
||||
homeTabBackgroundShuffleFrequencySpinBox.setValue(
|
||||
SettingsCache::instance().personal().getHomeTabBackgroundShuffleFrequency());
|
||||
connect(&homeTabBackgroundShuffleFrequencySpinBox, qOverload<int>(&QSpinBox::valueChanged), &settings.personal(),
|
||||
&PersonalSettings::setHomeTabBackgroundShuffleFrequency);
|
||||
homeTabBackgroundShuffleFrequencySpinBox.setValue(settings.appearance().getHomeTabBackgroundShuffleFrequency());
|
||||
connect(&homeTabBackgroundShuffleFrequencySpinBox, qOverload<int>(&QSpinBox::valueChanged), &settings.appearance(),
|
||||
&AppearanceSettings::setHomeTabBackgroundShuffleFrequency);
|
||||
|
||||
homeTabDisplayCardNameCheckBox.setChecked(settings.personal().getHomeTabDisplayCardName());
|
||||
connect(&homeTabDisplayCardNameCheckBox, &QCheckBox::QT_STATE_CHANGED, &settings.personal(),
|
||||
&PersonalSettings::setHomeTabDisplayCardName);
|
||||
homeTabDisplayCardNameCheckBox.setChecked(settings.appearance().getHomeTabDisplayCardName());
|
||||
connect(&homeTabDisplayCardNameCheckBox, &QCheckBox::QT_STATE_CHANGED, &settings.appearance(),
|
||||
&AppearanceSettings::setHomeTabDisplayCardName);
|
||||
|
||||
updateHomeTabSettingsVisibility();
|
||||
|
||||
|
|
@ -140,9 +140,9 @@ AppearanceSettingsPage::AppearanceSettingsPage()
|
|||
homeTabGroupBox = new QGroupBox;
|
||||
homeTabGroupBox->setLayout(homeTabGrid);
|
||||
|
||||
styleUserListCheckBox.setChecked(settings.interface().getStyleUserList());
|
||||
connect(&styleUserListCheckBox, &QCheckBox::QT_STATE_CHANGED, &settings.interface(),
|
||||
&InterfaceSettings::setStyleUserList);
|
||||
styleUserListCheckBox.setChecked(settings.appearance().getStyleUserList());
|
||||
connect(&styleUserListCheckBox, &QCheckBox::QT_STATE_CHANGED, &settings.appearance(),
|
||||
&AppearanceSettings::setStyleUserList);
|
||||
|
||||
auto stylingTabGrid = new QGridLayout;
|
||||
stylingTabGrid->addWidget(&styleUserListCheckBox, 0, 0, 1, 2);
|
||||
|
|
@ -151,12 +151,12 @@ AppearanceSettingsPage::AppearanceSettingsPage()
|
|||
stylingGroupBox->setLayout(stylingTabGrid);
|
||||
|
||||
// Menu settings
|
||||
showShortcutsCheckBox.setChecked(settings.cardsDisplay().getShowShortcuts());
|
||||
showShortcutsCheckBox.setChecked(settings.userInterface().getShowShortcuts());
|
||||
connect(&showShortcutsCheckBox, &QCheckBox::QT_STATE_CHANGED, this, &AppearanceSettingsPage::showShortcutsChanged);
|
||||
|
||||
showGameSelectorFilterToolbarCheckBox.setChecked(settings.cardsDisplay().getShowGameSelectorFilterToolbar());
|
||||
connect(&showGameSelectorFilterToolbarCheckBox, &QCheckBox::QT_STATE_CHANGED, &settings.cardsDisplay(),
|
||||
&CardsDisplaySettings::setShowGameSelectorFilterToolbar);
|
||||
showGameSelectorFilterToolbarCheckBox.setChecked(settings.userInterface().getShowGameSelectorFilterToolbar());
|
||||
connect(&showGameSelectorFilterToolbarCheckBox, &QCheckBox::QT_STATE_CHANGED, &settings.userInterface(),
|
||||
&InterfaceSettings::setShowGameSelectorFilterToolbar);
|
||||
|
||||
auto *menuGrid = new QGridLayout;
|
||||
menuGrid->addWidget(&showShortcutsCheckBox, 0, 0);
|
||||
|
|
@ -199,9 +199,9 @@ AppearanceSettingsPage::AppearanceSettingsPage()
|
|||
connect(&roundCardCornersCheckBox, &QAbstractButton::toggled, &settings.cardsDisplay(),
|
||||
&CardsDisplaySettings::setRoundCardCorners);
|
||||
|
||||
connect(&maxFontSizeForCardsEdit, qOverload<int>(&QSpinBox::valueChanged), &settings.personal(),
|
||||
&PersonalSettings::setMaxFontSize);
|
||||
maxFontSizeForCardsEdit.setValue(settings.personal().getMaxFontSize());
|
||||
connect(&maxFontSizeForCardsEdit, qOverload<int>(&QSpinBox::valueChanged), &settings.appearance(),
|
||||
&AppearanceSettings::setMaxFontSize);
|
||||
maxFontSizeForCardsEdit.setValue(settings.appearance().getMaxFontSize());
|
||||
maxFontSizeForCardsLabel.setBuddy(&maxFontSizeForCardsEdit);
|
||||
maxFontSizeForCardsEdit.setMinimum(9);
|
||||
maxFontSizeForCardsEdit.setMaximum(100);
|
||||
|
|
@ -224,12 +224,12 @@ AppearanceSettingsPage::AppearanceSettingsPage()
|
|||
&CardsDisplaySettings::setStackCardOverlapPercent);
|
||||
|
||||
cardViewInitialRowsMaxBox.setRange(1, 999);
|
||||
cardViewInitialRowsMaxBox.setValue(SettingsCache::instance().interface().getCardViewInitialRowsMax());
|
||||
cardViewInitialRowsMaxBox.setValue(SettingsCache::instance().userInterface().getCardViewInitialRowsMax());
|
||||
connect(&cardViewInitialRowsMaxBox, qOverload<int>(&QSpinBox::valueChanged), this,
|
||||
&AppearanceSettingsPage::cardViewInitialRowsMaxChanged);
|
||||
|
||||
cardViewExpandedRowsMaxBox.setRange(1, 999);
|
||||
cardViewExpandedRowsMaxBox.setValue(SettingsCache::instance().interface().getCardViewExpandedRowsMax());
|
||||
cardViewExpandedRowsMaxBox.setValue(SettingsCache::instance().userInterface().getCardViewExpandedRowsMax());
|
||||
connect(&cardViewExpandedRowsMaxBox, qOverload<int>(&QSpinBox::valueChanged), this,
|
||||
&AppearanceSettingsPage::cardViewExpandedRowsMaxChanged);
|
||||
|
||||
|
|
@ -291,12 +291,12 @@ AppearanceSettingsPage::AppearanceSettingsPage()
|
|||
cardCountersGroupBox->setLayout(cardCountersLayout);
|
||||
|
||||
// Hand layout
|
||||
horizontalHandCheckBox.setChecked(settings.interface().getHorizontalHand());
|
||||
connect(&horizontalHandCheckBox, &QCheckBox::QT_STATE_CHANGED, &settings.interface(),
|
||||
horizontalHandCheckBox.setChecked(settings.userInterface().getHorizontalHand());
|
||||
connect(&horizontalHandCheckBox, &QCheckBox::QT_STATE_CHANGED, &settings.userInterface(),
|
||||
&InterfaceSettings::setHorizontalHand);
|
||||
|
||||
leftJustifiedHandCheckBox.setChecked(settings.interface().getLeftJustified());
|
||||
connect(&leftJustifiedHandCheckBox, &QCheckBox::QT_STATE_CHANGED, &settings.interface(),
|
||||
leftJustifiedHandCheckBox.setChecked(settings.userInterface().getLeftJustified());
|
||||
connect(&leftJustifiedHandCheckBox, &QCheckBox::QT_STATE_CHANGED, &settings.userInterface(),
|
||||
&InterfaceSettings::setLeftJustified);
|
||||
|
||||
auto *handGrid = new QGridLayout;
|
||||
|
|
@ -307,13 +307,13 @@ AppearanceSettingsPage::AppearanceSettingsPage()
|
|||
handGroupBox->setLayout(handGrid);
|
||||
|
||||
// table grid layout
|
||||
invertVerticalCoordinateCheckBox.setChecked(settings.interface().getInvertVerticalCoordinate());
|
||||
connect(&invertVerticalCoordinateCheckBox, &QCheckBox::QT_STATE_CHANGED, &settings.interface(),
|
||||
invertVerticalCoordinateCheckBox.setChecked(settings.userInterface().getInvertVerticalCoordinate());
|
||||
connect(&invertVerticalCoordinateCheckBox, &QCheckBox::QT_STATE_CHANGED, &settings.userInterface(),
|
||||
&InterfaceSettings::setInvertVerticalCoordinate);
|
||||
|
||||
minPlayersForMultiColumnLayoutEdit.setMinimum(2);
|
||||
minPlayersForMultiColumnLayoutEdit.setValue(settings.interface().getMinPlayersForMultiColumnLayout());
|
||||
connect(&minPlayersForMultiColumnLayoutEdit, qOverload<int>(&QSpinBox::valueChanged), &settings.interface(),
|
||||
minPlayersForMultiColumnLayoutEdit.setValue(settings.userInterface().getMinPlayersForMultiColumnLayout());
|
||||
connect(&minPlayersForMultiColumnLayoutEdit, qOverload<int>(&QSpinBox::valueChanged), &settings.userInterface(),
|
||||
&InterfaceSettings::setMinPlayersForMultiColumnLayout);
|
||||
minPlayersForMultiColumnLayoutLabel.setBuddy(&minPlayersForMultiColumnLayoutEdit);
|
||||
|
||||
|
|
@ -375,7 +375,7 @@ void AppearanceSettingsPage::editPalette()
|
|||
|
||||
void AppearanceSettingsPage::updateHomeTabSettingsVisibility()
|
||||
{
|
||||
bool visible = SettingsCache::instance().personal().getHomeTabBackgroundSource() !=
|
||||
bool visible = SettingsCache::instance().appearance().getHomeTabBackgroundSource() !=
|
||||
BackgroundSources::toId(BackgroundSources::Theme);
|
||||
|
||||
homeTabBackgroundShuffleFrequencyLabel.setVisible(visible);
|
||||
|
|
@ -385,7 +385,7 @@ void AppearanceSettingsPage::updateHomeTabSettingsVisibility()
|
|||
|
||||
void AppearanceSettingsPage::showShortcutsChanged(QT_STATE_CHANGED_T value)
|
||||
{
|
||||
SettingsCache::instance().cardsDisplay().setShowShortcuts(value);
|
||||
SettingsCache::instance().userInterface().setShowShortcuts(value);
|
||||
qApp->setAttribute(Qt::AA_DontShowShortcutsInContextMenus, value == 0); // 0 = unchecked
|
||||
}
|
||||
|
||||
|
|
@ -412,7 +412,7 @@ void AppearanceSettingsPage::overrideAllCardArtWithPersonalPreferenceToggled(QT_
|
|||
*/
|
||||
void AppearanceSettingsPage::cardViewInitialRowsMaxChanged(int value)
|
||||
{
|
||||
SettingsCache::instance().interface().setCardViewInitialRowsMax(value);
|
||||
SettingsCache::instance().userInterface().setCardViewInitialRowsMax(value);
|
||||
if (cardViewExpandedRowsMaxBox.value() < value) {
|
||||
cardViewExpandedRowsMaxBox.setValue(value);
|
||||
}
|
||||
|
|
@ -425,7 +425,7 @@ void AppearanceSettingsPage::cardViewInitialRowsMaxChanged(int value)
|
|||
*/
|
||||
void AppearanceSettingsPage::cardViewExpandedRowsMaxChanged(int value)
|
||||
{
|
||||
SettingsCache::instance().interface().setCardViewExpandedRowsMax(value);
|
||||
SettingsCache::instance().userInterface().setCardViewExpandedRowsMax(value);
|
||||
if (cardViewInitialRowsMaxBox.value() > value) {
|
||||
cardViewInitialRowsMaxBox.setValue(value);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,10 +40,10 @@ private:
|
|||
QSpinBox homeTabBackgroundShuffleFrequencySpinBox;
|
||||
QCheckBox homeTabDisplayCardNameCheckBox;
|
||||
QCheckBox styleUserListCheckBox;
|
||||
QLabel minPlayersForMultiColumnLayoutLabel;
|
||||
QLabel maxFontSizeForCardsLabel;
|
||||
QCheckBox showShortcutsCheckBox;
|
||||
QCheckBox showGameSelectorFilterToolbarCheckBox;
|
||||
QLabel minPlayersForMultiColumnLayoutLabel;
|
||||
QLabel maxFontSizeForCardsLabel;
|
||||
QCheckBox overrideAllCardArtWithPersonalPreferenceCheckBox;
|
||||
QCheckBox bumpSetsWithCardsInDeckToTopCheckBox;
|
||||
QCheckBox displayCardNamesCheckBox;
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@
|
|||
|
||||
DeckEditorSettingsPage::DeckEditorSettingsPage()
|
||||
{
|
||||
picDownloadCheckBox.setChecked(SettingsCache::instance().personal().getPicDownload());
|
||||
connect(&picDownloadCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().personal(),
|
||||
&PersonalSettings::setPicDownload);
|
||||
picDownloadCheckBox.setChecked(SettingsCache::instance().downloads().getPicDownload());
|
||||
connect(&picDownloadCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().downloads(),
|
||||
&DownloadSettings::setPicDownload);
|
||||
|
||||
urlLinkLabel.setTextInteractionFlags(Qt::LinksAccessibleByMouse);
|
||||
urlLinkLabel.setOpenExternalLinks(true);
|
||||
|
|
@ -29,7 +29,7 @@ DeckEditorSettingsPage::DeckEditorSettingsPage()
|
|||
auto *lpGeneralGrid = new QGridLayout;
|
||||
auto *lpSpoilerGrid = new QGridLayout;
|
||||
|
||||
mcDownloadSpoilersCheckBox.setChecked(SettingsCache::instance().personal().getDownloadSpoilersStatus());
|
||||
mcDownloadSpoilersCheckBox.setChecked(SettingsCache::instance().downloads().getDownloadSpoilersStatus());
|
||||
|
||||
mpSpoilerSavePathLineEdit = new QLineEdit(SettingsCache::instance().getSpoilerCardDatabasePath());
|
||||
mpSpoilerSavePathLineEdit->setReadOnly(true);
|
||||
|
|
@ -91,8 +91,8 @@ DeckEditorSettingsPage::DeckEditorSettingsPage()
|
|||
lpSpoilerGrid->addWidget(&infoOnSpoilersLabel, 3, 0, 1, 3, Qt::AlignTop);
|
||||
|
||||
// On a change to the checkbox, hide/un-hide the other fields
|
||||
connect(&mcDownloadSpoilersCheckBox, &QCheckBox::toggled, &SettingsCache::instance().personal(),
|
||||
&PersonalSettings::setDownloadSpoilerStatus);
|
||||
connect(&mcDownloadSpoilersCheckBox, &QCheckBox::toggled, &SettingsCache::instance().downloads(),
|
||||
&DownloadSettings::setDownloadSpoilerStatus);
|
||||
connect(&mcDownloadSpoilersCheckBox, &QCheckBox::toggled, this, &DeckEditorSettingsPage::setSpoilersEnabled);
|
||||
|
||||
mpGeneralGroupBox = new QGroupBox;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include <QGridLayout>
|
||||
#include <libcockatrice/settings/cards_display_settings.h>
|
||||
#include <libcockatrice/settings/deck_editor_settings.h>
|
||||
#include <libcockatrice/settings/interface_settings.h>
|
||||
#include <libcockatrice/settings/personal_settings.h>
|
||||
#include <libcockatrice/settings/visual_deck_storage_settings.h>
|
||||
|
|
@ -19,70 +20,70 @@ enum visualDeckStoragePromptForConversionIndex
|
|||
UserInterfaceSettingsPage::UserInterfaceSettingsPage()
|
||||
{
|
||||
// general settings and notification settings
|
||||
notificationsEnabledCheckBox.setChecked(SettingsCache::instance().interface().getNotificationsEnabled());
|
||||
connect(¬ificationsEnabledCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().interface(),
|
||||
notificationsEnabledCheckBox.setChecked(SettingsCache::instance().userInterface().getNotificationsEnabled());
|
||||
connect(¬ificationsEnabledCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
|
||||
&InterfaceSettings::setNotificationsEnabled);
|
||||
connect(¬ificationsEnabledCheckBox, &QCheckBox::QT_STATE_CHANGED, this,
|
||||
&UserInterfaceSettingsPage::setNotificationEnabled);
|
||||
|
||||
specNotificationsEnabledCheckBox.setChecked(
|
||||
SettingsCache::instance().interface().getSpectatorNotificationsEnabled());
|
||||
specNotificationsEnabledCheckBox.setEnabled(SettingsCache::instance().interface().getNotificationsEnabled());
|
||||
connect(&specNotificationsEnabledCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().interface(),
|
||||
SettingsCache::instance().userInterface().getSpectatorNotificationsEnabled());
|
||||
specNotificationsEnabledCheckBox.setEnabled(SettingsCache::instance().userInterface().getNotificationsEnabled());
|
||||
connect(&specNotificationsEnabledCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
|
||||
&InterfaceSettings::setSpectatorNotificationsEnabled);
|
||||
|
||||
buddyConnectNotificationsEnabledCheckBox.setChecked(
|
||||
SettingsCache::instance().interface().getBuddyConnectNotificationsEnabled());
|
||||
SettingsCache::instance().userInterface().getBuddyConnectNotificationsEnabled());
|
||||
buddyConnectNotificationsEnabledCheckBox.setEnabled(
|
||||
SettingsCache::instance().interface().getNotificationsEnabled());
|
||||
SettingsCache::instance().userInterface().getNotificationsEnabled());
|
||||
connect(&buddyConnectNotificationsEnabledCheckBox, &QCheckBox::QT_STATE_CHANGED,
|
||||
&SettingsCache::instance().interface(), &InterfaceSettings::setBuddyConnectNotificationsEnabled);
|
||||
&SettingsCache::instance().userInterface(), &InterfaceSettings::setBuddyConnectNotificationsEnabled);
|
||||
|
||||
doubleClickToPlayCheckBox.setChecked(SettingsCache::instance().interface().getDoubleClickToPlay());
|
||||
connect(&doubleClickToPlayCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().interface(),
|
||||
doubleClickToPlayCheckBox.setChecked(SettingsCache::instance().userInterface().getDoubleClickToPlay());
|
||||
connect(&doubleClickToPlayCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
|
||||
&InterfaceSettings::setDoubleClickToPlay);
|
||||
|
||||
clickPlaysAllSelectedCheckBox.setChecked(SettingsCache::instance().interface().getClickPlaysAllSelected());
|
||||
connect(&clickPlaysAllSelectedCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().interface(),
|
||||
clickPlaysAllSelectedCheckBox.setChecked(SettingsCache::instance().userInterface().getClickPlaysAllSelected());
|
||||
connect(&clickPlaysAllSelectedCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
|
||||
&InterfaceSettings::setClickPlaysAllSelected);
|
||||
|
||||
playToStackCheckBox.setChecked(SettingsCache::instance().interface().getPlayToStack());
|
||||
connect(&playToStackCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().interface(),
|
||||
playToStackCheckBox.setChecked(SettingsCache::instance().userInterface().getPlayToStack());
|
||||
connect(&playToStackCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
|
||||
&InterfaceSettings::setPlayToStack);
|
||||
|
||||
doNotDeleteArrowsInSubPhasesCheckBox.setChecked(
|
||||
SettingsCache::instance().interface().getDoNotDeleteArrowsInSubPhases());
|
||||
connect(&doNotDeleteArrowsInSubPhasesCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().interface(),
|
||||
&InterfaceSettings::setDoNotDeleteArrowsInSubPhases);
|
||||
SettingsCache::instance().userInterface().getDoNotDeleteArrowsInSubPhases());
|
||||
connect(&doNotDeleteArrowsInSubPhasesCheckBox, &QCheckBox::QT_STATE_CHANGED,
|
||||
&SettingsCache::instance().userInterface(), &InterfaceSettings::setDoNotDeleteArrowsInSubPhases);
|
||||
|
||||
closeEmptyCardViewCheckBox.setChecked(SettingsCache::instance().interface().getCloseEmptyCardView());
|
||||
connect(&closeEmptyCardViewCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().interface(),
|
||||
closeEmptyCardViewCheckBox.setChecked(SettingsCache::instance().userInterface().getCloseEmptyCardView());
|
||||
connect(&closeEmptyCardViewCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
|
||||
&InterfaceSettings::setCloseEmptyCardView);
|
||||
|
||||
focusCardViewSearchBarCheckBox.setChecked(SettingsCache::instance().interface().getFocusCardViewSearchBar());
|
||||
connect(&focusCardViewSearchBarCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().interface(),
|
||||
focusCardViewSearchBarCheckBox.setChecked(SettingsCache::instance().userInterface().getFocusCardViewSearchBar());
|
||||
connect(&focusCardViewSearchBarCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
|
||||
&InterfaceSettings::setFocusCardViewSearchBar);
|
||||
|
||||
annotateTokensCheckBox.setChecked(SettingsCache::instance().interface().getAnnotateTokens());
|
||||
connect(&annotateTokensCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().interface(),
|
||||
annotateTokensCheckBox.setChecked(SettingsCache::instance().userInterface().getAnnotateTokens());
|
||||
connect(&annotateTokensCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
|
||||
&InterfaceSettings::setAnnotateTokens);
|
||||
|
||||
showDragSelectionCountCheckBox.setChecked(SettingsCache::instance().interface().getShowDragSelectionCount());
|
||||
connect(&showDragSelectionCountCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().interface(),
|
||||
showDragSelectionCountCheckBox.setChecked(SettingsCache::instance().userInterface().getShowDragSelectionCount());
|
||||
connect(&showDragSelectionCountCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
|
||||
&InterfaceSettings::setShowDragSelectionCount);
|
||||
|
||||
showTotalSelectionCountCheckBox.setChecked(SettingsCache::instance().interface().getShowTotalSelectionCount());
|
||||
connect(&showTotalSelectionCountCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().interface(),
|
||||
showTotalSelectionCountCheckBox.setChecked(SettingsCache::instance().userInterface().getShowTotalSelectionCount());
|
||||
connect(&showTotalSelectionCountCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
|
||||
&InterfaceSettings::setShowTotalSelectionCount);
|
||||
|
||||
useTearOffMenusCheckBox.setChecked(SettingsCache::instance().interface().getUseTearOffMenus());
|
||||
connect(&useTearOffMenusCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().interface(),
|
||||
useTearOffMenusCheckBox.setChecked(SettingsCache::instance().userInterface().getUseTearOffMenus());
|
||||
connect(&useTearOffMenusCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
|
||||
[](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());
|
||||
connect(&keepGameChatFocusCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().interface(),
|
||||
keepGameChatFocusCheckBox.setChecked(SettingsCache::instance().userInterface().getKeepGameChatFocus());
|
||||
connect(&keepGameChatFocusCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
|
||||
&InterfaceSettings::setKeepGameChatFocus);
|
||||
|
||||
auto *generalGrid = new QGridLayout;
|
||||
|
|
@ -121,9 +122,9 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage()
|
|||
animationGroupBox->setLayout(animationGrid);
|
||||
|
||||
// deck editor settings
|
||||
openDeckInNewTabCheckBox.setChecked(SettingsCache::instance().interface().getOpenDeckInNewTab());
|
||||
connect(&openDeckInNewTabCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().interface(),
|
||||
&InterfaceSettings::setOpenDeckInNewTab);
|
||||
openDeckInNewTabCheckBox.setChecked(SettingsCache::instance().deckEditor().getOpenDeckInNewTab());
|
||||
connect(&openDeckInNewTabCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().deckEditor(),
|
||||
&DeckEditorSettings::setOpenDeckInNewTab);
|
||||
|
||||
visualDeckStorageInGameCheckBox.setChecked(
|
||||
SettingsCache::instance().visualDeckStorage().getVisualDeckStorageInGame());
|
||||
|
|
@ -156,10 +157,9 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage()
|
|||
|
||||
defaultDeckEditorTypeSelector.addItem(""); // these will be set in retranslateUI
|
||||
defaultDeckEditorTypeSelector.addItem("");
|
||||
defaultDeckEditorTypeSelector.setCurrentIndex(
|
||||
SettingsCache::instance().visualDeckStorage().getDefaultDeckEditorType());
|
||||
defaultDeckEditorTypeSelector.setCurrentIndex(SettingsCache::instance().deckEditor().getDefaultDeckEditorType());
|
||||
connect(&defaultDeckEditorTypeSelector, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||
&SettingsCache::instance().visualDeckStorage(), &VisualDeckStorageSettings::setDefaultDeckEditorType);
|
||||
&SettingsCache::instance().deckEditor(), &DeckEditorSettings::setDefaultDeckEditorType);
|
||||
|
||||
auto *deckEditorGrid = new QGridLayout;
|
||||
deckEditorGrid->addWidget(&openDeckInNewTabCheckBox, 0, 0);
|
||||
|
|
@ -175,8 +175,8 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage()
|
|||
|
||||
// replay settings
|
||||
rewindBufferingMsBox.setRange(0, 9999);
|
||||
rewindBufferingMsBox.setValue(SettingsCache::instance().interface().getRewindBufferingMs());
|
||||
connect(&rewindBufferingMsBox, qOverload<int>(&QSpinBox::valueChanged), &SettingsCache::instance().interface(),
|
||||
rewindBufferingMsBox.setValue(SettingsCache::instance().userInterface().getRewindBufferingMs());
|
||||
connect(&rewindBufferingMsBox, qOverload<int>(&QSpinBox::valueChanged), &SettingsCache::instance().userInterface(),
|
||||
&InterfaceSettings::setRewindBufferingMs);
|
||||
|
||||
auto *replayGrid = new QGridLayout;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue