mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-28 08:52:19 -07:00
[Settings] Shuffle some settings around
Took 21 minutes Took 1 hour 25 minutes
This commit is contained in:
parent
0d14fb77a0
commit
e37cb5dadf
47 changed files with 1019 additions and 724 deletions
|
|
@ -3,18 +3,21 @@ set(CMAKE_AUTOUIC ON)
|
|||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
set(HEADERS
|
||||
libcockatrice/settings/appearance_settings.h
|
||||
libcockatrice/settings/cache_storage_settings.h
|
||||
libcockatrice/settings/card_database_settings.h
|
||||
libcockatrice/settings/card_override_settings.h
|
||||
libcockatrice/settings/cards_display_settings.h
|
||||
libcockatrice/settings/chat_settings.h
|
||||
libcockatrice/settings/debug_settings.h
|
||||
libcockatrice/settings/deck_editor_settings.h
|
||||
libcockatrice/settings/download_settings.h
|
||||
libcockatrice/settings/game_filters_settings.h
|
||||
libcockatrice/settings/game_settings.h
|
||||
libcockatrice/settings/interface_settings.h
|
||||
libcockatrice/settings/layouts_settings.h
|
||||
libcockatrice/settings/message_settings.h
|
||||
libcockatrice/settings/network_settings.h
|
||||
libcockatrice/settings/paths_settings.h
|
||||
libcockatrice/settings/personal_settings.h
|
||||
libcockatrice/settings/recents_settings.h
|
||||
|
|
@ -36,18 +39,21 @@ endif()
|
|||
add_library(
|
||||
libcockatrice_settings STATIC
|
||||
${MOC_SOURCES}
|
||||
libcockatrice/settings/appearance_settings.cpp
|
||||
libcockatrice/settings/cache_storage_settings.cpp
|
||||
libcockatrice/settings/card_database_settings.cpp
|
||||
libcockatrice/settings/card_override_settings.cpp
|
||||
libcockatrice/settings/cards_display_settings.cpp
|
||||
libcockatrice/settings/chat_settings.cpp
|
||||
libcockatrice/settings/debug_settings.cpp
|
||||
libcockatrice/settings/deck_editor_settings.cpp
|
||||
libcockatrice/settings/download_settings.cpp
|
||||
libcockatrice/settings/game_filters_settings.cpp
|
||||
libcockatrice/settings/game_settings.cpp
|
||||
libcockatrice/settings/interface_settings.cpp
|
||||
libcockatrice/settings/layouts_settings.cpp
|
||||
libcockatrice/settings/message_settings.cpp
|
||||
libcockatrice/settings/network_settings.cpp
|
||||
libcockatrice/settings/paths_settings.cpp
|
||||
libcockatrice/settings/personal_settings.cpp
|
||||
libcockatrice/settings/recents_settings.cpp
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#include "cache_storage_settings.h"
|
||||
|
||||
CacheStorageSettings::CacheStorageSettings(const QString &settingPath, QObject *parent)
|
||||
: SettingsManager(settingPath + "cache_storage.ini", "personal", QString(), parent)
|
||||
: SettingsManager(settingPath + "cache_storage.ini", "cache_storage", QString(), parent)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,12 +27,12 @@ bool CardsDisplaySettings::getBumpSetsWithCardsInDeckToTop() const
|
|||
|
||||
int CardsDisplaySettings::getPrintingSelectorSortOrder() const
|
||||
{
|
||||
return getValue("printingselectorsortorder", QString(), QString(), 1).toInt();
|
||||
return getValue("sortOrder", "cards", "printingSelector", 1).toInt();
|
||||
}
|
||||
|
||||
int CardsDisplaySettings::getPrintingSelectorCardSize() const
|
||||
{
|
||||
return getValue("printingselectorcardsize", QString(), QString(), 100).toInt();
|
||||
return getValue("printingSelector", "cards", "cardSize", 100).toInt();
|
||||
}
|
||||
|
||||
bool CardsDisplaySettings::getIncludeRebalancedCards() const
|
||||
|
|
@ -42,17 +42,7 @@ bool CardsDisplaySettings::getIncludeRebalancedCards() const
|
|||
|
||||
bool CardsDisplaySettings::getPrintingSelectorNavigationButtonsVisible() const
|
||||
{
|
||||
return getValue("printingselectornavigationbuttonsvisible", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
bool CardsDisplaySettings::getDeckEditorBannerCardComboBoxVisible() const
|
||||
{
|
||||
return getValue("deckeditorbannercardcomboboxvisible", "interface", QString(), true).toBool();
|
||||
}
|
||||
|
||||
bool CardsDisplaySettings::getDeckEditorTagsWidgetVisible() const
|
||||
{
|
||||
return getValue("deckeditortagswidgetvisible", "interface", QString(), true).toBool();
|
||||
return getValue("navigationButtonsVisible", "cards", "printingSelector", true).toBool();
|
||||
}
|
||||
|
||||
bool CardsDisplaySettings::getTapAnimation() const
|
||||
|
|
@ -80,14 +70,34 @@ int CardsDisplaySettings::getCardInfoViewMode() const
|
|||
return getValue("cardinfoviewmode", QString(), QString(), 0).toInt();
|
||||
}
|
||||
|
||||
bool CardsDisplaySettings::getShowShortcuts() const
|
||||
int CardsDisplaySettings::getVisualDeckStorageCardSize() const
|
||||
{
|
||||
return getValue("showshortcuts", "menu", QString(), true).toBool();
|
||||
return getValue("visualDeckStorage", "cards", "cardSize", 100).toInt();
|
||||
}
|
||||
|
||||
bool CardsDisplaySettings::getShowGameSelectorFilterToolbar() const
|
||||
int CardsDisplaySettings::getVisualDatabaseDisplayCardSize() const
|
||||
{
|
||||
return getValue("showgameselectorfiltertoolbar", "menu", QString(), true).toBool();
|
||||
return getValue("visualDatabaseDisplay", "cards", "cardSize", 100).toInt();
|
||||
}
|
||||
|
||||
int CardsDisplaySettings::getVisualDeckEditorCardSize() const
|
||||
{
|
||||
return getValue("visualDeckEditor", "cards", "cardSize", 100).toInt();
|
||||
}
|
||||
|
||||
int CardsDisplaySettings::getEDHRecCardSize() const
|
||||
{
|
||||
return getValue("edhrec", "cards", "cardSize", 100).toInt();
|
||||
}
|
||||
|
||||
int CardsDisplaySettings::getArchidektPreviewSize() const
|
||||
{
|
||||
return getValue("archidektPreview", "cards", "cardSize", 100).toInt();
|
||||
}
|
||||
|
||||
int CardsDisplaySettings::getSampleHandSize() const
|
||||
{
|
||||
return getValue("sampleHandSize", "cards", "cardSize", 7).toInt();
|
||||
}
|
||||
|
||||
void CardsDisplaySettings::setDisplayCardNames(bool _displayCardNames)
|
||||
|
|
@ -119,13 +129,13 @@ void CardsDisplaySettings::setBumpSetsWithCardsInDeckToTop(bool _bumpSetsWithCar
|
|||
|
||||
void CardsDisplaySettings::setPrintingSelectorSortOrder(int _printingSelectorSortOrder)
|
||||
{
|
||||
setValue(_printingSelectorSortOrder, "printingselectorsortorder");
|
||||
setValue(_printingSelectorSortOrder, "sortOrder", "cards", "printingSelector");
|
||||
emit printingSelectorSortOrderChanged();
|
||||
}
|
||||
|
||||
void CardsDisplaySettings::setPrintingSelectorCardSize(int _printingSelectorCardSize)
|
||||
{
|
||||
setValue(_printingSelectorCardSize, "printingselectorcardsize");
|
||||
setValue(_printingSelectorCardSize, "printingSelector", "cards", "cardSize");
|
||||
emit printingSelectorCardSizeChanged();
|
||||
}
|
||||
|
||||
|
|
@ -140,22 +150,10 @@ void CardsDisplaySettings::setIncludeRebalancedCards(bool _includeRebalancedCard
|
|||
|
||||
void CardsDisplaySettings::setPrintingSelectorNavigationButtonsVisible(bool _navigationButtonsVisible)
|
||||
{
|
||||
setValue(_navigationButtonsVisible, "printingselectornavigationbuttonsvisible");
|
||||
setValue(_navigationButtonsVisible, "navigationButtonsVisible", "cards", "printingSelector");
|
||||
emit printingSelectorNavigationButtonsVisibleChanged();
|
||||
}
|
||||
|
||||
void CardsDisplaySettings::setDeckEditorBannerCardComboBoxVisible(bool _deckEditorBannerCardComboBoxVisible)
|
||||
{
|
||||
setValue(_deckEditorBannerCardComboBoxVisible, "deckeditorbannercardcomboboxvisible", "interface");
|
||||
emit deckEditorBannerCardComboBoxVisibleChanged(_deckEditorBannerCardComboBoxVisible);
|
||||
}
|
||||
|
||||
void CardsDisplaySettings::setDeckEditorTagsWidgetVisible(bool _deckEditorTagsWidgetVisible)
|
||||
{
|
||||
setValue(_deckEditorTagsWidgetVisible, "deckeditortagswidgetvisible", "interface");
|
||||
emit deckEditorTagsWidgetVisibleChanged(_deckEditorTagsWidgetVisible);
|
||||
}
|
||||
|
||||
void CardsDisplaySettings::setTapAnimation(bool _tapAnimation)
|
||||
{
|
||||
setValue(_tapAnimation, "tapanimation");
|
||||
|
|
@ -181,13 +179,38 @@ void CardsDisplaySettings::setCardInfoViewMode(int _viewMode)
|
|||
setValue(_viewMode, "cardinfoviewmode");
|
||||
}
|
||||
|
||||
void CardsDisplaySettings::setShowShortcuts(bool _showShortcuts)
|
||||
void CardsDisplaySettings::setVisualDeckStorageCardSize(int _cardSize)
|
||||
{
|
||||
setValue(_showShortcuts, "showshortcuts", "menu");
|
||||
setValue(_cardSize, "visualDeckStorage", "cards", "cardSize");
|
||||
emit visualDeckStorageCardSizeChanged();
|
||||
}
|
||||
|
||||
void CardsDisplaySettings::setShowGameSelectorFilterToolbar(bool _showGameSelectorFilterToolbar)
|
||||
void CardsDisplaySettings::setVisualDatabaseDisplayCardSize(int _cardSize)
|
||||
{
|
||||
setValue(_showGameSelectorFilterToolbar, "showgameselectorfiltertoolbar", "menu");
|
||||
emit showGameSelectorFilterToolbarChanged(_showGameSelectorFilterToolbar);
|
||||
setValue(_cardSize, "visualDatabaseDisplay", "cards", "cardSize");
|
||||
emit visualDatabaseDisplayCardSizeChanged();
|
||||
}
|
||||
|
||||
void CardsDisplaySettings::setVisualDeckEditorCardSize(int _cardSize)
|
||||
{
|
||||
setValue(_cardSize, "visualDeckEditor", "cards", "cardSize");
|
||||
emit visualDeckEditorCardSizeChanged();
|
||||
}
|
||||
|
||||
void CardsDisplaySettings::setEDHRecCardSize(int _edhrecCardSize)
|
||||
{
|
||||
setValue(_edhrecCardSize, "edhrec", "cards", "cardSize");
|
||||
emit edhRecCardSizeChanged();
|
||||
}
|
||||
|
||||
void CardsDisplaySettings::setArchidektPreviewCardSize(int _archidektPreviewCardSize)
|
||||
{
|
||||
setValue(_archidektPreviewCardSize, "archidektPreview", "cards", "cardSize");
|
||||
emit archidektPreviewSizeChanged();
|
||||
}
|
||||
|
||||
void CardsDisplaySettings::setSampleHandSize(int _sampleHandSize)
|
||||
{
|
||||
setValue(_sampleHandSize, "sampleHandSize", "cards", "cardSize");
|
||||
emit sampleHandSizeChanged(_sampleHandSize);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,15 +19,17 @@ public:
|
|||
[[nodiscard]] int getPrintingSelectorCardSize() const override;
|
||||
[[nodiscard]] bool getIncludeRebalancedCards() const override;
|
||||
[[nodiscard]] bool getPrintingSelectorNavigationButtonsVisible() const override;
|
||||
[[nodiscard]] bool getDeckEditorBannerCardComboBoxVisible() const override;
|
||||
[[nodiscard]] bool getDeckEditorTagsWidgetVisible() const override;
|
||||
[[nodiscard]] bool getTapAnimation() const override;
|
||||
[[nodiscard]] bool getAutoRotateSidewaysLayoutCards() const override;
|
||||
[[nodiscard]] bool getScaleCards() const override;
|
||||
[[nodiscard]] int getStackCardOverlapPercent() const override;
|
||||
[[nodiscard]] int getCardInfoViewMode() const override;
|
||||
[[nodiscard]] bool getShowShortcuts() const override;
|
||||
[[nodiscard]] bool getShowGameSelectorFilterToolbar() const override;
|
||||
[[nodiscard]] int getVisualDeckStorageCardSize() const override;
|
||||
[[nodiscard]] int getVisualDatabaseDisplayCardSize() const override;
|
||||
[[nodiscard]] int getVisualDeckEditorCardSize() const override;
|
||||
[[nodiscard]] int getEDHRecCardSize() const override;
|
||||
[[nodiscard]] int getArchidektPreviewSize() const override;
|
||||
[[nodiscard]] int getSampleHandSize() const override;
|
||||
|
||||
void setDisplayCardNames(bool _displayCardNames);
|
||||
void setRoundCardCorners(bool _roundCardCorners);
|
||||
|
|
@ -37,15 +39,17 @@ public:
|
|||
void setPrintingSelectorCardSize(int _printingSelectorCardSize);
|
||||
void setIncludeRebalancedCards(bool _includeRebalancedCards);
|
||||
void setPrintingSelectorNavigationButtonsVisible(bool _navigationButtonsVisible);
|
||||
void setDeckEditorBannerCardComboBoxVisible(bool _deckEditorBannerCardComboBoxVisible);
|
||||
void setDeckEditorTagsWidgetVisible(bool _deckEditorTagsWidgetVisible);
|
||||
void setTapAnimation(bool _tapAnimation);
|
||||
void setAutoRotateSidewaysLayoutCards(bool _autoRotateSidewaysLayoutCards);
|
||||
void setCardScaling(bool _scaleCards);
|
||||
void setStackCardOverlapPercent(int _verticalCardOverlapPercent);
|
||||
void setCardInfoViewMode(int _viewMode);
|
||||
void setShowShortcuts(bool _showShortcuts);
|
||||
void setShowGameSelectorFilterToolbar(bool _showGameSelectorFilterToolbar);
|
||||
void setVisualDeckStorageCardSize(int _cardSize);
|
||||
void setVisualDatabaseDisplayCardSize(int _cardSize);
|
||||
void setVisualDeckEditorCardSize(int _cardSize);
|
||||
void setEDHRecCardSize(int _edhrecCardSize);
|
||||
void setArchidektPreviewCardSize(int _archidektPreviewCardSize);
|
||||
void setSampleHandSize(int _sampleHandSize);
|
||||
|
||||
signals:
|
||||
void displayCardNamesChanged();
|
||||
|
|
@ -56,12 +60,17 @@ signals:
|
|||
void printingSelectorCardSizeChanged();
|
||||
void includeRebalancedCardsChanged(bool _includeRebalancedCards);
|
||||
void printingSelectorNavigationButtonsVisibleChanged();
|
||||
void deckEditorBannerCardComboBoxVisibleChanged(bool _visible);
|
||||
void deckEditorTagsWidgetVisibleChanged(bool _visible);
|
||||
void showGameSelectorFilterToolbarChanged(bool state);
|
||||
void visualDeckStorageCardSizeChanged();
|
||||
void visualDatabaseDisplayCardSizeChanged();
|
||||
void visualDeckEditorCardSizeChanged();
|
||||
void edhRecCardSizeChanged();
|
||||
void archidektPreviewSizeChanged();
|
||||
void sampleHandSizeChanged(int amount);
|
||||
|
||||
public:
|
||||
explicit CardsDisplaySettings(const QString &settingPath, QObject *parent = nullptr);
|
||||
|
||||
private:
|
||||
explicit CardsDisplaySettings(const QString &settingPath, QObject *parent = nullptr);
|
||||
CardsDisplaySettings(const CardsDisplaySettings & /*other*/);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -27,3 +27,25 @@ void DownloadSettings::resetToDefaultURLs()
|
|||
{
|
||||
setValue(QVariant::fromValue(DEFAULT_DOWNLOAD_URLS), "urls");
|
||||
}
|
||||
|
||||
bool DownloadSettings::getPicDownload() const
|
||||
{
|
||||
return getValue("picturedownload", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
void DownloadSettings::setPicDownload(bool _picDownload)
|
||||
{
|
||||
setValue(_picDownload, "picturedownload");
|
||||
emit picDownloadChanged();
|
||||
}
|
||||
|
||||
bool DownloadSettings::getDownloadSpoilersStatus() const
|
||||
{
|
||||
return getValue("downloadspoilers", QString(), QString(), false).toBool();
|
||||
}
|
||||
|
||||
void DownloadSettings::setDownloadSpoilerStatus(bool _spoilerStatus)
|
||||
{
|
||||
setValue(_spoilerStatus, "downloadspoilers");
|
||||
emit downloadSpoilerStatusChanged();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,14 @@ public:
|
|||
QStringList getAllURLs() const;
|
||||
void setDownloadUrls(const QStringList &downloadURLs);
|
||||
void resetToDefaultURLs();
|
||||
[[nodiscard]] bool getPicDownload() const;
|
||||
void setPicDownload(bool _picDownload);
|
||||
[[nodiscard]] bool getDownloadSpoilersStatus() const;
|
||||
void setDownloadSpoilerStatus(bool _spoilerStatus);
|
||||
|
||||
signals:
|
||||
void picDownloadChanged();
|
||||
void downloadSpoilerStatusChanged();
|
||||
};
|
||||
|
||||
#endif // COCKATRICE_DOWNLOADSETTINGS_H
|
||||
|
|
|
|||
|
|
@ -37,17 +37,17 @@ bool InterfaceSettings::getKeepGameChatFocus() const
|
|||
|
||||
bool InterfaceSettings::getNotificationsEnabled() const
|
||||
{
|
||||
return getValue("notificationsenabled", QString(), QString(), true).toBool();
|
||||
return getValue("enabled", "interface", "notifications", true).toBool();
|
||||
}
|
||||
|
||||
bool InterfaceSettings::getSpectatorNotificationsEnabled() const
|
||||
{
|
||||
return getValue("specnotificationsenabled", QString(), QString(), false).toBool();
|
||||
return getValue("spectatorsEnabled", "interface", "notifications", false).toBool();
|
||||
}
|
||||
|
||||
bool InterfaceSettings::getBuddyConnectNotificationsEnabled() const
|
||||
{
|
||||
return getValue("buddyconnectnotificationsenabled", QString(), QString(), true).toBool();
|
||||
return getValue("buddyConnectEnabled", "interface", "notifications", true).toBool();
|
||||
}
|
||||
|
||||
bool InterfaceSettings::getDoubleClickToPlay() const
|
||||
|
|
@ -110,11 +110,6 @@ int InterfaceSettings::getMinPlayersForMultiColumnLayout() const
|
|||
return getValue("min_players_multicolumn", QString(), QString(), 4).toInt();
|
||||
}
|
||||
|
||||
bool InterfaceSettings::getOpenDeckInNewTab() const
|
||||
{
|
||||
return getValue("openDeckInNewTab", "editor", QString(), false).toBool();
|
||||
}
|
||||
|
||||
int InterfaceSettings::getRewindBufferingMs() const
|
||||
{
|
||||
return getValue("rewindBufferingMs", "replay", QString(), 200).toInt();
|
||||
|
|
@ -125,11 +120,6 @@ qreal InterfaceSettings::getFastForwardSpeed() const
|
|||
return getValue("fastForwardSpeed", "replay", QString(), 10).toReal();
|
||||
}
|
||||
|
||||
bool InterfaceSettings::getStyleUserList() const
|
||||
{
|
||||
return getValue("styleUserList", "appearance", QString(), true).toBool();
|
||||
}
|
||||
|
||||
bool InterfaceSettings::getLeftJustified() const
|
||||
{
|
||||
return getValue("leftjustified", QString(), QString(), false).toBool();
|
||||
|
|
@ -150,9 +140,19 @@ bool InterfaceSettings::getZoneViewPileView() const
|
|||
return getValue("pileview", "zoneview", QString(), true).toBool();
|
||||
}
|
||||
|
||||
QString InterfaceSettings::getKnownMissingFeatures()
|
||||
bool InterfaceSettings::getShowStatusBar() const
|
||||
{
|
||||
return getValue("knownmissingfeatures", QString(), QString(), "").toString();
|
||||
return getValue("showStatusBar", QString(), QString(), false).toBool();
|
||||
}
|
||||
|
||||
bool InterfaceSettings::getShowShortcuts() const
|
||||
{
|
||||
return getValue("showShortcuts", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
bool InterfaceSettings::getShowGameSelectorFilterToolbar() const
|
||||
{
|
||||
return getValue("showGameSelectorFilterToolbar", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
void InterfaceSettings::setUseTearOffMenus(bool _useTearOffMenus)
|
||||
|
|
@ -189,17 +189,17 @@ void InterfaceSettings::setKeepGameChatFocus(bool value)
|
|||
|
||||
void InterfaceSettings::setNotificationsEnabled(bool _notificationsEnabled)
|
||||
{
|
||||
setValue(_notificationsEnabled, "notificationsenabled");
|
||||
setValue(_notificationsEnabled, "enabled", "interface", "notifications");
|
||||
}
|
||||
|
||||
void InterfaceSettings::setSpectatorNotificationsEnabled(bool _spectatorNotificationsEnabled)
|
||||
{
|
||||
setValue(_spectatorNotificationsEnabled, "specnotificationsenabled");
|
||||
setValue(_spectatorNotificationsEnabled, "spectatorsEnabled", "interface", "notifications");
|
||||
}
|
||||
|
||||
void InterfaceSettings::setBuddyConnectNotificationsEnabled(bool _buddyConnectNotificationsEnabled)
|
||||
{
|
||||
setValue(_buddyConnectNotificationsEnabled, "buddyconnectnotificationsenabled");
|
||||
setValue(_buddyConnectNotificationsEnabled, "buddyConnectEnabled", "interface", "notifications");
|
||||
}
|
||||
|
||||
void InterfaceSettings::setDoubleClickToPlay(bool _doubleClickToPlay)
|
||||
|
|
@ -269,11 +269,6 @@ void InterfaceSettings::setMinPlayersForMultiColumnLayout(int _minPlayersForMult
|
|||
emit minPlayersForMultiColumnLayoutChanged();
|
||||
}
|
||||
|
||||
void InterfaceSettings::setOpenDeckInNewTab(bool _openDeckInNewTab)
|
||||
{
|
||||
setValue(_openDeckInNewTab, "openDeckInNewTab", "editor");
|
||||
}
|
||||
|
||||
void InterfaceSettings::setRewindBufferingMs(int _rewindBufferingMs)
|
||||
{
|
||||
setValue(_rewindBufferingMs, "rewindBufferingMs", "replay");
|
||||
|
|
@ -284,12 +279,6 @@ void InterfaceSettings::setFastForwardSpeed(qreal _value)
|
|||
setValue(_value, "fastForwardSpeed", "replay");
|
||||
}
|
||||
|
||||
void InterfaceSettings::setStyleUserList(bool _styleUserList)
|
||||
{
|
||||
setValue(_styleUserList, "styleUserList", "appearance");
|
||||
emit styleUserListChanged();
|
||||
}
|
||||
|
||||
void InterfaceSettings::setLeftJustified(bool _leftJustified)
|
||||
{
|
||||
setValue(_leftJustified, "leftjustified");
|
||||
|
|
@ -311,7 +300,19 @@ void InterfaceSettings::setZoneViewPileView(bool _zoneViewPileView)
|
|||
setValue(_zoneViewPileView, "pileview", "zoneview");
|
||||
}
|
||||
|
||||
void InterfaceSettings::setKnownMissingFeatures(const QString &_knownMissingFeatures)
|
||||
void InterfaceSettings::setShowStatusBar(bool _showStatusBar)
|
||||
{
|
||||
setValue(_knownMissingFeatures, "knownmissingfeatures");
|
||||
setValue(_showStatusBar, "showStatusBar");
|
||||
emit showStatusBarChanged(_showStatusBar);
|
||||
}
|
||||
|
||||
void InterfaceSettings::setShowShortcuts(bool _showShortcuts)
|
||||
{
|
||||
setValue(_showShortcuts, "showShortcuts");
|
||||
}
|
||||
|
||||
void InterfaceSettings::setShowGameSelectorFilterToolbar(bool _showGameSelectorFilterToolbar)
|
||||
{
|
||||
setValue(_showGameSelectorFilterToolbar, "showGameSelectorFilterToolbar");
|
||||
emit showGameSelectorFilterToolbarChanged(_showGameSelectorFilterToolbar);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,15 +32,15 @@ public:
|
|||
[[nodiscard]] bool getHorizontalHand() const override;
|
||||
[[nodiscard]] bool getInvertVerticalCoordinate() const override;
|
||||
[[nodiscard]] int getMinPlayersForMultiColumnLayout() const override;
|
||||
[[nodiscard]] bool getOpenDeckInNewTab() const override;
|
||||
[[nodiscard]] int getRewindBufferingMs() const override;
|
||||
[[nodiscard]] qreal getFastForwardSpeed() const override;
|
||||
[[nodiscard]] bool getStyleUserList() const override;
|
||||
[[nodiscard]] bool getLeftJustified() const override;
|
||||
[[nodiscard]] int getZoneViewGroupByIndex() const override;
|
||||
[[nodiscard]] int getZoneViewSortByIndex() const override;
|
||||
[[nodiscard]] bool getZoneViewPileView() const override;
|
||||
[[nodiscard]] QString getKnownMissingFeatures() override;
|
||||
[[nodiscard]] bool getShowStatusBar() const override;
|
||||
[[nodiscard]] bool getShowShortcuts() const override;
|
||||
[[nodiscard]] bool getShowGameSelectorFilterToolbar() const override;
|
||||
|
||||
void setUseTearOffMenus(bool _useTearOffMenus);
|
||||
void setCardViewInitialRowsMax(int _cardViewInitialRowsMax);
|
||||
|
|
@ -63,15 +63,15 @@ public:
|
|||
void setHorizontalHand(bool _horizontalHand);
|
||||
void setInvertVerticalCoordinate(bool _invertVerticalCoordinate);
|
||||
void setMinPlayersForMultiColumnLayout(int _minPlayersForMultiColumnLayout);
|
||||
void setOpenDeckInNewTab(bool _openDeckInNewTab);
|
||||
void setRewindBufferingMs(int _rewindBufferingMs);
|
||||
void setFastForwardSpeed(qreal _value);
|
||||
void setStyleUserList(bool _styleUserList);
|
||||
void setLeftJustified(bool _leftJustified);
|
||||
void setZoneViewGroupByIndex(int _zoneViewGroupByIndex);
|
||||
void setZoneViewSortByIndex(int _zoneViewSortByIndex);
|
||||
void setZoneViewPileView(bool _zoneViewPileView);
|
||||
void setKnownMissingFeatures(const QString &_knownMissingFeatures);
|
||||
void setShowStatusBar(bool _showStatusBar);
|
||||
void setShowShortcuts(bool _showShortcuts);
|
||||
void setShowGameSelectorFilterToolbar(bool _showGameSelectorFilterToolbar);
|
||||
|
||||
signals:
|
||||
void useTearOffMenusChanged(bool state);
|
||||
|
|
@ -79,12 +79,15 @@ signals:
|
|||
void horizontalHandChanged();
|
||||
void invertVerticalCoordinateChanged();
|
||||
void minPlayersForMultiColumnLayoutChanged();
|
||||
void styleUserListChanged();
|
||||
void handJustificationChanged();
|
||||
void tallyTypeChanged(int type);
|
||||
void showStatusBarChanged(bool state);
|
||||
void showGameSelectorFilterToolbarChanged(bool state);
|
||||
|
||||
public:
|
||||
explicit InterfaceSettings(const QString &settingPath, QObject *parent = nullptr);
|
||||
|
||||
private:
|
||||
explicit InterfaceSettings(const QString &settingPath, QObject *parent = nullptr);
|
||||
InterfaceSettings(const InterfaceSettings & /*other*/);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -10,61 +10,6 @@ QString PersonalSettings::getLang() const
|
|||
return getValue("lang", QString(), QString(), QString()).toString();
|
||||
}
|
||||
|
||||
QString PersonalSettings::getClientID()
|
||||
{
|
||||
return getValue("clientid", QString(), QString(), "notset").toString();
|
||||
}
|
||||
|
||||
QString PersonalSettings::getClientVersion()
|
||||
{
|
||||
return getValue("clientversion", QString(), QString(), "notset").toString();
|
||||
}
|
||||
|
||||
int PersonalSettings::getKeepAlive() const
|
||||
{
|
||||
return getValue("keepalive", QString(), QString(), 3).toInt();
|
||||
}
|
||||
|
||||
int PersonalSettings::getTimeOut() const
|
||||
{
|
||||
return getValue("timeout", QString(), QString(), 5).toInt();
|
||||
}
|
||||
|
||||
bool PersonalSettings::getPicDownload() const
|
||||
{
|
||||
return getValue("picturedownload", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
bool PersonalSettings::getShowStatusBar() const
|
||||
{
|
||||
return getValue("showStatusBar", QString(), QString(), false).toBool();
|
||||
}
|
||||
|
||||
int PersonalSettings::getMaxFontSize() const
|
||||
{
|
||||
return getValue("maxfontsize", "game", QString(), 12).toInt();
|
||||
}
|
||||
|
||||
QString PersonalSettings::getHighlightWords() const
|
||||
{
|
||||
return getValue("highlightWords", QString(), QString(), "").toString();
|
||||
}
|
||||
|
||||
QString PersonalSettings::getHomeTabBackgroundSource() const
|
||||
{
|
||||
return getValue("background", "home", QString(), "themed").toString();
|
||||
}
|
||||
|
||||
int PersonalSettings::getHomeTabBackgroundShuffleFrequency() const
|
||||
{
|
||||
return getValue("shuffleTimer", "home/background", QString(), 0).toInt();
|
||||
}
|
||||
|
||||
bool PersonalSettings::getHomeTabDisplayCardName() const
|
||||
{
|
||||
return getValue("displayCardName", "home/background", QString(), true).toBool();
|
||||
}
|
||||
|
||||
bool PersonalSettings::getShowTipsOnStartup() const
|
||||
{
|
||||
return getValue("showTips", "tipOfDay", QString(), true).toBool();
|
||||
|
|
@ -80,78 +25,12 @@ QList<int> PersonalSettings::getSeenTips() const
|
|||
return tips;
|
||||
}
|
||||
|
||||
bool PersonalSettings::getDownloadSpoilersStatus() const
|
||||
{
|
||||
return getValue("downloadspoilers", QString(), QString(), false).toBool();
|
||||
}
|
||||
|
||||
void PersonalSettings::setLang(const QString &_lang)
|
||||
{
|
||||
setValue(_lang, "lang");
|
||||
emit langChanged();
|
||||
}
|
||||
|
||||
void PersonalSettings::setClientID(const QString &_clientID)
|
||||
{
|
||||
setValue(_clientID, "clientid");
|
||||
}
|
||||
|
||||
void PersonalSettings::setClientVersion(const QString &_clientVersion)
|
||||
{
|
||||
setValue(_clientVersion, "clientversion");
|
||||
}
|
||||
|
||||
void PersonalSettings::setPicDownload(bool _picDownload)
|
||||
{
|
||||
setValue(_picDownload, "picturedownload");
|
||||
emit picDownloadChanged();
|
||||
}
|
||||
|
||||
void PersonalSettings::setShowStatusBar(bool value)
|
||||
{
|
||||
setValue(value, "showStatusBar");
|
||||
emit showStatusBarChanged(value);
|
||||
}
|
||||
|
||||
void PersonalSettings::setMaxFontSize(int _max)
|
||||
{
|
||||
setValue(_max, "maxfontsize", "game");
|
||||
}
|
||||
|
||||
QString PersonalSettings::getThemeName() const
|
||||
{
|
||||
return getValue("themeName", QString(), QString()).toString();
|
||||
}
|
||||
|
||||
void PersonalSettings::setThemeName(const QString &_themeName)
|
||||
{
|
||||
setValue(_themeName, "themeName");
|
||||
emit themeNameChanged();
|
||||
}
|
||||
|
||||
void PersonalSettings::setHighlightWords(const QString &_highlightWords)
|
||||
{
|
||||
setValue(_highlightWords, "highlightWords");
|
||||
}
|
||||
|
||||
void PersonalSettings::setHomeTabBackgroundSource(const QString &_backgroundSource)
|
||||
{
|
||||
setValue(_backgroundSource, "background", "home");
|
||||
emit homeTabBackgroundSourceChanged();
|
||||
}
|
||||
|
||||
void PersonalSettings::setHomeTabBackgroundShuffleFrequency(int _frequency)
|
||||
{
|
||||
setValue(_frequency, "shuffleTimer", "home/background");
|
||||
emit homeTabBackgroundShuffleFrequencyChanged();
|
||||
}
|
||||
|
||||
void PersonalSettings::setHomeTabDisplayCardName(bool _displayCardName)
|
||||
{
|
||||
setValue(_displayCardName, "displayCardName", "home/background");
|
||||
emit homeTabDisplayCardNameChanged();
|
||||
}
|
||||
|
||||
void PersonalSettings::setShowTipsOnStartup(bool _showTipsOnStartup)
|
||||
{
|
||||
setValue(_showTipsOnStartup, "showTips", "tipOfDay");
|
||||
|
|
@ -165,9 +44,3 @@ void PersonalSettings::setSeenTips(const QList<int> &_seenTips)
|
|||
}
|
||||
setValue(QVariant::fromValue(storedTipList), "seenTips", "tipOfDay");
|
||||
}
|
||||
|
||||
void PersonalSettings::setDownloadSpoilerStatus(bool _spoilerStatus)
|
||||
{
|
||||
setValue(_spoilerStatus, "downloadspoilers");
|
||||
emit downloadSpoilerStatusChanged();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,46 +14,15 @@ class PersonalSettings : public SettingsManager, public IPersonalSettingsProvide
|
|||
|
||||
public:
|
||||
[[nodiscard]] QString getLang() const override;
|
||||
[[nodiscard]] QString getClientID() override;
|
||||
[[nodiscard]] QString getClientVersion() override;
|
||||
[[nodiscard]] int getKeepAlive() const override;
|
||||
[[nodiscard]] int getTimeOut() const override;
|
||||
[[nodiscard]] bool getPicDownload() const override;
|
||||
[[nodiscard]] bool getShowStatusBar() const override;
|
||||
[[nodiscard]] int getMaxFontSize() const override;
|
||||
[[nodiscard]] QString getHighlightWords() const override;
|
||||
[[nodiscard]] QString getHomeTabBackgroundSource() const override;
|
||||
[[nodiscard]] int getHomeTabBackgroundShuffleFrequency() const override;
|
||||
[[nodiscard]] QString getThemeName() const;
|
||||
void setThemeName(const QString &_themeName);
|
||||
[[nodiscard]] bool getHomeTabDisplayCardName() const override;
|
||||
[[nodiscard]] bool getShowTipsOnStartup() const override;
|
||||
[[nodiscard]] QList<int> getSeenTips() const override;
|
||||
[[nodiscard]] bool getDownloadSpoilersStatus() const override;
|
||||
|
||||
void setLang(const QString &_lang);
|
||||
void setClientID(const QString &_clientID);
|
||||
void setClientVersion(const QString &_clientVersion);
|
||||
void setPicDownload(bool _picDownload);
|
||||
void setShowStatusBar(bool value);
|
||||
void setMaxFontSize(int _max);
|
||||
void setHighlightWords(const QString &_highlightWords);
|
||||
void setHomeTabBackgroundSource(const QString &_backgroundSource);
|
||||
void setHomeTabBackgroundShuffleFrequency(int _frequency);
|
||||
void setHomeTabDisplayCardName(bool _displayCardName);
|
||||
void setShowTipsOnStartup(bool _showTipsOnStartup);
|
||||
void setSeenTips(const QList<int> &_seenTips);
|
||||
void setDownloadSpoilerStatus(bool _spoilerStatus);
|
||||
|
||||
signals:
|
||||
void langChanged();
|
||||
void themeNameChanged();
|
||||
void picDownloadChanged();
|
||||
void showStatusBarChanged(bool state);
|
||||
void homeTabBackgroundSourceChanged();
|
||||
void homeTabBackgroundShuffleFrequencyChanged();
|
||||
void homeTabDisplayCardNameChanged();
|
||||
void downloadSpoilerStatusChanged();
|
||||
|
||||
public:
|
||||
explicit PersonalSettings(const QString &settingPath, QObject *parent = nullptr);
|
||||
|
|
|
|||
|
|
@ -77,7 +77,10 @@ static void migrateChatSettings(const QString &settingsPath, QSettings &globalIn
|
|||
QStringList chatKeys = globalIni.childKeys();
|
||||
globalIni.endGroup();
|
||||
|
||||
if (chatKeys.isEmpty()) {
|
||||
// Legacy highlight words lived under [personal], but the chat settings
|
||||
// class reads them from [chat]
|
||||
bool hasHighlightWords = globalIni.contains("personal/highlightWords");
|
||||
if (chatKeys.isEmpty() && !hasHighlightWords) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -85,16 +88,23 @@ static void migrateChatSettings(const QString &settingsPath, QSettings &globalIn
|
|||
for (const auto &key : chatKeys) {
|
||||
chatIni.setValue("chat/" + key, globalIni.value("chat/" + key));
|
||||
}
|
||||
if (hasHighlightWords) {
|
||||
chatIni.setValue("chat/highlightwords", globalIni.value("personal/highlightWords"));
|
||||
}
|
||||
}
|
||||
|
||||
static void migrateCacheStorageSettings(const QString &settingsPath, QSettings &globalIni)
|
||||
{
|
||||
const QStringList cacheKeys = {"personal/pixmapCacheSize", "personal/networkCacheSize", "personal/redirectCacheTtl",
|
||||
"personal/cardPictureLoaderCacheMethod",
|
||||
"personal/localCardImageStorageNamingScheme"};
|
||||
const QMap<QString, QString> cacheStorageKeyMap = {
|
||||
{"personal/pixmapCacheSize", "cache_storage/pixmapCacheSize"},
|
||||
{"personal/networkCacheSize", "cache_storage/networkCacheSize"},
|
||||
{"personal/redirectCacheTtl", "cache_storage/redirectCacheTtl"},
|
||||
{"personal/cardPictureLoaderCacheMethod", "cache_storage/cardPictureLoaderCacheMethod"},
|
||||
{"personal/localCardImageStorageNamingScheme", "cache_storage/localCardImageStorageNamingScheme"},
|
||||
};
|
||||
bool hasAny = false;
|
||||
for (const auto &key : cacheKeys) {
|
||||
if (globalIni.contains(key)) {
|
||||
for (auto it = cacheStorageKeyMap.constBegin(); it != cacheStorageKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
hasAny = true;
|
||||
break;
|
||||
}
|
||||
|
|
@ -104,9 +114,9 @@ static void migrateCacheStorageSettings(const QString &settingsPath, QSettings &
|
|||
}
|
||||
|
||||
QSettings cacheStorageIni(settingsPath + "cache_storage.ini", QSettings::IniFormat);
|
||||
for (const auto &key : cacheKeys) {
|
||||
if (globalIni.contains(key)) {
|
||||
cacheStorageIni.setValue(key, globalIni.value(key));
|
||||
for (auto it = cacheStorageKeyMap.constBegin(); it != cacheStorageKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
cacheStorageIni.setValue(it.value(), globalIni.value(it.key()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -145,19 +155,7 @@ static void migrateUpdatesSettings(const QString &settingsPath, QSettings &globa
|
|||
|
||||
static void migratePersonalSettings(const QString &settingsPath, QSettings &globalIni)
|
||||
{
|
||||
const QStringList personalRootKeys = {"personal/lang", "personal/highlightWords"};
|
||||
const QMap<QString, QString> personalKeyMap = {
|
||||
{"theme/name", "personal/themeName"},
|
||||
{"personal/clientid", "personal/clientid"},
|
||||
{"personal/clientversion", "personal/clientversion"},
|
||||
{"personal/keepalive", "personal/keepalive"},
|
||||
{"personal/timeout", "personal/timeout"},
|
||||
{"personal/picturedownload", "personal/picturedownload"},
|
||||
{"personal/showStatusBar", "personal/showStatusBar"},
|
||||
{"game/maxfontsize", "game/maxfontsize"},
|
||||
{"personal/downloadspoilers", "personal/downloadspoilers"},
|
||||
};
|
||||
const QStringList homeKeys = {"home/background", "home/background/shuffleTimer", "home/background/displayCardName"};
|
||||
const QStringList personalRootKeys = {"personal/lang"};
|
||||
const QStringList tipKeys = {"tipOfDay/showTips", "tipOfDay/seenTips"};
|
||||
|
||||
bool hasAny = false;
|
||||
|
|
@ -166,16 +164,6 @@ static void migratePersonalSettings(const QString &settingsPath, QSettings &glob
|
|||
hasAny = true;
|
||||
}
|
||||
}
|
||||
for (auto it = personalKeyMap.constBegin(); it != personalKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
hasAny = true;
|
||||
}
|
||||
}
|
||||
for (const auto &key : homeKeys) {
|
||||
if (globalIni.contains(key)) {
|
||||
hasAny = true;
|
||||
}
|
||||
}
|
||||
for (const auto &key : tipKeys) {
|
||||
if (globalIni.contains(key)) {
|
||||
hasAny = true;
|
||||
|
|
@ -191,16 +179,6 @@ static void migratePersonalSettings(const QString &settingsPath, QSettings &glob
|
|||
personalIni.setValue(key, globalIni.value(key));
|
||||
}
|
||||
}
|
||||
for (auto it = personalKeyMap.constBegin(); it != personalKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
personalIni.setValue(it.value(), globalIni.value(it.key()));
|
||||
}
|
||||
}
|
||||
for (const auto &key : homeKeys) {
|
||||
if (globalIni.contains(key)) {
|
||||
personalIni.setValue(key, globalIni.value(key));
|
||||
}
|
||||
}
|
||||
for (const auto &key : tipKeys) {
|
||||
if (globalIni.contains(key)) {
|
||||
personalIni.setValue(key, globalIni.value(key));
|
||||
|
|
@ -215,19 +193,24 @@ static void migrateCardsDisplaySettings(const QString &settingsPath, QSettings &
|
|||
"cards/roundcardcorners",
|
||||
"cards/overrideallcardartwithpersonalpreference",
|
||||
"cards/bumpsetswithcardsindecktotop",
|
||||
"cards/printingselectorsortorder",
|
||||
"cards/printingselectorcardsize",
|
||||
"cards/includerebalancedcards",
|
||||
"cards/printingselectornavigationbuttonsvisible",
|
||||
"cards/tapanimation",
|
||||
"cards/autorotatesidewayslayoutcards",
|
||||
"cards/scaleCards",
|
||||
"cards/verticalCardOverlapPercent",
|
||||
"cards/cardinfoviewmode",
|
||||
};
|
||||
const QStringList cardsInterfaceKeys = {"interface/deckeditorbannercardcomboboxvisible",
|
||||
"interface/deckeditortagswidgetvisible"};
|
||||
const QStringList menuKeys = {"menu/showshortcuts", "menu/showgameselectorfiltertoolbar"};
|
||||
const QMap<QString, QString> cardsKeyMap = {
|
||||
{"cards/printingselectorsortorder", "cards/printingSelector/sortOrder"},
|
||||
{"cards/printingselectornavigationbuttonsvisible", "cards/printingSelector/navigationButtonsVisible"},
|
||||
{"cards/printingselectorcardsize", "cards/cardSize/printingSelector"},
|
||||
{"interface/visualdeckstoragecardsize", "cards/cardSize/visualDeckStorage"},
|
||||
{"interface/visualdatabasedisplaycardsize", "cards/cardSize/visualDatabaseDisplay"},
|
||||
{"interface/visualdeckeditorcardsize", "cards/cardSize/visualDeckEditor"},
|
||||
{"interface/edhreccardsize", "cards/cardSize/edhrec"},
|
||||
{"interface/archidektpreviewsize", "cards/cardSize/archidektPreview"},
|
||||
{"interface/visualdeckeditorsamplehandsize", "cards/cardSize/sampleHandSize"},
|
||||
};
|
||||
|
||||
bool hasAny = false;
|
||||
for (const auto &key : cardsRootKeys) {
|
||||
|
|
@ -235,13 +218,8 @@ static void migrateCardsDisplaySettings(const QString &settingsPath, QSettings &
|
|||
hasAny = true;
|
||||
}
|
||||
}
|
||||
for (const auto &key : cardsInterfaceKeys) {
|
||||
if (globalIni.contains(key)) {
|
||||
hasAny = true;
|
||||
}
|
||||
}
|
||||
for (const auto &key : menuKeys) {
|
||||
if (globalIni.contains(key)) {
|
||||
for (auto it = cardsKeyMap.constBegin(); it != cardsKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
hasAny = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -255,14 +233,9 @@ static void migrateCardsDisplaySettings(const QString &settingsPath, QSettings &
|
|||
cardsIni.setValue(key, globalIni.value(key));
|
||||
}
|
||||
}
|
||||
for (const auto &key : cardsInterfaceKeys) {
|
||||
if (globalIni.contains(key)) {
|
||||
cardsIni.setValue(key, globalIni.value(key));
|
||||
}
|
||||
}
|
||||
for (const auto &key : menuKeys) {
|
||||
if (globalIni.contains(key)) {
|
||||
cardsIni.setValue(key, globalIni.value(key));
|
||||
for (auto it = cardsKeyMap.constBegin(); it != cardsKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
cardsIni.setValue(it.value(), globalIni.value(it.key()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -276,9 +249,6 @@ static void migrateInterfaceSettings(const QString &settingsPath, QSettings &glo
|
|||
"interface/closeEmptyCardView",
|
||||
"interface/focusCardViewSearchBar",
|
||||
"interface/keepGameChatFocus",
|
||||
"interface/notificationsenabled",
|
||||
"interface/specnotificationsenabled",
|
||||
"interface/buddyconnectnotificationsenabled",
|
||||
"interface/doubleclicktoplay",
|
||||
"interface/clickPlaysAllSelected",
|
||||
"interface/playtostack",
|
||||
|
|
@ -287,14 +257,21 @@ static void migrateInterfaceSettings(const QString &settingsPath, QSettings &glo
|
|||
"interface/annotatetokens",
|
||||
"interface/showlassoselectioncount",
|
||||
"interface/showpersistentselectioncount",
|
||||
"interface/showsubtypeselectiontally",
|
||||
"interface/tallyType",
|
||||
"interface/leftjustified",
|
||||
"interface/min_players_multicolumn",
|
||||
"interface/knownmissingfeatures",
|
||||
};
|
||||
const QStringList interfaceSubKeys = {
|
||||
"hand/horizontal", "table/invert_vertical", "editor/openDeckInNewTab", "replay/rewindBufferingMs",
|
||||
"appearance/styleUserList", "zoneview/groupby", "zoneview/sortby", "zoneview/pileview"};
|
||||
"hand/horizontal", "table/invert_vertical", "replay/rewindBufferingMs", "replay/fastForwardSpeed",
|
||||
"zoneview/groupby", "zoneview/sortby", "zoneview/pileview"};
|
||||
const QMap<QString, QString> interfaceKeyMap = {
|
||||
{"personal/showStatusBar", "interface/showStatusBar"},
|
||||
{"menu/showshortcuts", "interface/showShortcuts"},
|
||||
{"menu/showgameselectorfiltertoolbar", "interface/showGameSelectorFilterToolbar"},
|
||||
{"interface/notificationsenabled", "interface/notifications/enabled"},
|
||||
{"interface/specnotificationsenabled", "interface/notifications/spectatorsEnabled"},
|
||||
{"interface/buddyconnectnotificationsenabled", "interface/notifications/buddyConnectEnabled"},
|
||||
};
|
||||
bool hasAny = false;
|
||||
for (const auto &key : interfaceRootKeys) {
|
||||
if (globalIni.contains(key)) {
|
||||
|
|
@ -306,6 +283,11 @@ static void migrateInterfaceSettings(const QString &settingsPath, QSettings &glo
|
|||
hasAny = true;
|
||||
}
|
||||
}
|
||||
for (auto it = interfaceKeyMap.constBegin(); it != interfaceKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
hasAny = true;
|
||||
}
|
||||
}
|
||||
if (!hasAny) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -321,6 +303,93 @@ static void migrateInterfaceSettings(const QString &settingsPath, QSettings &glo
|
|||
interfaceIni.setValue(key, globalIni.value(key));
|
||||
}
|
||||
}
|
||||
for (auto it = interfaceKeyMap.constBegin(); it != interfaceKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
interfaceIni.setValue(it.value(), globalIni.value(it.key()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void migrateDownloadSettings(const QString &settingsPath, QSettings &globalIni)
|
||||
{
|
||||
const QMap<QString, QString> downloadKeyMap = {
|
||||
{"personal/picturedownload", "downloads/picturedownload"},
|
||||
{"personal/downloadspoilers", "downloads/downloadspoilers"},
|
||||
};
|
||||
bool hasAny = false;
|
||||
for (auto it = downloadKeyMap.constBegin(); it != downloadKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
hasAny = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!hasAny) {
|
||||
return;
|
||||
}
|
||||
|
||||
QSettings downloadsIni(settingsPath + "downloads.ini", QSettings::IniFormat);
|
||||
for (auto it = downloadKeyMap.constBegin(); it != downloadKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
downloadsIni.setValue(it.value(), globalIni.value(it.key()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void migrateAppearanceSettings(const QString &settingsPath, QSettings &globalIni)
|
||||
{
|
||||
const QMap<QString, QString> appearanceKeyMap = {
|
||||
{"theme/name", "appearance/themeName"},
|
||||
{"game/maxfontsize", "appearance/maxFontSize"},
|
||||
{"home/background", "appearance/homeTabBackgroundSource"},
|
||||
{"home/background/shuffleTimer", "appearance/homeTabBackgroundShuffleFrequency"},
|
||||
{"home/background/displayCardName", "appearance/homeTabDisplayCardName"},
|
||||
{"appearance/styleUserList", "appearance/styleUserList"},
|
||||
};
|
||||
bool hasAny = false;
|
||||
for (auto it = appearanceKeyMap.constBegin(); it != appearanceKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
hasAny = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!hasAny) {
|
||||
return;
|
||||
}
|
||||
|
||||
QSettings appearanceIni(settingsPath + "appearance.ini", QSettings::IniFormat);
|
||||
for (auto it = appearanceKeyMap.constBegin(); it != appearanceKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
appearanceIni.setValue(it.value(), globalIni.value(it.key()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void migrateNetworkSettings(const QString &settingsPath, QSettings &globalIni)
|
||||
{
|
||||
const QMap<QString, QString> networkKeyMap = {
|
||||
{"personal/clientid", "network/clientid"},
|
||||
{"personal/clientversion", "network/clientversion"},
|
||||
{"personal/keepalive", "network/keepalive"},
|
||||
{"personal/timeout", "network/timeout"},
|
||||
{"interface/knownmissingfeatures", "network/knownmissingfeatures"},
|
||||
};
|
||||
bool hasAny = false;
|
||||
for (auto it = networkKeyMap.constBegin(); it != networkKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
hasAny = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!hasAny) {
|
||||
return;
|
||||
}
|
||||
|
||||
QSettings networkIni(settingsPath + "network.ini", QSettings::IniFormat);
|
||||
for (auto it = networkKeyMap.constBegin(); it != networkKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
networkIni.setValue(it.value(), globalIni.value(it.key()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void migratePathsSettings(const QString &settingsPath, QSettings &globalIni)
|
||||
|
|
@ -340,33 +409,32 @@ static void migratePathsSettings(const QString &settingsPath, QSettings &globalI
|
|||
|
||||
static void migrateVisualDeckStorageSettings(const QString &settingsPath, QSettings &globalIni)
|
||||
{
|
||||
const QStringList vdsKeys = {"interface/visualdeckstoragecardsize",
|
||||
"interface/visualdeckstoragesortingorder",
|
||||
"interface/visualdeckstorageshowfolders",
|
||||
"interface/visualdeckstorageshowtagfilter",
|
||||
"interface/visualdeckstoragedefaulttagslist",
|
||||
"interface/visualdeckstoragesearchfoldernames",
|
||||
"interface/visualdeckstorageshowcoloridentity",
|
||||
"interface/visualdeckstorageshowbannercardcombobox",
|
||||
"interface/visualdeckstorageshowtagsondeckpreviews",
|
||||
"interface/visualdeckstoragedrawunusedcoloridentities",
|
||||
"interface/visualdeckstorageunusedcoloridentitiesopacity",
|
||||
"interface/visualdeckstoragetooltiptype",
|
||||
"interface/visualdeckstoragepromptforconversion",
|
||||
"interface/visualdeckstoragealwaysconvert",
|
||||
"interface/visualdeckstorageingame",
|
||||
"interface/visualdeckstorageselectionanimation",
|
||||
"interface/defaultDeckEditorType",
|
||||
"interface/visualdatabasedisplayfiltertomostrecentsetsenabled",
|
||||
"interface/visualdatabasedisplayfiltertomostrecentsetsamount",
|
||||
"interface/visualdeckeditorsamplehandsize",
|
||||
"interface/visualdeckeditorcardsize",
|
||||
"interface/visualdatabasedisplaycardsize",
|
||||
"interface/edhreccardsize",
|
||||
"interface/archidektpreviewsize"};
|
||||
const QMap<QString, QString> vdsKeyMap = {
|
||||
{"interface/visualdeckstoragesortingorder", "interface/visualDeckStorage/sortingOrder"},
|
||||
{"interface/visualdeckstorageshowfolders", "interface/visualDeckStorage/showFolders"},
|
||||
{"interface/visualdeckstorageshowtagfilter", "interface/visualDeckStorage/showTagFilter"},
|
||||
{"interface/visualdeckstoragedefaulttagslist", "interface/visualDeckStorage/defaultTagsList"},
|
||||
{"interface/visualdeckstoragesearchfoldernames", "interface/visualDeckStorage/searchFolderNames"},
|
||||
{"interface/visualdeckstorageshowcoloridentity", "interface/visualDeckStorage/showColorIdentity"},
|
||||
{"interface/visualdeckstorageshowbannercardcombobox", "interface/visualDeckStorage/showBannerCardComboBox"},
|
||||
{"interface/visualdeckstorageshowtagsondeckpreviews", "interface/visualDeckStorage/showTagsOnDeckPreviews"},
|
||||
{"interface/visualdeckstoragedrawunusedcoloridentities",
|
||||
"interface/visualDeckStorage/drawUnusedColorIdentities"},
|
||||
{"interface/visualdeckstorageunusedcoloridentitiesopacity",
|
||||
"interface/visualDeckStorage/unusedColorIdentitiesOpacity"},
|
||||
{"interface/visualdeckstoragetooltiptype", "interface/visualDeckStorage/tooltipType"},
|
||||
{"interface/visualdeckstoragepromptforconversion", "interface/visualDeckStorage/promptForConversion"},
|
||||
{"interface/visualdeckstoragealwaysconvert", "interface/visualDeckStorage/alwaysConvert"},
|
||||
{"interface/visualdeckstorageingame", "interface/visualDeckStorage/inGame"},
|
||||
{"interface/visualdeckstorageselectionanimation", "interface/visualDeckStorage/selectionAnimation"},
|
||||
{"interface/visualdatabasedisplayfiltertomostrecentsetsenabled",
|
||||
"interface/visualDatabaseDisplay/filterToMostRecentSetsEnabled"},
|
||||
{"interface/visualdatabasedisplayfiltertomostrecentsetsamount",
|
||||
"interface/visualDatabaseDisplay/filterToMostRecentSetsAmount"},
|
||||
};
|
||||
bool hasAny = false;
|
||||
for (const auto &key : vdsKeys) {
|
||||
if (globalIni.contains(key)) {
|
||||
for (auto it = vdsKeyMap.constBegin(); it != vdsKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
hasAny = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -375,9 +443,36 @@ static void migrateVisualDeckStorageSettings(const QString &settingsPath, QSetti
|
|||
}
|
||||
|
||||
QSettings vdsIni(settingsPath + "visual_deck_storage.ini", QSettings::IniFormat);
|
||||
for (const auto &key : vdsKeys) {
|
||||
if (globalIni.contains(key)) {
|
||||
vdsIni.setValue(key, globalIni.value(key));
|
||||
for (auto it = vdsKeyMap.constBegin(); it != vdsKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
vdsIni.setValue(it.value(), globalIni.value(it.key()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void migrateDeckEditorSettings(const QString &settingsPath, QSettings &globalIni)
|
||||
{
|
||||
const QMap<QString, QString> deckEditorKeyMap = {
|
||||
{"editor/openDeckInNewTab", "deckeditor/openDeckInNewTab"},
|
||||
{"interface/deckeditorbannercardcomboboxvisible", "deckeditor/bannerCardComboBoxVisible"},
|
||||
{"interface/deckeditortagswidgetvisible", "deckeditor/tagsWidgetVisible"},
|
||||
{"interface/defaultDeckEditorType", "deckeditor/defaultDeckEditorType"},
|
||||
};
|
||||
bool hasAny = false;
|
||||
for (auto it = deckEditorKeyMap.constBegin(); it != deckEditorKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
hasAny = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!hasAny) {
|
||||
return;
|
||||
}
|
||||
|
||||
QSettings deckEditorIni(settingsPath + "deck_editor.ini", QSettings::IniFormat);
|
||||
for (auto it = deckEditorKeyMap.constBegin(); it != deckEditorKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
deckEditorIni.setValue(it.value(), globalIni.value(it.key()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -503,10 +598,14 @@ bool SettingsMigration::migrateSettingsFromGlobalIni(const QString &settingsPath
|
|||
migrateCacheStorageSettings(settingsPath, globalIni);
|
||||
migrateUpdatesSettings(settingsPath, globalIni);
|
||||
migratePersonalSettings(settingsPath, globalIni);
|
||||
migrateDownloadSettings(settingsPath, globalIni);
|
||||
migrateCardsDisplaySettings(settingsPath, globalIni);
|
||||
migrateInterfaceSettings(settingsPath, globalIni);
|
||||
migrateAppearanceSettings(settingsPath, globalIni);
|
||||
migrateNetworkSettings(settingsPath, globalIni);
|
||||
migratePathsSettings(settingsPath, globalIni);
|
||||
migrateVisualDeckStorageSettings(settingsPath, globalIni);
|
||||
migrateDeckEditorSettings(settingsPath, globalIni);
|
||||
|
||||
QFile::remove(settingsPath + "global.ini.old");
|
||||
QFile::rename(settingsPath + "global.ini", settingsPath + "global.ini.old");
|
||||
|
|
|
|||
|
|
@ -91,258 +91,182 @@ VisualDeckStorageSettings::VisualDeckStorageSettings(const QString &settingPath,
|
|||
|
||||
int VisualDeckStorageSettings::getVisualDeckStorageSortingOrder() const
|
||||
{
|
||||
return getValue("visualdeckstoragesortingorder", QString(), QString(), 0).toInt();
|
||||
return getValue("sortingOrder", "interface", "visualDeckStorage", 0).toInt();
|
||||
}
|
||||
|
||||
bool VisualDeckStorageSettings::getVisualDeckStorageShowFolders() const
|
||||
{
|
||||
return getValue("visualdeckstorageshowfolders", QString(), QString(), true).toBool();
|
||||
return getValue("showFolders", "interface", "visualDeckStorage", true).toBool();
|
||||
}
|
||||
|
||||
bool VisualDeckStorageSettings::getVisualDeckStorageShowTagFilter() const
|
||||
{
|
||||
return getValue("visualdeckstorageshowtagfilter", QString(), QString(), true).toBool();
|
||||
return getValue("showTagFilter", "interface", "visualDeckStorage", true).toBool();
|
||||
}
|
||||
|
||||
QStringList VisualDeckStorageSettings::getVisualDeckStorageDefaultTagsList() const
|
||||
{
|
||||
return getValue("visualdeckstoragedefaulttagslist", QString(), QString(), QVariant::fromValue(defaultTags))
|
||||
return getValue("defaultTagsList", "interface", "visualDeckStorage", QVariant::fromValue(defaultTags))
|
||||
.toStringList();
|
||||
}
|
||||
|
||||
bool VisualDeckStorageSettings::getVisualDeckStorageSearchFolderNames() const
|
||||
{
|
||||
return getValue("visualdeckstoragesearchfoldernames", QString(), QString(), true).toBool();
|
||||
return getValue("searchFolderNames", "interface", "visualDeckStorage", true).toBool();
|
||||
}
|
||||
|
||||
bool VisualDeckStorageSettings::getVisualDeckStorageShowColorIdentity() const
|
||||
{
|
||||
return getValue("visualdeckstorageshowcoloridentity", QString(), QString(), true).toBool();
|
||||
return getValue("showColorIdentity", "interface", "visualDeckStorage", true).toBool();
|
||||
}
|
||||
|
||||
bool VisualDeckStorageSettings::getVisualDeckStorageShowBannerCardComboBox() const
|
||||
{
|
||||
return getValue("visualdeckstorageshowbannercardcombobox", QString(), QString(), true).toBool();
|
||||
return getValue("showBannerCardComboBox", "interface", "visualDeckStorage", true).toBool();
|
||||
}
|
||||
|
||||
bool VisualDeckStorageSettings::getVisualDeckStorageShowTagsOnDeckPreviews() const
|
||||
{
|
||||
return getValue("visualdeckstorageshowtagsondeckpreviews", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
int VisualDeckStorageSettings::getVisualDeckStorageCardSize() const
|
||||
{
|
||||
return getValue("visualdeckstoragecardsize", QString(), QString(), 100).toInt();
|
||||
return getValue("showTagsOnDeckPreviews", "interface", "visualDeckStorage", true).toBool();
|
||||
}
|
||||
|
||||
bool VisualDeckStorageSettings::getVisualDeckStorageDrawUnusedColorIdentities() const
|
||||
{
|
||||
return getValue("visualdeckstoragedrawunusedcoloridentities", QString(), QString(), true).toBool();
|
||||
return getValue("drawUnusedColorIdentities", "interface", "visualDeckStorage", true).toBool();
|
||||
}
|
||||
|
||||
int VisualDeckStorageSettings::getVisualDeckStorageUnusedColorIdentitiesOpacity() const
|
||||
{
|
||||
return getValue("visualdeckstorageunusedcoloridentitiesopacity", QString(), QString(), 15).toInt();
|
||||
return getValue("unusedColorIdentitiesOpacity", "interface", "visualDeckStorage", 15).toInt();
|
||||
}
|
||||
|
||||
int VisualDeckStorageSettings::getVisualDeckStorageTooltipType() const
|
||||
{
|
||||
return getValue("visualdeckstoragetooltiptype", QString(), QString(), 0).toInt();
|
||||
return getValue("tooltipType", "interface", "visualDeckStorage", 0).toInt();
|
||||
}
|
||||
|
||||
bool VisualDeckStorageSettings::getVisualDeckStoragePromptForConversion() const
|
||||
{
|
||||
return getValue("visualdeckstoragepromptforconversion", QString(), QString(), true).toBool();
|
||||
return getValue("promptForConversion", "interface", "visualDeckStorage", true).toBool();
|
||||
}
|
||||
|
||||
bool VisualDeckStorageSettings::getVisualDeckStorageAlwaysConvert() const
|
||||
{
|
||||
return getValue("visualdeckstoragealwaysconvert", QString(), QString(), false).toBool();
|
||||
return getValue("alwaysConvert", "interface", "visualDeckStorage", false).toBool();
|
||||
}
|
||||
|
||||
bool VisualDeckStorageSettings::getVisualDeckStorageInGame() const
|
||||
{
|
||||
return getValue("visualdeckstorageingame", QString(), QString(), true).toBool();
|
||||
return getValue("inGame", "interface", "visualDeckStorage", true).toBool();
|
||||
}
|
||||
|
||||
bool VisualDeckStorageSettings::getVisualDeckStorageSelectionAnimation() const
|
||||
{
|
||||
return getValue("visualdeckstorageselectionanimation", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
int VisualDeckStorageSettings::getVisualDeckEditorCardSize() const
|
||||
{
|
||||
return getValue("visualdeckeditorcardsize", QString(), QString(), 100).toInt();
|
||||
}
|
||||
|
||||
int VisualDeckStorageSettings::getVisualDeckEditorSampleHandSize() const
|
||||
{
|
||||
return getValue("visualdeckeditorsamplehandsize", QString(), QString(), 7).toInt();
|
||||
}
|
||||
|
||||
int VisualDeckStorageSettings::getVisualDatabaseDisplayCardSize() const
|
||||
{
|
||||
return getValue("visualdatabasedisplaycardsize", QString(), QString(), 100).toInt();
|
||||
return getValue("selectionAnimation", "interface", "visualDeckStorage", true).toBool();
|
||||
}
|
||||
|
||||
bool VisualDeckStorageSettings::getVisualDatabaseDisplayFilterToMostRecentSetsEnabled() const
|
||||
{
|
||||
return getValue("visualdatabasedisplayfiltertomostrecentsetsenabled", QString(), QString(), false).toBool();
|
||||
return getValue("filterToMostRecentSetsEnabled", "interface", "visualDatabaseDisplay", false).toBool();
|
||||
}
|
||||
|
||||
int VisualDeckStorageSettings::getVisualDatabaseDisplayFilterToMostRecentSetsAmount() const
|
||||
{
|
||||
return getValue("visualdatabasedisplayfiltertomostrecentsetsamount", QString(), QString(), 10).toInt();
|
||||
}
|
||||
|
||||
int VisualDeckStorageSettings::getEDHRecCardSize() const
|
||||
{
|
||||
return getValue("edhreccardsize", QString(), QString(), 100).toInt();
|
||||
}
|
||||
|
||||
int VisualDeckStorageSettings::getArchidektPreviewSize() const
|
||||
{
|
||||
return getValue("archidektpreviewsize", QString(), QString(), 100).toInt();
|
||||
}
|
||||
|
||||
int VisualDeckStorageSettings::getDefaultDeckEditorType() const
|
||||
{
|
||||
return getValue("defaultDeckEditorType", QString(), QString(), 1).toInt();
|
||||
return getValue("filterToMostRecentSetsAmount", "interface", "visualDatabaseDisplay", 10).toInt();
|
||||
}
|
||||
|
||||
void VisualDeckStorageSettings::setVisualDeckStorageSortingOrder(int _sortingOrder)
|
||||
{
|
||||
setValue(_sortingOrder, "visualdeckstoragesortingorder");
|
||||
setValue(_sortingOrder, "sortingOrder", "interface", "visualDeckStorage");
|
||||
}
|
||||
|
||||
void VisualDeckStorageSettings::setVisualDeckStorageShowFolders(bool value)
|
||||
{
|
||||
setValue(value, "visualdeckstorageshowfolders");
|
||||
setValue(value, "showFolders", "interface", "visualDeckStorage");
|
||||
}
|
||||
|
||||
void VisualDeckStorageSettings::setVisualDeckStorageShowTagFilter(bool _showTags)
|
||||
{
|
||||
setValue(_showTags, "visualdeckstorageshowtagfilter");
|
||||
setValue(_showTags, "showTagFilter", "interface", "visualDeckStorage");
|
||||
emit visualDeckStorageShowTagFilterChanged(_showTags);
|
||||
}
|
||||
|
||||
void VisualDeckStorageSettings::setVisualDeckStorageDefaultTagsList(QStringList _defaultTagsList)
|
||||
{
|
||||
setValue(QVariant::fromValue(_defaultTagsList), "visualdeckstoragedefaulttagslist");
|
||||
setValue(QVariant::fromValue(_defaultTagsList), "defaultTagsList", "interface", "visualDeckStorage");
|
||||
emit visualDeckStorageDefaultTagsListChanged();
|
||||
}
|
||||
|
||||
void VisualDeckStorageSettings::setVisualDeckStorageSearchFolderNames(bool value)
|
||||
{
|
||||
setValue(value, "visualdeckstoragesearchfoldernames");
|
||||
setValue(value, "searchFolderNames", "interface", "visualDeckStorage");
|
||||
}
|
||||
|
||||
void VisualDeckStorageSettings::setVisualDeckStorageShowColorIdentity(bool value)
|
||||
{
|
||||
setValue(value, "visualdeckstorageshowcoloridentity");
|
||||
setValue(value, "showColorIdentity", "interface", "visualDeckStorage");
|
||||
emit visualDeckStorageShowColorIdentityChanged(value);
|
||||
}
|
||||
|
||||
void VisualDeckStorageSettings::setVisualDeckStorageShowBannerCardComboBox(bool _showBannerCardComboBox)
|
||||
{
|
||||
setValue(_showBannerCardComboBox, "visualdeckstorageshowbannercardcombobox");
|
||||
setValue(_showBannerCardComboBox, "showBannerCardComboBox", "interface", "visualDeckStorage");
|
||||
emit visualDeckStorageShowBannerCardComboBoxChanged(_showBannerCardComboBox);
|
||||
}
|
||||
|
||||
void VisualDeckStorageSettings::setVisualDeckStorageShowTagsOnDeckPreviews(bool _showTags)
|
||||
{
|
||||
setValue(_showTags, "visualdeckstorageshowtagsondeckpreviews");
|
||||
setValue(_showTags, "showTagsOnDeckPreviews", "interface", "visualDeckStorage");
|
||||
emit visualDeckStorageShowTagsOnDeckPreviewsChanged(_showTags);
|
||||
}
|
||||
|
||||
void VisualDeckStorageSettings::setVisualDeckStorageCardSize(int _cardSize)
|
||||
{
|
||||
setValue(_cardSize, "visualdeckstoragecardsize");
|
||||
emit visualDeckStorageCardSizeChanged();
|
||||
}
|
||||
|
||||
void VisualDeckStorageSettings::setVisualDeckStorageDrawUnusedColorIdentities(bool _draw)
|
||||
{
|
||||
setValue(_draw, "visualdeckstoragedrawunusedcoloridentities");
|
||||
setValue(_draw, "drawUnusedColorIdentities", "interface", "visualDeckStorage");
|
||||
emit visualDeckStorageDrawUnusedColorIdentitiesChanged(_draw);
|
||||
}
|
||||
|
||||
void VisualDeckStorageSettings::setVisualDeckStorageUnusedColorIdentitiesOpacity(int _opacity)
|
||||
{
|
||||
setValue(_opacity, "visualdeckstorageunusedcoloridentitiesopacity");
|
||||
setValue(_opacity, "unusedColorIdentitiesOpacity", "interface", "visualDeckStorage");
|
||||
emit visualDeckStorageUnusedColorIdentitiesOpacityChanged(_opacity);
|
||||
}
|
||||
|
||||
void VisualDeckStorageSettings::setVisualDeckStorageTooltipType(int value)
|
||||
{
|
||||
setValue(value, "visualdeckstoragetooltiptype");
|
||||
setValue(value, "tooltipType", "interface", "visualDeckStorage");
|
||||
}
|
||||
|
||||
void VisualDeckStorageSettings::setVisualDeckStoragePromptForConversion(bool _prompt)
|
||||
{
|
||||
setValue(_prompt, "visualdeckstoragepromptforconversion");
|
||||
setValue(_prompt, "promptForConversion", "interface", "visualDeckStorage");
|
||||
}
|
||||
|
||||
void VisualDeckStorageSettings::setVisualDeckStorageAlwaysConvert(bool _always)
|
||||
{
|
||||
setValue(_always, "visualdeckstoragealwaysconvert");
|
||||
setValue(_always, "alwaysConvert", "interface", "visualDeckStorage");
|
||||
}
|
||||
|
||||
void VisualDeckStorageSettings::setVisualDeckStorageInGame(bool enabled)
|
||||
{
|
||||
setValue(enabled, "visualdeckstorageingame");
|
||||
setValue(enabled, "inGame", "interface", "visualDeckStorage");
|
||||
emit visualDeckStorageInGameChanged(enabled);
|
||||
}
|
||||
|
||||
void VisualDeckStorageSettings::setVisualDeckStorageSelectionAnimation(bool enabled)
|
||||
{
|
||||
setValue(enabled, "visualdeckstorageselectionanimation");
|
||||
setValue(enabled, "selectionAnimation", "interface", "visualDeckStorage");
|
||||
emit visualDeckStorageSelectionAnimationChanged(enabled);
|
||||
}
|
||||
|
||||
void VisualDeckStorageSettings::setVisualDeckEditorCardSize(int _cardSize)
|
||||
{
|
||||
setValue(_cardSize, "visualdeckeditorcardsize");
|
||||
emit visualDeckEditorCardSizeChanged();
|
||||
}
|
||||
|
||||
void VisualDeckStorageSettings::setVisualDeckEditorSampleHandSize(int _amount)
|
||||
{
|
||||
setValue(_amount, "visualdeckeditorsamplehandsize");
|
||||
emit visualDeckEditorSampleHandSizeAmountChanged(_amount);
|
||||
}
|
||||
|
||||
void VisualDeckStorageSettings::setVisualDatabaseDisplayCardSize(int _cardSize)
|
||||
{
|
||||
setValue(_cardSize, "visualdatabasedisplaycardsize");
|
||||
emit visualDatabaseDisplayCardSizeChanged();
|
||||
}
|
||||
|
||||
void VisualDeckStorageSettings::setVisualDatabaseDisplayFilterToMostRecentSetsEnabled(bool _enabled)
|
||||
{
|
||||
setValue(_enabled, "visualdatabasedisplayfiltertomostrecentsetsenabled");
|
||||
setValue(_enabled, "filterToMostRecentSetsEnabled", "interface", "visualDatabaseDisplay");
|
||||
emit visualDatabaseDisplayFilterToMostRecentSetsEnabledChanged(_enabled);
|
||||
}
|
||||
|
||||
void VisualDeckStorageSettings::setVisualDatabaseDisplayFilterToMostRecentSetsAmount(int _amount)
|
||||
{
|
||||
setValue(_amount, "visualdatabasedisplayfiltertomostrecentsetsamount");
|
||||
setValue(_amount, "filterToMostRecentSetsAmount", "interface", "visualDatabaseDisplay");
|
||||
emit visualDatabaseDisplayFilterToMostRecentSetsAmountChanged(_amount);
|
||||
}
|
||||
|
||||
void VisualDeckStorageSettings::setEDHRecCardSize(int _edhrecCardSize)
|
||||
{
|
||||
setValue(_edhrecCardSize, "edhreccardsize");
|
||||
emit edhRecCardSizeChanged();
|
||||
}
|
||||
|
||||
void VisualDeckStorageSettings::setArchidektPreviewCardSize(int _archidektPreviewCardSize)
|
||||
{
|
||||
setValue(_archidektPreviewCardSize, "archidektpreviewsize");
|
||||
emit archidektPreviewSizeChanged();
|
||||
}
|
||||
|
||||
void VisualDeckStorageSettings::setDefaultDeckEditorType(int value)
|
||||
{
|
||||
setValue(value, "defaultDeckEditorType");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ public:
|
|||
[[nodiscard]] bool getVisualDeckStorageShowColorIdentity() const override;
|
||||
[[nodiscard]] bool getVisualDeckStorageShowBannerCardComboBox() const override;
|
||||
[[nodiscard]] bool getVisualDeckStorageShowTagsOnDeckPreviews() const override;
|
||||
[[nodiscard]] int getVisualDeckStorageCardSize() const override;
|
||||
[[nodiscard]] bool getVisualDeckStorageDrawUnusedColorIdentities() const override;
|
||||
[[nodiscard]] int getVisualDeckStorageUnusedColorIdentitiesOpacity() const override;
|
||||
[[nodiscard]] int getVisualDeckStorageTooltipType() const override;
|
||||
|
|
@ -28,14 +27,8 @@ public:
|
|||
[[nodiscard]] bool getVisualDeckStorageAlwaysConvert() const override;
|
||||
[[nodiscard]] bool getVisualDeckStorageInGame() const override;
|
||||
[[nodiscard]] bool getVisualDeckStorageSelectionAnimation() const override;
|
||||
[[nodiscard]] int getVisualDeckEditorCardSize() const override;
|
||||
[[nodiscard]] int getVisualDeckEditorSampleHandSize() const override;
|
||||
[[nodiscard]] int getVisualDatabaseDisplayCardSize() const override;
|
||||
[[nodiscard]] bool getVisualDatabaseDisplayFilterToMostRecentSetsEnabled() const override;
|
||||
[[nodiscard]] int getVisualDatabaseDisplayFilterToMostRecentSetsAmount() const override;
|
||||
[[nodiscard]] int getEDHRecCardSize() const override;
|
||||
[[nodiscard]] int getArchidektPreviewSize() const override;
|
||||
[[nodiscard]] int getDefaultDeckEditorType() const override;
|
||||
|
||||
void setVisualDeckStorageSortingOrder(int _sortingOrder);
|
||||
void setVisualDeckStorageShowFolders(bool value);
|
||||
|
|
@ -45,7 +38,6 @@ public:
|
|||
void setVisualDeckStorageShowColorIdentity(bool value);
|
||||
void setVisualDeckStorageShowBannerCardComboBox(bool _showBannerCardComboBox);
|
||||
void setVisualDeckStorageShowTagsOnDeckPreviews(bool _showTags);
|
||||
void setVisualDeckStorageCardSize(int _cardSize);
|
||||
void setVisualDeckStorageDrawUnusedColorIdentities(bool _draw);
|
||||
void setVisualDeckStorageUnusedColorIdentitiesOpacity(int _opacity);
|
||||
void setVisualDeckStorageTooltipType(int value);
|
||||
|
|
@ -53,14 +45,8 @@ public:
|
|||
void setVisualDeckStorageAlwaysConvert(bool _always);
|
||||
void setVisualDeckStorageInGame(bool enabled);
|
||||
void setVisualDeckStorageSelectionAnimation(bool enabled);
|
||||
void setVisualDeckEditorCardSize(int _cardSize);
|
||||
void setVisualDeckEditorSampleHandSize(int _amount);
|
||||
void setVisualDatabaseDisplayCardSize(int _cardSize);
|
||||
void setVisualDatabaseDisplayFilterToMostRecentSetsEnabled(bool _enabled);
|
||||
void setVisualDatabaseDisplayFilterToMostRecentSetsAmount(int _amount);
|
||||
void setEDHRecCardSize(int _edhrecCardSize);
|
||||
void setArchidektPreviewCardSize(int _archidektPreviewCardSize);
|
||||
void setDefaultDeckEditorType(int value);
|
||||
|
||||
signals:
|
||||
void visualDeckStorageShowTagFilterChanged(bool _visible);
|
||||
|
|
@ -68,18 +54,12 @@ signals:
|
|||
void visualDeckStorageShowColorIdentityChanged(bool _visible);
|
||||
void visualDeckStorageShowBannerCardComboBoxChanged(bool _visible);
|
||||
void visualDeckStorageShowTagsOnDeckPreviewsChanged(bool _visible);
|
||||
void visualDeckStorageCardSizeChanged();
|
||||
void visualDeckStorageDrawUnusedColorIdentitiesChanged(bool _visible);
|
||||
void visualDeckStorageUnusedColorIdentitiesOpacityChanged(bool value);
|
||||
void visualDeckStorageInGameChanged(bool enabled);
|
||||
void visualDeckStorageSelectionAnimationChanged(bool enabled);
|
||||
void visualDatabaseDisplayFilterToMostRecentSetsEnabledChanged(bool enabled);
|
||||
void visualDatabaseDisplayFilterToMostRecentSetsAmountChanged(int amount);
|
||||
void visualDeckEditorSampleHandSizeAmountChanged(int amount);
|
||||
void visualDeckEditorCardSizeChanged();
|
||||
void visualDatabaseDisplayCardSizeChanged();
|
||||
void edhRecCardSizeChanged();
|
||||
void archidektPreviewSizeChanged();
|
||||
|
||||
public:
|
||||
explicit VisualDeckStorageSettings(const QString &settingPath, QObject *parent = nullptr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue