mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-21 00:55:09 -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
|
|
@ -0,0 +1,71 @@
|
|||
#include "appearance_settings.h"
|
||||
|
||||
AppearanceSettings::AppearanceSettings(const QString &settingPath, QObject *parent)
|
||||
: SettingsManager(settingPath + "appearance.ini", "appearance", QString(), parent)
|
||||
{
|
||||
}
|
||||
|
||||
QString AppearanceSettings::getThemeName() const
|
||||
{
|
||||
return getValue("themeName", QString(), QString()).toString();
|
||||
}
|
||||
|
||||
void AppearanceSettings::setThemeName(const QString &_themeName)
|
||||
{
|
||||
setValue(_themeName, "themeName");
|
||||
emit themeNameChanged();
|
||||
}
|
||||
|
||||
bool AppearanceSettings::getStyleUserList() const
|
||||
{
|
||||
return getValue("styleUserList", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
void AppearanceSettings::setStyleUserList(bool _styleUserList)
|
||||
{
|
||||
setValue(_styleUserList, "styleUserList");
|
||||
emit styleUserListChanged();
|
||||
}
|
||||
|
||||
int AppearanceSettings::getMaxFontSize() const
|
||||
{
|
||||
return getValue("maxFontSize", QString(), QString(), 12).toInt();
|
||||
}
|
||||
|
||||
void AppearanceSettings::setMaxFontSize(int _max)
|
||||
{
|
||||
setValue(_max, "maxFontSize");
|
||||
}
|
||||
|
||||
QString AppearanceSettings::getHomeTabBackgroundSource() const
|
||||
{
|
||||
return getValue("homeTabBackgroundSource", QString(), QString(), "themed").toString();
|
||||
}
|
||||
|
||||
void AppearanceSettings::setHomeTabBackgroundSource(const QString &_backgroundSource)
|
||||
{
|
||||
setValue(_backgroundSource, "homeTabBackgroundSource");
|
||||
emit homeTabBackgroundSourceChanged();
|
||||
}
|
||||
|
||||
int AppearanceSettings::getHomeTabBackgroundShuffleFrequency() const
|
||||
{
|
||||
return getValue("homeTabBackgroundShuffleFrequency", QString(), QString(), 0).toInt();
|
||||
}
|
||||
|
||||
void AppearanceSettings::setHomeTabBackgroundShuffleFrequency(int _frequency)
|
||||
{
|
||||
setValue(_frequency, "homeTabBackgroundShuffleFrequency");
|
||||
emit homeTabBackgroundShuffleFrequencyChanged();
|
||||
}
|
||||
|
||||
bool AppearanceSettings::getHomeTabDisplayCardName() const
|
||||
{
|
||||
return getValue("homeTabDisplayCardName", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
void AppearanceSettings::setHomeTabDisplayCardName(bool _displayCardName)
|
||||
{
|
||||
setValue(_displayCardName, "homeTabDisplayCardName");
|
||||
emit homeTabDisplayCardNameChanged();
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
/**
|
||||
* @file appearance_settings.h
|
||||
* @ingroup CoreSettings
|
||||
*/
|
||||
//! \todo Document this file.
|
||||
|
||||
#ifndef APPEARANCE_SETTINGS_H
|
||||
#define APPEARANCE_SETTINGS_H
|
||||
|
||||
#include "settings_manager.h"
|
||||
|
||||
class AppearanceSettings : public SettingsManager
|
||||
{
|
||||
Q_OBJECT
|
||||
friend class SettingsCache;
|
||||
|
||||
public:
|
||||
[[nodiscard]] QString getThemeName() const;
|
||||
void setThemeName(const QString &_themeName);
|
||||
[[nodiscard]] bool getStyleUserList() const;
|
||||
void setStyleUserList(bool _styleUserList);
|
||||
[[nodiscard]] int getMaxFontSize() const;
|
||||
void setMaxFontSize(int _max);
|
||||
[[nodiscard]] QString getHomeTabBackgroundSource() const;
|
||||
void setHomeTabBackgroundSource(const QString &_backgroundSource);
|
||||
[[nodiscard]] int getHomeTabBackgroundShuffleFrequency() const;
|
||||
void setHomeTabBackgroundShuffleFrequency(int _frequency);
|
||||
[[nodiscard]] bool getHomeTabDisplayCardName() const;
|
||||
void setHomeTabDisplayCardName(bool _displayCardName);
|
||||
|
||||
signals:
|
||||
void themeNameChanged();
|
||||
void styleUserListChanged();
|
||||
void homeTabBackgroundSourceChanged();
|
||||
void homeTabBackgroundShuffleFrequencyChanged();
|
||||
void homeTabDisplayCardNameChanged();
|
||||
|
||||
public:
|
||||
explicit AppearanceSettings(const QString &settingPath, QObject *parent = nullptr);
|
||||
|
||||
private:
|
||||
AppearanceSettings(const AppearanceSettings & /*other*/);
|
||||
};
|
||||
|
||||
#endif // APPEARANCE_SETTINGS_H
|
||||
|
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ CardDatabaseSettings::CardDatabaseSettings(const QString &settingPath, QObject *
|
|||
|
||||
void CardDatabaseSettings::setSortKey(QString shortName, unsigned int sortKey)
|
||||
{
|
||||
setValue(sortKey, "sortkey", "sets", shortName);
|
||||
setValue(sortKey, "sortKey", "sets", shortName);
|
||||
QMutexLocker lock(&setOptionsMutex);
|
||||
ensureSetOptionsLoaded();
|
||||
setOptionsCache[shortName].sortKey = sortKey;
|
||||
|
|
@ -25,7 +25,7 @@ void CardDatabaseSettings::setEnabled(QString shortName, bool enabled)
|
|||
|
||||
void CardDatabaseSettings::setIsKnown(QString shortName, bool isknown)
|
||||
{
|
||||
setValue(isknown, "isknown", "sets", shortName);
|
||||
setValue(isknown, "isKnown", "sets", shortName);
|
||||
QMutexLocker lock(&setOptionsMutex);
|
||||
ensureSetOptionsLoaded();
|
||||
setOptionsCache[shortName].isKnown = isknown;
|
||||
|
|
@ -42,9 +42,9 @@ void CardDatabaseSettings::ensureSetOptionsLoaded() const
|
|||
for (const QString &group : groups) {
|
||||
settings.beginGroup(group);
|
||||
SetOptions &o = setOptionsCache[group];
|
||||
o.sortKey = settings.value("sortkey", 0).toUInt();
|
||||
o.sortKey = settings.value("sortKey", 0).toUInt();
|
||||
o.enabled = settings.value("enabled", true).toBool();
|
||||
o.isKnown = settings.value("isknown", true).toBool();
|
||||
o.isKnown = settings.value("isKnown", true).toBool();
|
||||
settings.endGroup();
|
||||
}
|
||||
setOptionsLoaded = true;
|
||||
|
|
@ -84,7 +84,7 @@ void CardDatabaseSettings::saveSets(const QVector<ICardSetPriorityController::Se
|
|||
s.beginGroup("sets");
|
||||
for (const auto &entry : data) {
|
||||
s.beginGroup(entry.shortName);
|
||||
s.setValue("sortkey", entry.sortKey);
|
||||
s.setValue("sortKey", entry.sortKey);
|
||||
s.setValue("enabled", entry.enabled);
|
||||
s.endGroup();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,32 +7,32 @@ CardsDisplaySettings::CardsDisplaySettings(const QString &settingPath, QObject *
|
|||
|
||||
bool CardsDisplaySettings::getDisplayCardNames() const
|
||||
{
|
||||
return getValue("displaycardnames", QString(), QString(), true).toBool();
|
||||
return getValue("displayCardNames", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
bool CardsDisplaySettings::getRoundCardCorners() const
|
||||
{
|
||||
return getValue("roundcardcorners", QString(), QString(), true).toBool();
|
||||
return getValue("roundCardCorners", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
bool CardsDisplaySettings::getOverrideAllCardArtWithPersonalPreference() const
|
||||
{
|
||||
return getValue("overrideallcardartwithpersonalpreference", QString(), QString(), false).toBool();
|
||||
return getValue("overrideAllCardArtWithPersonalPreference", QString(), QString(), false).toBool();
|
||||
}
|
||||
|
||||
bool CardsDisplaySettings::getBumpSetsWithCardsInDeckToTop() const
|
||||
{
|
||||
return getValue("bumpsetswithcardsindecktotop", QString(), QString(), true).toBool();
|
||||
return getValue("bumpSetsWithCardsInDeckToTop", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
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,27 +42,17 @@ 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
|
||||
{
|
||||
return getValue("tapanimation", QString(), QString(), true).toBool();
|
||||
return getValue("tapAnimation", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
bool CardsDisplaySettings::getAutoRotateSidewaysLayoutCards() const
|
||||
{
|
||||
return getValue("autorotatesidewayslayoutcards", QString(), QString(), true).toBool();
|
||||
return getValue("autoRotateSidewaysLayoutCards", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
bool CardsDisplaySettings::getScaleCards() const
|
||||
|
|
@ -77,22 +67,42 @@ int CardsDisplaySettings::getStackCardOverlapPercent() const
|
|||
|
||||
int CardsDisplaySettings::getCardInfoViewMode() const
|
||||
{
|
||||
return getValue("cardinfoviewmode", QString(), QString(), 0).toInt();
|
||||
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)
|
||||
{
|
||||
setValue(_displayCardNames, "displaycardnames");
|
||||
setValue(_displayCardNames, "displayCardNames");
|
||||
emit displayCardNamesChanged();
|
||||
}
|
||||
|
||||
|
|
@ -101,31 +111,31 @@ void CardsDisplaySettings::setRoundCardCorners(bool _roundCardCorners)
|
|||
if (_roundCardCorners == getRoundCardCorners()) {
|
||||
return;
|
||||
}
|
||||
setValue(_roundCardCorners, "roundcardcorners");
|
||||
setValue(_roundCardCorners, "roundCardCorners");
|
||||
emit roundCardCornersChanged(_roundCardCorners);
|
||||
}
|
||||
|
||||
void CardsDisplaySettings::setOverrideAllCardArtWithPersonalPreference(bool _overrideAllCardArt)
|
||||
{
|
||||
setValue(_overrideAllCardArt, "overrideallcardartwithpersonalpreference");
|
||||
setValue(_overrideAllCardArt, "overrideAllCardArtWithPersonalPreference");
|
||||
emit overrideAllCardArtWithPersonalPreferenceChanged(_overrideAllCardArt);
|
||||
}
|
||||
|
||||
void CardsDisplaySettings::setBumpSetsWithCardsInDeckToTop(bool _bumpSetsWithCardsInDeckToTop)
|
||||
{
|
||||
setValue(_bumpSetsWithCardsInDeckToTop, "bumpsetswithcardsindecktotop");
|
||||
setValue(_bumpSetsWithCardsInDeckToTop, "bumpSetsWithCardsInDeckToTop");
|
||||
emit bumpSetsWithCardsInDeckToTopChanged();
|
||||
}
|
||||
|
||||
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,30 +150,18 @@ 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");
|
||||
setValue(_tapAnimation, "tapAnimation");
|
||||
}
|
||||
|
||||
void CardsDisplaySettings::setAutoRotateSidewaysLayoutCards(bool _autoRotateSidewaysLayoutCards)
|
||||
{
|
||||
setValue(_autoRotateSidewaysLayoutCards, "autorotatesidewayslayoutcards");
|
||||
setValue(_autoRotateSidewaysLayoutCards, "autoRotateSidewaysLayoutCards");
|
||||
}
|
||||
|
||||
void CardsDisplaySettings::setCardScaling(bool _scaleCards)
|
||||
|
|
@ -178,16 +176,41 @@ void CardsDisplaySettings::setStackCardOverlapPercent(int _verticalCardOverlapPe
|
|||
|
||||
void CardsDisplaySettings::setCardInfoViewMode(int _viewMode)
|
||||
{
|
||||
setValue(_viewMode, "cardinfoviewmode");
|
||||
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*/);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -12,62 +12,62 @@ bool ChatSettings::getChatMention() const
|
|||
|
||||
bool ChatSettings::getChatMentionCompleter() const
|
||||
{
|
||||
return getValue("mentioncompleter", QString(), QString(), true).toBool();
|
||||
return getValue("mentionCompleter", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
QString ChatSettings::getChatMentionColor() const
|
||||
{
|
||||
return getValue("mentioncolor", QString(), QString(), "A6120D").toString();
|
||||
return getValue("mentionColor", QString(), QString(), "A6120D").toString();
|
||||
}
|
||||
|
||||
QString ChatSettings::getChatHighlightColor() const
|
||||
{
|
||||
return getValue("highlightcolor", QString(), QString(), "A6120D").toString();
|
||||
return getValue("highlightColor", QString(), QString(), "A6120D").toString();
|
||||
}
|
||||
|
||||
bool ChatSettings::getChatMentionForeground() const
|
||||
{
|
||||
return getValue("mentionforeground", QString(), QString(), true).toBool();
|
||||
return getValue("mentionForeground", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
bool ChatSettings::getChatHighlightForeground() const
|
||||
{
|
||||
return getValue("highlightforeground", QString(), QString(), true).toBool();
|
||||
return getValue("highlightForeground", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
bool ChatSettings::getIgnoreUnregisteredUsers() const
|
||||
{
|
||||
return getValue("ignore_unregistered").toBool();
|
||||
return getValue("ignoreUnregistered").toBool();
|
||||
}
|
||||
|
||||
bool ChatSettings::getIgnoreUnregisteredUserMessages() const
|
||||
{
|
||||
return getValue("ignore_unregistered_messages").toBool();
|
||||
return getValue("ignoreUnregisteredMessages").toBool();
|
||||
}
|
||||
|
||||
bool ChatSettings::getIgnoreNonBuddyUserMessages() const
|
||||
{
|
||||
return getValue("ignore_nonbuddy_messages").toBool();
|
||||
return getValue("ignoreNonBuddyMessages").toBool();
|
||||
}
|
||||
|
||||
bool ChatSettings::getShowMessagePopup() const
|
||||
{
|
||||
return getValue("showmessagepopups", QString(), QString(), true).toBool();
|
||||
return getValue("showMessagePopups", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
bool ChatSettings::getShowMentionPopup() const
|
||||
{
|
||||
return getValue("showmentionpopups", QString(), QString(), true).toBool();
|
||||
return getValue("showMentionPopups", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
bool ChatSettings::getRoomHistory() const
|
||||
{
|
||||
return getValue("roomhistory", QString(), QString(), true).toBool();
|
||||
return getValue("roomHistory", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
QString ChatSettings::getHighlightWords() const
|
||||
{
|
||||
return getValue("highlightwords").toString();
|
||||
return getValue("highlightWords").toString();
|
||||
}
|
||||
|
||||
void ChatSettings::setChatMention(bool _chatMention)
|
||||
|
|
@ -77,61 +77,61 @@ void ChatSettings::setChatMention(bool _chatMention)
|
|||
|
||||
void ChatSettings::setChatMentionCompleter(bool _chatMentionCompleter)
|
||||
{
|
||||
setValue(_chatMentionCompleter, "mentioncompleter");
|
||||
setValue(_chatMentionCompleter, "mentionCompleter");
|
||||
emit chatMentionCompleterChanged();
|
||||
}
|
||||
|
||||
void ChatSettings::setChatMentionColor(const QString &_chatMentionColor)
|
||||
{
|
||||
setValue(_chatMentionColor, "mentioncolor");
|
||||
setValue(_chatMentionColor, "mentionColor");
|
||||
}
|
||||
|
||||
void ChatSettings::setChatHighlightColor(const QString &_chatHighlightColor)
|
||||
{
|
||||
setValue(_chatHighlightColor, "highlightcolor");
|
||||
setValue(_chatHighlightColor, "highlightColor");
|
||||
}
|
||||
|
||||
void ChatSettings::setChatMentionForeground(bool _chatMentionForeground)
|
||||
{
|
||||
setValue(_chatMentionForeground, "mentionforeground");
|
||||
setValue(_chatMentionForeground, "mentionForeground");
|
||||
}
|
||||
|
||||
void ChatSettings::setChatHighlightForeground(bool _chatHighlightForeground)
|
||||
{
|
||||
setValue(_chatHighlightForeground, "highlightforeground");
|
||||
setValue(_chatHighlightForeground, "highlightForeground");
|
||||
}
|
||||
|
||||
void ChatSettings::setIgnoreUnregisteredUsers(bool _ignoreUnregisteredUsers)
|
||||
{
|
||||
setValue(_ignoreUnregisteredUsers, "ignore_unregistered");
|
||||
setValue(_ignoreUnregisteredUsers, "ignoreUnregistered");
|
||||
}
|
||||
|
||||
void ChatSettings::setIgnoreUnregisteredUserMessages(bool _ignoreUnregisteredUserMessages)
|
||||
{
|
||||
setValue(_ignoreUnregisteredUserMessages, "ignore_unregistered_messages");
|
||||
setValue(_ignoreUnregisteredUserMessages, "ignoreUnregisteredMessages");
|
||||
}
|
||||
|
||||
void ChatSettings::setIgnoreNonBuddyUserMessages(bool _ignoreNonBuddyUserMessages)
|
||||
{
|
||||
setValue(_ignoreNonBuddyUserMessages, "ignore_nonbuddy_messages");
|
||||
setValue(_ignoreNonBuddyUserMessages, "ignoreNonBuddyMessages");
|
||||
}
|
||||
|
||||
void ChatSettings::setShowMessagePopups(bool _showMessagePopups)
|
||||
{
|
||||
setValue(_showMessagePopups, "showmessagepopups");
|
||||
setValue(_showMessagePopups, "showMessagePopups");
|
||||
}
|
||||
|
||||
void ChatSettings::setShowMentionPopups(bool _showMentionPopups)
|
||||
{
|
||||
setValue(_showMentionPopups, "showmentionpopups");
|
||||
setValue(_showMentionPopups, "showMentionPopups");
|
||||
}
|
||||
|
||||
void ChatSettings::setRoomHistory(bool _roomHistory)
|
||||
{
|
||||
setValue(_roomHistory, "roomhistory");
|
||||
setValue(_roomHistory, "roomHistory");
|
||||
}
|
||||
|
||||
void ChatSettings::setHighlightWords(const QString &_highlightWords)
|
||||
{
|
||||
setValue(_highlightWords, "highlightwords");
|
||||
setValue(_highlightWords, "highlightWords");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,48 @@
|
|||
#include "deck_editor_settings.h"
|
||||
|
||||
DeckEditorSettings::DeckEditorSettings(const QString &settingPath, QObject *parent)
|
||||
: SettingsManager(settingPath + "deck_editor.ini", "deckeditor", QString(), parent)
|
||||
{
|
||||
}
|
||||
|
||||
bool DeckEditorSettings::getOpenDeckInNewTab() const
|
||||
{
|
||||
return getValue("openDeckInNewTab", QString(), QString(), false).toBool();
|
||||
}
|
||||
|
||||
bool DeckEditorSettings::getBannerCardComboBoxVisible() const
|
||||
{
|
||||
return getValue("bannerCardComboBoxVisible", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
bool DeckEditorSettings::getTagsWidgetVisible() const
|
||||
{
|
||||
return getValue("tagsWidgetVisible", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
int DeckEditorSettings::getDefaultDeckEditorType() const
|
||||
{
|
||||
return getValue("defaultDeckEditorType", QString(), QString(), 1).toInt();
|
||||
}
|
||||
|
||||
void DeckEditorSettings::setOpenDeckInNewTab(bool _openDeckInNewTab)
|
||||
{
|
||||
setValue(_openDeckInNewTab, "openDeckInNewTab");
|
||||
}
|
||||
|
||||
void DeckEditorSettings::setBannerCardComboBoxVisible(bool _bannerCardComboBoxVisible)
|
||||
{
|
||||
setValue(_bannerCardComboBoxVisible, "bannerCardComboBoxVisible");
|
||||
emit bannerCardComboBoxVisibleChanged(_bannerCardComboBoxVisible);
|
||||
}
|
||||
|
||||
void DeckEditorSettings::setTagsWidgetVisible(bool _tagsWidgetVisible)
|
||||
{
|
||||
setValue(_tagsWidgetVisible, "tagsWidgetVisible");
|
||||
emit tagsWidgetVisibleChanged(_tagsWidgetVisible);
|
||||
}
|
||||
|
||||
void DeckEditorSettings::setDefaultDeckEditorType(int _defaultDeckEditorType)
|
||||
{
|
||||
setValue(_defaultDeckEditorType, "defaultDeckEditorType");
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
#ifndef DECK_EDITOR_SETTINGS_H
|
||||
#define DECK_EDITOR_SETTINGS_H
|
||||
|
||||
#include "settings_manager.h"
|
||||
|
||||
#include <libcockatrice/interfaces/interface_deck_editor_settings_provider.h>
|
||||
|
||||
class DeckEditorSettings : public SettingsManager, public IDeckEditorSettingsProvider
|
||||
{
|
||||
Q_OBJECT
|
||||
friend class SettingsCache;
|
||||
|
||||
public:
|
||||
[[nodiscard]] bool getOpenDeckInNewTab() const override;
|
||||
[[nodiscard]] bool getBannerCardComboBoxVisible() const override;
|
||||
[[nodiscard]] bool getTagsWidgetVisible() const override;
|
||||
[[nodiscard]] int getDefaultDeckEditorType() const override;
|
||||
|
||||
void setOpenDeckInNewTab(bool _openDeckInNewTab);
|
||||
void setBannerCardComboBoxVisible(bool _bannerCardComboBoxVisible);
|
||||
void setTagsWidgetVisible(bool _tagsWidgetVisible);
|
||||
void setDefaultDeckEditorType(int _defaultDeckEditorType);
|
||||
|
||||
signals:
|
||||
void bannerCardComboBoxVisibleChanged(bool visible);
|
||||
void tagsWidgetVisibleChanged(bool visible);
|
||||
|
||||
public:
|
||||
explicit DeckEditorSettings(const QString &settingPath, QObject *parent = nullptr);
|
||||
|
||||
private:
|
||||
DeckEditorSettings(const DeckEditorSettings & /*other*/);
|
||||
};
|
||||
|
||||
#endif // DECK_EDITOR_SETTINGS_H
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -19,137 +19,137 @@ static QString hashGameType(const QString &gameType)
|
|||
|
||||
void GameFiltersSettings::setHideBuddiesOnlyGames(bool hide)
|
||||
{
|
||||
setValue(hide, "hide_buddies_only_games");
|
||||
setValue(hide, "hideBuddiesOnlyGames");
|
||||
}
|
||||
|
||||
bool GameFiltersSettings::isHideBuddiesOnlyGames() const
|
||||
{
|
||||
QVariant previous = getValue("hide_buddies_only_games");
|
||||
QVariant previous = getValue("hideBuddiesOnlyGames");
|
||||
return previous == QVariant() ? false : previous.toBool();
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setHideFullGames(bool hide)
|
||||
{
|
||||
setValue(hide, "hide_full_games");
|
||||
setValue(hide, "hideFullGames");
|
||||
}
|
||||
|
||||
bool GameFiltersSettings::isHideFullGames() const
|
||||
{
|
||||
QVariant previous = getValue("hide_full_games");
|
||||
QVariant previous = getValue("hideFullGames");
|
||||
return previous == QVariant() ? false : previous.toBool();
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setHideGamesThatStarted(bool hide)
|
||||
{
|
||||
setValue(hide, "hide_games_that_started");
|
||||
setValue(hide, "hideGamesThatStarted");
|
||||
}
|
||||
|
||||
bool GameFiltersSettings::isHideGamesThatStarted() const
|
||||
{
|
||||
QVariant previous = getValue("hide_games_that_started");
|
||||
QVariant previous = getValue("hideGamesThatStarted");
|
||||
return previous == QVariant() ? false : previous.toBool();
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setHidePasswordProtectedGames(bool hide)
|
||||
{
|
||||
setValue(hide, "hide_password_protected_games");
|
||||
setValue(hide, "hidePasswordProtectedGames");
|
||||
}
|
||||
|
||||
bool GameFiltersSettings::isHidePasswordProtectedGames() const
|
||||
{
|
||||
QVariant previous = getValue("hide_password_protected_games");
|
||||
QVariant previous = getValue("hidePasswordProtectedGames");
|
||||
return previous == QVariant() ? false : previous.toBool();
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setHideIgnoredUserGames(bool hide)
|
||||
{
|
||||
setValue(hide, "hide_ignored_user_games");
|
||||
setValue(hide, "hideIgnoredUserGames");
|
||||
}
|
||||
|
||||
bool GameFiltersSettings::isHideIgnoredUserGames() const
|
||||
{
|
||||
QVariant previous = getValue("hide_ignored_user_games");
|
||||
QVariant previous = getValue("hideIgnoredUserGames");
|
||||
return previous == QVariant() ? true : previous.toBool();
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setHideNotBuddyCreatedGames(bool hide)
|
||||
{
|
||||
setValue(hide, "hide_not_buddy_created_games");
|
||||
setValue(hide, "hideNotBuddyCreatedGames");
|
||||
}
|
||||
|
||||
bool GameFiltersSettings::isHideNotBuddyCreatedGames() const
|
||||
{
|
||||
QVariant previous = getValue("hide_not_buddy_created_games");
|
||||
QVariant previous = getValue("hideNotBuddyCreatedGames");
|
||||
return previous == QVariant() ? false : previous.toBool();
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setHideOpenDecklistGames(bool hide)
|
||||
{
|
||||
setValue(hide, "hide_open_decklist_games");
|
||||
setValue(hide, "hideOpenDecklistGames");
|
||||
}
|
||||
|
||||
bool GameFiltersSettings::isHideOpenDecklistGames() const
|
||||
{
|
||||
QVariant previous = getValue("hide_open_decklist_games");
|
||||
QVariant previous = getValue("hideOpenDecklistGames");
|
||||
return previous == QVariant() ? false : previous.toBool();
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setGameNameFilter(QString gameName)
|
||||
{
|
||||
setValue(gameName, "game_name_filter");
|
||||
setValue(gameName, "gameNameFilter");
|
||||
}
|
||||
|
||||
QString GameFiltersSettings::getGameNameFilter() const
|
||||
{
|
||||
return getValue("game_name_filter").toString();
|
||||
return getValue("gameNameFilter").toString();
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setCreatorNameFilters(QStringList creatorName)
|
||||
{
|
||||
setValue(creatorName, "creator_name_filter");
|
||||
setValue(creatorName, "creatorNameFilter");
|
||||
}
|
||||
|
||||
QStringList GameFiltersSettings::getCreatorNameFilters() const
|
||||
{
|
||||
return getValue("creator_name_filter").toStringList();
|
||||
return getValue("creatorNameFilter").toStringList();
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setMinPlayers(int min)
|
||||
{
|
||||
setValue(min, "min_players");
|
||||
setValue(min, "minPlayers");
|
||||
}
|
||||
|
||||
int GameFiltersSettings::getMinPlayers() const
|
||||
{
|
||||
QVariant previous = getValue("min_players");
|
||||
QVariant previous = getValue("minPlayers");
|
||||
return previous == QVariant() ? 1 : previous.toInt();
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setMaxPlayers(int max)
|
||||
{
|
||||
setValue(max, "max_players");
|
||||
setValue(max, "maxPlayers");
|
||||
}
|
||||
|
||||
int GameFiltersSettings::getMaxPlayers() const
|
||||
{
|
||||
QVariant previous = getValue("max_players");
|
||||
QVariant previous = getValue("maxPlayers");
|
||||
return previous == QVariant() ? 99 : previous.toInt();
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setMaxGameAge(const QTime &maxGameAge)
|
||||
{
|
||||
setValue(maxGameAge, "max_game_age_time");
|
||||
setValue(maxGameAge, "maxGameAgeTime");
|
||||
}
|
||||
|
||||
QTime GameFiltersSettings::getMaxGameAge() const
|
||||
{
|
||||
QVariant previous = getValue("max_game_age_time");
|
||||
QVariant previous = getValue("maxGameAgeTime");
|
||||
return previous.toTime();
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setGameTypeEnabled(QString gametype, bool enabled)
|
||||
{
|
||||
setValue(enabled, "game_type/" + hashGameType(gametype));
|
||||
setValue(enabled, "gameType/" + hashGameType(gametype));
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setGameHashedTypeEnabled(QString gametypeHASHED, bool enabled)
|
||||
|
|
@ -159,50 +159,50 @@ void GameFiltersSettings::setGameHashedTypeEnabled(QString gametypeHASHED, bool
|
|||
|
||||
bool GameFiltersSettings::isGameTypeEnabled(QString gametype) const
|
||||
{
|
||||
QVariant previous = getValue("game_type/" + hashGameType(gametype));
|
||||
QVariant previous = getValue("gameType/" + hashGameType(gametype));
|
||||
return previous == QVariant() ? false : previous.toBool();
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setShowOnlyIfSpectatorsCanWatch(bool show)
|
||||
{
|
||||
setValue(show, "show_only_if_spectators_can_watch");
|
||||
setValue(show, "showOnlyIfSpectatorsCanWatch");
|
||||
}
|
||||
|
||||
bool GameFiltersSettings::isShowOnlyIfSpectatorsCanWatch() const
|
||||
{
|
||||
QVariant previous = getValue("show_only_if_spectators_can_watch");
|
||||
QVariant previous = getValue("showOnlyIfSpectatorsCanWatch");
|
||||
return previous == QVariant() ? false : previous.toBool();
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setShowSpectatorPasswordProtected(bool show)
|
||||
{
|
||||
setValue(show, "show_spectator_password_protected");
|
||||
setValue(show, "showSpectatorPasswordProtected");
|
||||
}
|
||||
|
||||
bool GameFiltersSettings::isShowSpectatorPasswordProtected() const
|
||||
{
|
||||
QVariant previous = getValue("show_spectator_password_protected");
|
||||
QVariant previous = getValue("showSpectatorPasswordProtected");
|
||||
return previous == QVariant() ? false : previous.toBool();
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setShowOnlyIfSpectatorsCanChat(bool show)
|
||||
{
|
||||
setValue(show, "show_only_if_spectators_can_chat");
|
||||
setValue(show, "showOnlyIfSpectatorsCanChat");
|
||||
}
|
||||
|
||||
bool GameFiltersSettings::isShowOnlyIfSpectatorsCanChat() const
|
||||
{
|
||||
QVariant previous = getValue("show_only_if_spectators_can_chat");
|
||||
QVariant previous = getValue("showOnlyIfSpectatorsCanChat");
|
||||
return previous == QVariant() ? false : previous.toBool();
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setShowOnlyIfSpectatorsCanSeeHands(bool show)
|
||||
{
|
||||
setValue(show, "show_only_if_spectators_can_see_hands");
|
||||
setValue(show, "showOnlyIfSpectatorsCanSeeHands");
|
||||
}
|
||||
|
||||
bool GameFiltersSettings::isShowOnlyIfSpectatorsCanSeeHands() const
|
||||
{
|
||||
QVariant previous = getValue("show_only_if_spectators_can_see_hands");
|
||||
QVariant previous = getValue("showOnlyIfSpectatorsCanSeeHands");
|
||||
return previous == QVariant() ? false : previous.toBool();
|
||||
}
|
||||
|
|
@ -7,160 +7,160 @@ GameSettings::GameSettings(const QString &settingPath, QObject *parent)
|
|||
|
||||
QString GameSettings::getGameDescription() const
|
||||
{
|
||||
return getValue("gamedescription", "game").toString();
|
||||
return getValue("gameDescription", "game").toString();
|
||||
}
|
||||
|
||||
int GameSettings::getMaxPlayers() const
|
||||
{
|
||||
return getValue("maxplayers", "game", QString(), 2).toInt();
|
||||
return getValue("maxPlayers", "game", QString(), 2).toInt();
|
||||
}
|
||||
|
||||
QString GameSettings::getGameTypes() const
|
||||
{
|
||||
return getValue("gametypes", "game").toString();
|
||||
return getValue("gameTypes", "game").toString();
|
||||
}
|
||||
|
||||
bool GameSettings::getOnlyBuddies() const
|
||||
{
|
||||
return getValue("onlybuddies", "game").toBool();
|
||||
return getValue("onlyBuddies", "game").toBool();
|
||||
}
|
||||
|
||||
bool GameSettings::getOnlyRegistered() const
|
||||
{
|
||||
return getValue("onlyregistered", "game").toBool();
|
||||
return getValue("onlyRegistered", "game").toBool();
|
||||
}
|
||||
|
||||
bool GameSettings::getSpectatorsAllowed() const
|
||||
{
|
||||
return getValue("spectatorsallowed", "game").toBool();
|
||||
return getValue("spectatorsAllowed", "game").toBool();
|
||||
}
|
||||
|
||||
bool GameSettings::getSpectatorsNeedPassword() const
|
||||
{
|
||||
return getValue("spectatorsneedpassword", "game").toBool();
|
||||
return getValue("spectatorsNeedPassword", "game").toBool();
|
||||
}
|
||||
|
||||
bool GameSettings::getSpectatorsCanTalk() const
|
||||
{
|
||||
return getValue("spectatorscantalk", "game").toBool();
|
||||
return getValue("spectatorsCanTalk", "game").toBool();
|
||||
}
|
||||
|
||||
bool GameSettings::getSpectatorsCanSeeEverything() const
|
||||
{
|
||||
return getValue("spectatorscanseeeverything", "game").toBool();
|
||||
return getValue("spectatorsCanSeeEverything", "game").toBool();
|
||||
}
|
||||
|
||||
bool GameSettings::getCreateGameAsSpectator() const
|
||||
{
|
||||
return getValue("creategameasspectator", "game").toBool();
|
||||
return getValue("createGameAsSpectator", "game").toBool();
|
||||
}
|
||||
|
||||
int GameSettings::getDefaultStartingLifeTotal() const
|
||||
{
|
||||
return getValue("defaultstartinglifetotal", "game", QString(), 20).toInt();
|
||||
return getValue("defaultStartingLifeTotal", "game", QString(), 20).toInt();
|
||||
}
|
||||
|
||||
bool GameSettings::getShareDecklistsOnLoad() const
|
||||
{
|
||||
return getValue("sharedecklistsonload", "game").toBool();
|
||||
return getValue("shareDecklistsOnLoad", "game").toBool();
|
||||
}
|
||||
|
||||
bool GameSettings::getRememberGameSettings() const
|
||||
{
|
||||
return getValue("remembergamesettings", "game", QString(), true).toBool();
|
||||
return getValue("rememberGameSettings", "game", QString(), true).toBool();
|
||||
}
|
||||
|
||||
bool GameSettings::getLocalGameRememberSettings() const
|
||||
{
|
||||
return getValue("remembersettings", "localgameoptions").toBool();
|
||||
return getValue("rememberSettings", "localgameoptions").toBool();
|
||||
}
|
||||
|
||||
int GameSettings::getLocalGameMaxPlayers() const
|
||||
{
|
||||
return getValue("maxplayers", "localgameoptions", QString(), 1).toInt();
|
||||
return getValue("maxPlayers", "localgameoptions", QString(), 1).toInt();
|
||||
}
|
||||
|
||||
int GameSettings::getLocalGameStartingLifeTotal() const
|
||||
{
|
||||
return getValue("startinglifetotal", "localgameoptions", QString(), 20).toInt();
|
||||
return getValue("startingLifeTotal", "localgameoptions", QString(), 20).toInt();
|
||||
}
|
||||
|
||||
void GameSettings::setGameDescription(const QString &_gameDescription)
|
||||
{
|
||||
setValue(_gameDescription, "gamedescription", "game");
|
||||
setValue(_gameDescription, "gameDescription", "game");
|
||||
}
|
||||
|
||||
void GameSettings::setMaxPlayers(int _maxPlayers)
|
||||
{
|
||||
setValue(_maxPlayers, "maxplayers", "game");
|
||||
setValue(_maxPlayers, "maxPlayers", "game");
|
||||
}
|
||||
|
||||
void GameSettings::setGameTypes(const QString &_gameTypes)
|
||||
{
|
||||
setValue(_gameTypes, "gametypes", "game");
|
||||
setValue(_gameTypes, "gameTypes", "game");
|
||||
}
|
||||
|
||||
void GameSettings::setOnlyBuddies(bool _onlyBuddies)
|
||||
{
|
||||
setValue(_onlyBuddies, "onlybuddies", "game");
|
||||
setValue(_onlyBuddies, "onlyBuddies", "game");
|
||||
}
|
||||
|
||||
void GameSettings::setOnlyRegistered(bool _onlyRegistered)
|
||||
{
|
||||
setValue(_onlyRegistered, "onlyregistered", "game");
|
||||
setValue(_onlyRegistered, "onlyRegistered", "game");
|
||||
}
|
||||
|
||||
void GameSettings::setSpectatorsAllowed(bool _spectatorsAllowed)
|
||||
{
|
||||
setValue(_spectatorsAllowed, "spectatorsallowed", "game");
|
||||
setValue(_spectatorsAllowed, "spectatorsAllowed", "game");
|
||||
}
|
||||
|
||||
void GameSettings::setSpectatorsNeedPassword(bool _spectatorsNeedPassword)
|
||||
{
|
||||
setValue(_spectatorsNeedPassword, "spectatorsneedpassword", "game");
|
||||
setValue(_spectatorsNeedPassword, "spectatorsNeedPassword", "game");
|
||||
}
|
||||
|
||||
void GameSettings::setSpectatorsCanTalk(bool _spectatorsCanTalk)
|
||||
{
|
||||
setValue(_spectatorsCanTalk, "spectatorscantalk", "game");
|
||||
setValue(_spectatorsCanTalk, "spectatorsCanTalk", "game");
|
||||
}
|
||||
|
||||
void GameSettings::setSpectatorsCanSeeEverything(bool _spectatorsCanSeeEverything)
|
||||
{
|
||||
setValue(_spectatorsCanSeeEverything, "spectatorscanseeeverything", "game");
|
||||
setValue(_spectatorsCanSeeEverything, "spectatorsCanSeeEverything", "game");
|
||||
}
|
||||
|
||||
void GameSettings::setCreateGameAsSpectator(bool _createGameAsSpectator)
|
||||
{
|
||||
setValue(_createGameAsSpectator, "creategameasspectator", "game");
|
||||
setValue(_createGameAsSpectator, "createGameAsSpectator", "game");
|
||||
}
|
||||
|
||||
void GameSettings::setDefaultStartingLifeTotal(int _defaultStartingLifeTotal)
|
||||
{
|
||||
setValue(_defaultStartingLifeTotal, "defaultstartinglifetotal", "game");
|
||||
setValue(_defaultStartingLifeTotal, "defaultStartingLifeTotal", "game");
|
||||
}
|
||||
|
||||
void GameSettings::setShareDecklistsOnLoad(bool _shareDecklistsOnLoad)
|
||||
{
|
||||
setValue(_shareDecklistsOnLoad, "sharedecklistsonload", "game");
|
||||
setValue(_shareDecklistsOnLoad, "shareDecklistsOnLoad", "game");
|
||||
}
|
||||
|
||||
void GameSettings::setRememberGameSettings(bool _rememberGameSettings)
|
||||
{
|
||||
setValue(_rememberGameSettings, "remembergamesettings", "game");
|
||||
setValue(_rememberGameSettings, "rememberGameSettings", "game");
|
||||
}
|
||||
|
||||
void GameSettings::setLocalGameRememberSettings(bool value)
|
||||
{
|
||||
setValue(value, "remembersettings", "localgameoptions");
|
||||
setValue(value, "rememberSettings", "localgameoptions");
|
||||
}
|
||||
|
||||
void GameSettings::setLocalGameMaxPlayers(int value)
|
||||
{
|
||||
setValue(value, "maxplayers", "localgameoptions");
|
||||
setValue(value, "maxPlayers", "localgameoptions");
|
||||
}
|
||||
|
||||
void GameSettings::setLocalGameStartingLifeTotal(int value)
|
||||
{
|
||||
setValue(value, "startinglifetotal", "localgameoptions");
|
||||
setValue(value, "startingLifeTotal", "localgameoptions");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ InterfaceSettings::InterfaceSettings(const QString &settingPath, QObject *parent
|
|||
|
||||
bool InterfaceSettings::getUseTearOffMenus() const
|
||||
{
|
||||
return getValue("usetearoffmenus", QString(), QString(), true).toBool();
|
||||
return getValue("useTearOffMenus", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
int InterfaceSettings::getCardViewInitialRowsMax() const
|
||||
|
|
@ -37,22 +37,22 @@ 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
|
||||
{
|
||||
return getValue("doubleclicktoplay", QString(), QString(), true).toBool();
|
||||
return getValue("doubleClickToPlay", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
bool InterfaceSettings::getClickPlaysAllSelected() const
|
||||
|
|
@ -62,7 +62,7 @@ bool InterfaceSettings::getClickPlaysAllSelected() const
|
|||
|
||||
bool InterfaceSettings::getPlayToStack() const
|
||||
{
|
||||
return getValue("playtostack", QString(), QString(), true).toBool();
|
||||
return getValue("playToStack", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
bool InterfaceSettings::getDoNotDeleteArrowsInSubPhases() const
|
||||
|
|
@ -72,22 +72,22 @@ bool InterfaceSettings::getDoNotDeleteArrowsInSubPhases() const
|
|||
|
||||
int InterfaceSettings::getStartingHandSize() const
|
||||
{
|
||||
return getValue("startinghandsize", QString(), QString(), 7).toInt();
|
||||
return getValue("startingHandSize", QString(), QString(), 7).toInt();
|
||||
}
|
||||
|
||||
bool InterfaceSettings::getAnnotateTokens() const
|
||||
{
|
||||
return getValue("annotatetokens", QString(), QString(), false).toBool();
|
||||
return getValue("annotateTokens", QString(), QString(), false).toBool();
|
||||
}
|
||||
|
||||
bool InterfaceSettings::getShowDragSelectionCount() const
|
||||
{
|
||||
return getValue("showlassoselectioncount", QString(), QString(), true).toBool();
|
||||
return getValue("showLassoSelectionCount", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
bool InterfaceSettings::getShowTotalSelectionCount() const
|
||||
{
|
||||
return getValue("showpersistentselectioncount", QString(), QString(), true).toBool();
|
||||
return getValue("showPersistentSelectionCount", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
int InterfaceSettings::getTallyType() const
|
||||
|
|
@ -102,17 +102,12 @@ bool InterfaceSettings::getHorizontalHand() const
|
|||
|
||||
bool InterfaceSettings::getInvertVerticalCoordinate() const
|
||||
{
|
||||
return getValue("invert_vertical", "table", QString(), false).toBool();
|
||||
return getValue("invertVertical", "table", QString(), false).toBool();
|
||||
}
|
||||
|
||||
int InterfaceSettings::getMinPlayersForMultiColumnLayout() const
|
||||
{
|
||||
return getValue("min_players_multicolumn", QString(), QString(), 4).toInt();
|
||||
}
|
||||
|
||||
bool InterfaceSettings::getOpenDeckInNewTab() const
|
||||
{
|
||||
return getValue("openDeckInNewTab", "editor", QString(), false).toBool();
|
||||
return getValue("minPlayersMulticolumn", QString(), QString(), 4).toInt();
|
||||
}
|
||||
|
||||
int InterfaceSettings::getRewindBufferingMs() const
|
||||
|
|
@ -125,39 +120,44 @@ 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();
|
||||
return getValue("leftJustified", QString(), QString(), false).toBool();
|
||||
}
|
||||
|
||||
int InterfaceSettings::getZoneViewGroupByIndex() const
|
||||
{
|
||||
return getValue("groupby", "zoneview", QString(), 1).toInt();
|
||||
return getValue("groupBy", "zoneview", QString(), 1).toInt();
|
||||
}
|
||||
|
||||
int InterfaceSettings::getZoneViewSortByIndex() const
|
||||
{
|
||||
return getValue("sortby", "zoneview", QString(), 1).toInt();
|
||||
return getValue("sortBy", "zoneview", QString(), 1).toInt();
|
||||
}
|
||||
|
||||
bool InterfaceSettings::getZoneViewPileView() const
|
||||
{
|
||||
return getValue("pileview", "zoneview", QString(), true).toBool();
|
||||
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)
|
||||
{
|
||||
setValue(_useTearOffMenus, "usetearoffmenus");
|
||||
setValue(_useTearOffMenus, "useTearOffMenus");
|
||||
emit useTearOffMenusChanged(_useTearOffMenus);
|
||||
}
|
||||
|
||||
|
|
@ -189,22 +189,22 @@ 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)
|
||||
{
|
||||
setValue(_doubleClickToPlay, "doubleclicktoplay");
|
||||
setValue(_doubleClickToPlay, "doubleClickToPlay");
|
||||
}
|
||||
|
||||
void InterfaceSettings::setClickPlaysAllSelected(bool _clickPlaysAllSelected)
|
||||
|
|
@ -214,7 +214,7 @@ void InterfaceSettings::setClickPlaysAllSelected(bool _clickPlaysAllSelected)
|
|||
|
||||
void InterfaceSettings::setPlayToStack(bool _playToStack)
|
||||
{
|
||||
setValue(_playToStack, "playtostack");
|
||||
setValue(_playToStack, "playToStack");
|
||||
}
|
||||
|
||||
void InterfaceSettings::setDoNotDeleteArrowsInSubPhases(bool _doNotDeleteArrowsInSubPhases)
|
||||
|
|
@ -224,22 +224,22 @@ void InterfaceSettings::setDoNotDeleteArrowsInSubPhases(bool _doNotDeleteArrowsI
|
|||
|
||||
void InterfaceSettings::setStartingHandSize(int _startingHandSize)
|
||||
{
|
||||
setValue(_startingHandSize, "startinghandsize");
|
||||
setValue(_startingHandSize, "startingHandSize");
|
||||
}
|
||||
|
||||
void InterfaceSettings::setAnnotateTokens(bool _annotateTokens)
|
||||
{
|
||||
setValue(_annotateTokens, "annotatetokens");
|
||||
setValue(_annotateTokens, "annotateTokens");
|
||||
}
|
||||
|
||||
void InterfaceSettings::setShowDragSelectionCount(bool _showDragSelectionCount)
|
||||
{
|
||||
setValue(_showDragSelectionCount, "showlassoselectioncount");
|
||||
setValue(_showDragSelectionCount, "showLassoSelectionCount");
|
||||
}
|
||||
|
||||
void InterfaceSettings::setShowTotalSelectionCount(bool _showTotalSelectionCount)
|
||||
{
|
||||
setValue(_showTotalSelectionCount, "showpersistentselectioncount");
|
||||
setValue(_showTotalSelectionCount, "showPersistentSelectionCount");
|
||||
}
|
||||
|
||||
void InterfaceSettings::setTallyType(int value)
|
||||
|
|
@ -259,21 +259,16 @@ void InterfaceSettings::setHorizontalHand(bool _horizontalHand)
|
|||
|
||||
void InterfaceSettings::setInvertVerticalCoordinate(bool _invertVerticalCoordinate)
|
||||
{
|
||||
setValue(_invertVerticalCoordinate, "invert_vertical", "table");
|
||||
setValue(_invertVerticalCoordinate, "invertVertical", "table");
|
||||
emit invertVerticalCoordinateChanged();
|
||||
}
|
||||
|
||||
void InterfaceSettings::setMinPlayersForMultiColumnLayout(int _minPlayersForMultiColumnLayout)
|
||||
{
|
||||
setValue(_minPlayersForMultiColumnLayout, "min_players_multicolumn");
|
||||
setValue(_minPlayersForMultiColumnLayout, "minPlayersMulticolumn");
|
||||
emit minPlayersForMultiColumnLayoutChanged();
|
||||
}
|
||||
|
||||
void InterfaceSettings::setOpenDeckInNewTab(bool _openDeckInNewTab)
|
||||
{
|
||||
setValue(_openDeckInNewTab, "openDeckInNewTab", "editor");
|
||||
}
|
||||
|
||||
void InterfaceSettings::setRewindBufferingMs(int _rewindBufferingMs)
|
||||
{
|
||||
setValue(_rewindBufferingMs, "rewindBufferingMs", "replay");
|
||||
|
|
@ -284,34 +279,40 @@ 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");
|
||||
setValue(_leftJustified, "leftJustified");
|
||||
emit handJustificationChanged();
|
||||
}
|
||||
|
||||
void InterfaceSettings::setZoneViewGroupByIndex(int _zoneViewGroupByIndex)
|
||||
{
|
||||
setValue(_zoneViewGroupByIndex, "groupby", "zoneview");
|
||||
setValue(_zoneViewGroupByIndex, "groupBy", "zoneview");
|
||||
}
|
||||
|
||||
void InterfaceSettings::setZoneViewSortByIndex(int _zoneViewSortByIndex)
|
||||
{
|
||||
setValue(_zoneViewSortByIndex, "sortby", "zoneview");
|
||||
setValue(_zoneViewSortByIndex, "sortBy", "zoneview");
|
||||
}
|
||||
|
||||
void InterfaceSettings::setZoneViewPileView(bool _zoneViewPileView)
|
||||
{
|
||||
setValue(_zoneViewPileView, "pileview", "zoneview");
|
||||
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*/);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,56 @@
|
|||
#include "network_settings.h"
|
||||
|
||||
NetworkSettings::NetworkSettings(const QString &settingPath, QObject *parent)
|
||||
: SettingsManager(settingPath + "network.ini", "network", QString(), parent)
|
||||
{
|
||||
}
|
||||
|
||||
QString NetworkSettings::getClientID() const
|
||||
{
|
||||
return getValue("clientId", QString(), QString(), "notset").toString();
|
||||
}
|
||||
|
||||
void NetworkSettings::setClientID(const QString &_clientID)
|
||||
{
|
||||
setValue(_clientID, "clientId");
|
||||
}
|
||||
|
||||
QString NetworkSettings::getClientVersion() const
|
||||
{
|
||||
return getValue("clientVersion", QString(), QString(), "notset").toString();
|
||||
}
|
||||
|
||||
void NetworkSettings::setClientVersion(const QString &_clientVersion)
|
||||
{
|
||||
setValue(_clientVersion, "clientVersion");
|
||||
}
|
||||
|
||||
int NetworkSettings::getKeepAlive() const
|
||||
{
|
||||
return getValue("keepAlive", QString(), QString(), 3).toInt();
|
||||
}
|
||||
|
||||
void NetworkSettings::setKeepAlive(int _keepAlive)
|
||||
{
|
||||
setValue(_keepAlive, "keepAlive");
|
||||
}
|
||||
|
||||
int NetworkSettings::getTimeOut() const
|
||||
{
|
||||
return getValue("timeout", QString(), QString(), 5).toInt();
|
||||
}
|
||||
|
||||
void NetworkSettings::setTimeOut(int _timeOut)
|
||||
{
|
||||
setValue(_timeOut, "timeout");
|
||||
}
|
||||
|
||||
QString NetworkSettings::getKnownMissingFeatures() const
|
||||
{
|
||||
return getValue("knownMissingFeatures", QString(), QString(), "").toString();
|
||||
}
|
||||
|
||||
void NetworkSettings::setKnownMissingFeatures(const QString &_knownMissingFeatures)
|
||||
{
|
||||
setValue(_knownMissingFeatures, "knownMissingFeatures");
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
/**
|
||||
* @file network_settings.h
|
||||
* @ingroup NetworkSettings
|
||||
*/
|
||||
//! \todo Document this file.
|
||||
|
||||
#ifndef NETWORK_SETTINGS_H
|
||||
#define NETWORK_SETTINGS_H
|
||||
|
||||
#include "settings_manager.h"
|
||||
|
||||
class NetworkSettings : public SettingsManager
|
||||
{
|
||||
Q_OBJECT
|
||||
friend class SettingsCache;
|
||||
|
||||
public:
|
||||
[[nodiscard]] QString getClientID() const;
|
||||
void setClientID(const QString &_clientID);
|
||||
[[nodiscard]] QString getClientVersion() const;
|
||||
void setClientVersion(const QString &_clientVersion);
|
||||
[[nodiscard]] int getKeepAlive() const;
|
||||
void setKeepAlive(int _keepAlive);
|
||||
[[nodiscard]] int getTimeOut() const;
|
||||
void setTimeOut(int _timeOut);
|
||||
[[nodiscard]] QString getKnownMissingFeatures() const;
|
||||
void setKnownMissingFeatures(const QString &_knownMissingFeatures);
|
||||
|
||||
public:
|
||||
explicit NetworkSettings(const QString &settingPath, QObject *parent = nullptr);
|
||||
|
||||
private:
|
||||
NetworkSettings(const NetworkSettings & /*other*/);
|
||||
};
|
||||
|
||||
#endif // NETWORK_SETTINGS_H
|
||||
|
|
@ -30,7 +30,7 @@ QString PathsSettings::getPicsPath() const
|
|||
|
||||
QString PathsSettings::getCustomPicsPath() const
|
||||
{
|
||||
return getValue("custompics").toString();
|
||||
return getValue("customPics").toString();
|
||||
}
|
||||
|
||||
QString PathsSettings::getThemesPath() const
|
||||
|
|
@ -40,22 +40,22 @@ QString PathsSettings::getThemesPath() const
|
|||
|
||||
QString PathsSettings::getCardDatabasePath() const
|
||||
{
|
||||
return getValue("carddatabase").toString();
|
||||
return getValue("cardDatabase").toString();
|
||||
}
|
||||
|
||||
QString PathsSettings::getCustomCardDatabasePath() const
|
||||
{
|
||||
return getValue("customsets").toString();
|
||||
return getValue("customSets").toString();
|
||||
}
|
||||
|
||||
QString PathsSettings::getTokenDatabasePath() const
|
||||
{
|
||||
return getValue("tokendatabase").toString();
|
||||
return getValue("tokenDatabase").toString();
|
||||
}
|
||||
|
||||
QString PathsSettings::getSpoilerCardDatabasePath() const
|
||||
{
|
||||
return getValue("spoilerdatabase").toString();
|
||||
return getValue("spoilerDatabase").toString();
|
||||
}
|
||||
|
||||
QString PathsSettings::getRedirectCachePath() const
|
||||
|
|
@ -86,7 +86,7 @@ void PathsSettings::setPicsPath(const QString &_picsPath)
|
|||
|
||||
void PathsSettings::setCustomPicsPath(const QString &_customPicsPath)
|
||||
{
|
||||
setValue(_customPicsPath, "custompics");
|
||||
setValue(_customPicsPath, "customPics");
|
||||
}
|
||||
|
||||
void PathsSettings::setThemesPath(const QString &_themesPath)
|
||||
|
|
@ -97,24 +97,24 @@ void PathsSettings::setThemesPath(const QString &_themesPath)
|
|||
|
||||
void PathsSettings::setCardDatabasePath(const QString &_cardDatabasePath)
|
||||
{
|
||||
setValue(_cardDatabasePath, "carddatabase");
|
||||
setValue(_cardDatabasePath, "cardDatabase");
|
||||
emit cardDatabasePathChanged();
|
||||
}
|
||||
|
||||
void PathsSettings::setCustomCardDatabasePath(const QString &_customCardDatabasePath)
|
||||
{
|
||||
setValue(_customCardDatabasePath, "customsets");
|
||||
setValue(_customCardDatabasePath, "customSets");
|
||||
emit cardDatabasePathChanged();
|
||||
}
|
||||
|
||||
void PathsSettings::setTokenDatabasePath(const QString &_tokenDatabasePath)
|
||||
{
|
||||
setValue(_tokenDatabasePath, "tokendatabase");
|
||||
setValue(_tokenDatabasePath, "tokenDatabase");
|
||||
emit cardDatabasePathChanged();
|
||||
}
|
||||
|
||||
void PathsSettings::setSpoilerDatabasePath(const QString &_spoilerDatabasePath)
|
||||
{
|
||||
setValue(_spoilerDatabasePath, "spoilerdatabase");
|
||||
setValue(_spoilerDatabasePath, "spoilerDatabase");
|
||||
emit cardDatabasePathChanged();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -9,16 +9,16 @@ RecentsSettings::RecentsSettings(const QString &settingPath, QObject *parent)
|
|||
|
||||
QStringList RecentsSettings::getRecentlyOpenedDeckPaths() const
|
||||
{
|
||||
return getValue("deckpaths").toStringList();
|
||||
return getValue("deckPaths").toStringList();
|
||||
}
|
||||
void RecentsSettings::clearRecentlyOpenedDeckPaths()
|
||||
{
|
||||
deleteValue("deckpaths");
|
||||
deleteValue("deckPaths");
|
||||
emit recentlyOpenedDeckPathsChanged();
|
||||
}
|
||||
void RecentsSettings::updateRecentlyOpenedDeckPaths(const QString &deckPath)
|
||||
{
|
||||
auto deckPaths = getValue("deckpaths").toStringList();
|
||||
auto deckPaths = getValue("deckPaths").toStringList();
|
||||
deckPaths.removeAll(deckPath);
|
||||
|
||||
deckPaths.prepend(deckPath);
|
||||
|
|
@ -27,7 +27,7 @@ void RecentsSettings::updateRecentlyOpenedDeckPaths(const QString &deckPath)
|
|||
deckPaths.removeLast();
|
||||
}
|
||||
|
||||
setValue(deckPaths, "deckpaths");
|
||||
setValue(deckPaths, "deckPaths");
|
||||
emit recentlyOpenedDeckPathsChanged();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,28 +10,28 @@ ServersSettings::ServersSettings(const QString &settingPath, QObject *parent)
|
|||
|
||||
void ServersSettings::setPreviousHostLogin(int previous)
|
||||
{
|
||||
setValue(previous, "previoushostlogin");
|
||||
setValue(previous, "previousHostLogin");
|
||||
}
|
||||
|
||||
int ServersSettings::getPreviousHostLogin() const
|
||||
{
|
||||
QVariant previous = getValue("previoushostlogin");
|
||||
QVariant previous = getValue("previousHostLogin");
|
||||
return previous == QVariant() ? 1 : previous.toInt();
|
||||
}
|
||||
|
||||
void ServersSettings::setPreviousHostList(QStringList list)
|
||||
{
|
||||
setValue(list, "previoushosts");
|
||||
setValue(list, "previousHosts");
|
||||
}
|
||||
|
||||
QStringList ServersSettings::getPreviousHostList() const
|
||||
{
|
||||
return getValue("previoushosts").toStringList();
|
||||
return getValue("previousHosts").toStringList();
|
||||
}
|
||||
|
||||
void ServersSettings::setPrevioushostName(const QString &name)
|
||||
{
|
||||
setValue(name, "previoushostName");
|
||||
setValue(name, "previousHostName");
|
||||
}
|
||||
|
||||
QString ServersSettings::getSaveName(QString defaultname)
|
||||
|
|
@ -50,7 +50,7 @@ QString ServersSettings::getSite(QString defaultSite)
|
|||
|
||||
QString ServersSettings::getPrevioushostName() const
|
||||
{
|
||||
QVariant value = getValue("previoushostName");
|
||||
QVariant value = getValue("previousHostName");
|
||||
return value == QVariant() ? "Rooster Ranges" : value.toString();
|
||||
}
|
||||
|
||||
|
|
@ -110,56 +110,56 @@ bool ServersSettings::getSavePassword() const
|
|||
|
||||
void ServersSettings::setAutoConnect(int autoconnect)
|
||||
{
|
||||
setValue(autoconnect, "auto_connect");
|
||||
setValue(autoconnect, "autoConnect");
|
||||
}
|
||||
|
||||
int ServersSettings::getAutoConnect() const
|
||||
{
|
||||
QVariant autoconnect = getValue("auto_connect");
|
||||
QVariant autoconnect = getValue("autoConnect");
|
||||
return autoconnect == QVariant() ? 0 : autoconnect.toInt();
|
||||
}
|
||||
|
||||
void ServersSettings::setFPHostName(QString hostname)
|
||||
{
|
||||
setValue(hostname, "fphostname");
|
||||
setValue(hostname, "fpHostName");
|
||||
}
|
||||
|
||||
QString ServersSettings::getFPHostname(QString defaultHost) const
|
||||
{
|
||||
QVariant hostname = getValue("fphostname");
|
||||
QVariant hostname = getValue("fpHostName");
|
||||
return hostname == QVariant() ? std::move(defaultHost) : hostname.toString();
|
||||
}
|
||||
|
||||
void ServersSettings::setFPPort(QString port)
|
||||
{
|
||||
setValue(port, "fpport");
|
||||
setValue(port, "fpPort");
|
||||
}
|
||||
|
||||
QString ServersSettings::getFPPort(QString defaultPort) const
|
||||
{
|
||||
QVariant port = getValue("fpport");
|
||||
QVariant port = getValue("fpPort");
|
||||
return port == QVariant() ? std::move(defaultPort) : port.toString();
|
||||
}
|
||||
|
||||
void ServersSettings::setFPPlayerName(QString playerName)
|
||||
{
|
||||
setValue(playerName, "fpplayername");
|
||||
setValue(playerName, "fpPlayerName");
|
||||
}
|
||||
|
||||
QString ServersSettings::getFPPlayerName(QString defaultName) const
|
||||
{
|
||||
QVariant name = getValue("fpplayername");
|
||||
QVariant name = getValue("fpPlayerName");
|
||||
return name == QVariant() ? std::move(defaultName) : name.toString();
|
||||
}
|
||||
|
||||
void ServersSettings::setClearDebugLogStatus(bool abIsChecked)
|
||||
{
|
||||
setValue(abIsChecked, "save_debug_log");
|
||||
setValue(abIsChecked, "saveDebugLog");
|
||||
}
|
||||
|
||||
bool ServersSettings::getClearDebugLogStatus(bool abDefaultValue) const
|
||||
{
|
||||
QVariant cbFlushLog = getValue("save_debug_log");
|
||||
QVariant cbFlushLog = getValue("saveDebugLog");
|
||||
return cbFlushLog == QVariant() ? abDefaultValue : cbFlushLog.toBool();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,66 +35,100 @@ static void migrateSoundSettings(const QString &settingsPath, QSettings &globalI
|
|||
QSettings soundIni(settingsPath + "sound.ini", QSettings::IniFormat);
|
||||
soundIni.setValue("sound/enabled", globalIni.value("sound/enabled", false));
|
||||
soundIni.setValue("sound/theme", globalIni.value("sound/theme"));
|
||||
soundIni.setValue("sound/mastervolume", globalIni.value("sound/mastervolume", 100));
|
||||
soundIni.setValue("sound/masterVolume", globalIni.value("sound/mastervolume", 100));
|
||||
}
|
||||
|
||||
static void migrateGameSettings(const QString &settingsPath, QSettings &globalIni)
|
||||
{
|
||||
bool hasGameKeys = false;
|
||||
globalIni.beginGroup("game");
|
||||
if (!globalIni.childKeys().isEmpty()) {
|
||||
hasGameKeys = true;
|
||||
}
|
||||
QStringList gameKeys = globalIni.childKeys();
|
||||
globalIni.endGroup();
|
||||
const QMap<QString, QString> gameKeyMap = {
|
||||
{"game/maxplayers", "game/maxPlayers"},
|
||||
{"game/gamedescription", "game/gameDescription"},
|
||||
{"game/gametypes", "game/gameTypes"},
|
||||
{"game/onlybuddies", "game/onlyBuddies"},
|
||||
{"game/onlyregistered", "game/onlyRegistered"},
|
||||
{"game/spectatorsallowed", "game/spectatorsAllowed"},
|
||||
{"game/spectatorsneedpassword", "game/spectatorsNeedPassword"},
|
||||
{"game/spectatorscantalk", "game/spectatorsCanTalk"},
|
||||
{"game/spectatorscanseeeverything", "game/spectatorsCanSeeEverything"},
|
||||
{"game/creategameasspectator", "game/createGameAsSpectator"},
|
||||
{"game/defaultstartinglifetotal", "game/defaultStartingLifeTotal"},
|
||||
{"game/sharedecklistsonload", "game/shareDecklistsOnLoad"},
|
||||
{"game/remembergamesettings", "game/rememberGameSettings"},
|
||||
{"localgameoptions/maxplayers", "localgameoptions/maxPlayers"},
|
||||
{"localgameoptions/startinglifetotal", "localgameoptions/startingLifeTotal"},
|
||||
{"localgameoptions/remembersettings", "localgameoptions/rememberSettings"},
|
||||
};
|
||||
|
||||
globalIni.beginGroup("localgameoptions");
|
||||
if (!globalIni.childKeys().isEmpty()) {
|
||||
hasGameKeys = true;
|
||||
bool hasAny = false;
|
||||
for (auto it = gameKeyMap.constBegin(); it != gameKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
hasAny = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
QStringList localGameKeys = globalIni.childKeys();
|
||||
globalIni.endGroup();
|
||||
|
||||
if (!hasGameKeys) {
|
||||
if (!hasAny) {
|
||||
return;
|
||||
}
|
||||
|
||||
QSettings gameIni(settingsPath + "game.ini", QSettings::IniFormat);
|
||||
for (const auto &key : gameKeys) {
|
||||
if (key == "maxfontsize") {
|
||||
continue;
|
||||
for (auto it = gameKeyMap.constBegin(); it != gameKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
gameIni.setValue(it.value(), globalIni.value(it.key()));
|
||||
}
|
||||
gameIni.setValue("game/" + key, globalIni.value("game/" + key));
|
||||
}
|
||||
for (const auto &key : localGameKeys) {
|
||||
gameIni.setValue("localgameoptions/" + key, globalIni.value("localgameoptions/" + key));
|
||||
}
|
||||
}
|
||||
|
||||
static void migrateChatSettings(const QString &settingsPath, QSettings &globalIni)
|
||||
{
|
||||
globalIni.beginGroup("chat");
|
||||
QStringList chatKeys = globalIni.childKeys();
|
||||
globalIni.endGroup();
|
||||
|
||||
if (chatKeys.isEmpty()) {
|
||||
const QMap<QString, QString> chatKeyMap = {
|
||||
{"chat/mention", "chat/mention"},
|
||||
{"chat/mentioncompleter", "chat/mentionCompleter"},
|
||||
{"chat/mentioncolor", "chat/mentionColor"},
|
||||
{"chat/highlightcolor", "chat/highlightColor"},
|
||||
{"chat/mentionforeground", "chat/mentionForeground"},
|
||||
{"chat/highlightforeground", "chat/highlightForeground"},
|
||||
{"chat/ignore_unregistered", "chat/ignoreUnregistered"},
|
||||
{"chat/ignore_unregistered_messages", "chat/ignoreUnregisteredMessages"},
|
||||
{"chat/ignore_nonbuddy_messages", "chat/ignoreNonBuddyMessages"},
|
||||
{"chat/showmessagepopups", "chat/showMessagePopups"},
|
||||
{"chat/showmentionpopups", "chat/showMentionPopups"},
|
||||
{"chat/roomhistory", "chat/roomHistory"},
|
||||
{"chat/highlightwords", "chat/highlightWords"},
|
||||
// Legacy highlight words lived under [personal], but the chat settings
|
||||
// class reads them from [chat]
|
||||
{"personal/highlightWords", "chat/highlightWords"},
|
||||
};
|
||||
bool hasAny = false;
|
||||
for (auto it = chatKeyMap.constBegin(); it != chatKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
hasAny = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!hasAny) {
|
||||
return;
|
||||
}
|
||||
|
||||
QSettings chatIni(settingsPath + "chat.ini", QSettings::IniFormat);
|
||||
for (const auto &key : chatKeys) {
|
||||
chatIni.setValue("chat/" + key, globalIni.value("chat/" + key));
|
||||
for (auto it = chatKeyMap.constBegin(); it != chatKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
chatIni.setValue(it.value(), globalIni.value(it.key()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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 +138,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()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -120,9 +154,9 @@ static void migrateUpdatesSettings(const QString &settingsPath, QSettings &globa
|
|||
{"personal/cardUpdateCheckInterval", "updates/cardUpdateCheckInterval"},
|
||||
{"personal/lastCardUpdateCheck", "updates/lastCardUpdateCheck"},
|
||||
{"personal/alwaysEnableNewSets", "updates/alwaysEnableNewSets"},
|
||||
{"personal/updatenotification", "updates/updatenotification"},
|
||||
{"personal/newversionnotification", "updates/newversionnotification"},
|
||||
{"personal/updatereleasechannel", "updates/updatereleasechannel"},
|
||||
{"personal/updatenotification", "updates/updateNotification"},
|
||||
{"personal/newversionnotification", "updates/newVersionNotification"},
|
||||
{"personal/updatereleasechannel", "updates/updateReleaseChannel"},
|
||||
};
|
||||
bool hasAny = false;
|
||||
for (auto it = updateKeyMap.constBegin(); it != updateKeyMap.constEnd(); ++it) {
|
||||
|
|
@ -145,19 +179,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 +188,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 +203,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));
|
||||
|
|
@ -210,39 +212,33 @@ static void migratePersonalSettings(const QString &settingsPath, QSettings &glob
|
|||
|
||||
static void migrateCardsDisplaySettings(const QString &settingsPath, QSettings &globalIni)
|
||||
{
|
||||
const QStringList cardsRootKeys = {
|
||||
"cards/displaycardnames",
|
||||
"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 QMap<QString, QString> cardsKeyMap = {
|
||||
{"cards/displaycardnames", "cards/displayCardNames"},
|
||||
{"cards/roundcardcorners", "cards/roundCardCorners"},
|
||||
{"cards/overrideallcardartwithpersonalpreference", "cards/overrideAllCardArtWithPersonalPreference"},
|
||||
{"cards/bumpsetswithcardsindecktotop", "cards/bumpSetsWithCardsInDeckToTop"},
|
||||
{"cards/includerebalancedcards", "cards/includerebalancedcards"},
|
||||
{"cards/tapanimation", "cards/tapAnimation"},
|
||||
{"cards/autorotatesidewayslayoutcards", "cards/autoRotateSidewaysLayoutCards"},
|
||||
{"cards/scaleCards", "cards/scaleCards"},
|
||||
{"cards/verticalCardOverlapPercent", "cards/verticalCardOverlapPercent"},
|
||||
{"cards/cardinfoviewmode", "cards/cardInfoViewMode"},
|
||||
{"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"},
|
||||
};
|
||||
const QStringList cardsInterfaceKeys = {"interface/deckeditorbannercardcomboboxvisible",
|
||||
"interface/deckeditortagswidgetvisible"};
|
||||
const QStringList menuKeys = {"menu/showshortcuts", "menu/showgameselectorfiltertoolbar"};
|
||||
|
||||
bool hasAny = false;
|
||||
for (const auto &key : cardsRootKeys) {
|
||||
if (globalIni.contains(key)) {
|
||||
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;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!hasAny) {
|
||||
|
|
@ -250,60 +246,71 @@ static void migrateCardsDisplaySettings(const QString &settingsPath, QSettings &
|
|||
}
|
||||
|
||||
QSettings cardsIni(settingsPath + "cards_display.ini", QSettings::IniFormat);
|
||||
for (const auto &key : cardsRootKeys) {
|
||||
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()));
|
||||
}
|
||||
}
|
||||
for (const auto &key : cardsInterfaceKeys) {
|
||||
if (globalIni.contains(key)) {
|
||||
cardsIni.setValue(key, globalIni.value(key));
|
||||
}
|
||||
|
||||
static void migrateCardCounterSettings(const QString &settingsPath, QSettings &globalIni)
|
||||
{
|
||||
QStringList counterKeys;
|
||||
const QStringList allKeys = globalIni.allKeys();
|
||||
for (const auto &key : allKeys) {
|
||||
if (key.startsWith("cards/counters/")) {
|
||||
counterKeys.append(key);
|
||||
}
|
||||
}
|
||||
for (const auto &key : menuKeys) {
|
||||
if (globalIni.contains(key)) {
|
||||
cardsIni.setValue(key, globalIni.value(key));
|
||||
}
|
||||
if (counterKeys.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
QSettings countersIni(settingsPath + "card_counters.ini", QSettings::IniFormat);
|
||||
for (const auto &key : counterKeys) {
|
||||
countersIni.setValue(key, globalIni.value(key));
|
||||
}
|
||||
}
|
||||
|
||||
static void migrateInterfaceSettings(const QString &settingsPath, QSettings &globalIni)
|
||||
{
|
||||
const QStringList interfaceRootKeys = {
|
||||
"interface/usetearoffmenus",
|
||||
"interface/cardViewInitialRowsMax",
|
||||
"interface/cardViewExpandedRowsMax",
|
||||
"interface/closeEmptyCardView",
|
||||
"interface/focusCardViewSearchBar",
|
||||
"interface/keepGameChatFocus",
|
||||
"interface/notificationsenabled",
|
||||
"interface/specnotificationsenabled",
|
||||
"interface/buddyconnectnotificationsenabled",
|
||||
"interface/doubleclicktoplay",
|
||||
"interface/clickPlaysAllSelected",
|
||||
"interface/playtostack",
|
||||
"interface/doNotDeleteArrowsInSubPhases",
|
||||
"interface/startinghandsize",
|
||||
"interface/annotatetokens",
|
||||
"interface/showlassoselectioncount",
|
||||
"interface/showpersistentselectioncount",
|
||||
"interface/showsubtypeselectiontally",
|
||||
"interface/leftjustified",
|
||||
"interface/min_players_multicolumn",
|
||||
"interface/knownmissingfeatures",
|
||||
const QMap<QString, QString> interfaceKeyMap = {
|
||||
{"interface/usetearoffmenus", "interface/useTearOffMenus"},
|
||||
{"interface/cardViewInitialRowsMax", "interface/cardViewInitialRowsMax"},
|
||||
{"interface/cardViewExpandedRowsMax", "interface/cardViewExpandedRowsMax"},
|
||||
{"interface/closeEmptyCardView", "interface/closeEmptyCardView"},
|
||||
{"interface/focusCardViewSearchBar", "interface/focusCardViewSearchBar"},
|
||||
{"interface/keepGameChatFocus", "interface/keepGameChatFocus"},
|
||||
{"interface/doubleclicktoplay", "interface/doubleClickToPlay"},
|
||||
{"interface/clickPlaysAllSelected", "interface/clickPlaysAllSelected"},
|
||||
{"interface/playtostack", "interface/playToStack"},
|
||||
{"interface/doNotDeleteArrowsInSubPhases", "interface/doNotDeleteArrowsInSubPhases"},
|
||||
{"interface/startinghandsize", "interface/startingHandSize"},
|
||||
{"interface/annotatetokens", "interface/annotateTokens"},
|
||||
{"interface/showlassoselectioncount", "interface/showLassoSelectionCount"},
|
||||
{"interface/showpersistentselectioncount", "interface/showPersistentSelectionCount"},
|
||||
{"interface/tallyType", "interface/tallyType"},
|
||||
{"interface/leftjustified", "interface/leftJustified"},
|
||||
{"interface/min_players_multicolumn", "interface/minPlayersMulticolumn"},
|
||||
{"hand/horizontal", "hand/horizontal"},
|
||||
{"table/invert_vertical", "table/invertVertical"},
|
||||
{"replay/rewindBufferingMs", "replay/rewindBufferingMs"},
|
||||
{"replay/fastForwardSpeed", "replay/fastForwardSpeed"},
|
||||
{"zoneview/groupby", "zoneview/groupBy"},
|
||||
{"zoneview/sortby", "zoneview/sortBy"},
|
||||
{"zoneview/pileview", "zoneview/pileView"},
|
||||
{"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"},
|
||||
};
|
||||
const QStringList interfaceSubKeys = {
|
||||
"hand/horizontal", "table/invert_vertical", "editor/openDeckInNewTab", "replay/rewindBufferingMs",
|
||||
"appearance/styleUserList", "zoneview/groupby", "zoneview/sortby", "zoneview/pileview"};
|
||||
bool hasAny = false;
|
||||
for (const auto &key : interfaceRootKeys) {
|
||||
if (globalIni.contains(key)) {
|
||||
hasAny = true;
|
||||
}
|
||||
}
|
||||
for (const auto &key : interfaceSubKeys) {
|
||||
if (globalIni.contains(key)) {
|
||||
for (auto it = interfaceKeyMap.constBegin(); it != interfaceKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
hasAny = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!hasAny) {
|
||||
|
|
@ -311,63 +318,159 @@ static void migrateInterfaceSettings(const QString &settingsPath, QSettings &glo
|
|||
}
|
||||
|
||||
QSettings interfaceIni(settingsPath + "interface.ini", QSettings::IniFormat);
|
||||
for (const auto &key : interfaceRootKeys) {
|
||||
if (globalIni.contains(key)) {
|
||||
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()));
|
||||
}
|
||||
}
|
||||
for (const auto &key : interfaceSubKeys) {
|
||||
if (globalIni.contains(key)) {
|
||||
interfaceIni.setValue(key, globalIni.value(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)
|
||||
{
|
||||
globalIni.beginGroup("paths");
|
||||
QStringList pathsKeys = globalIni.childKeys();
|
||||
globalIni.endGroup();
|
||||
if (pathsKeys.isEmpty()) {
|
||||
const QMap<QString, QString> pathsKeyMap = {
|
||||
{"paths/decks", "paths/decks"},
|
||||
{"paths/filters", "paths/filters"},
|
||||
{"paths/replays", "paths/replays"},
|
||||
{"paths/pics", "paths/pics"},
|
||||
{"paths/custompics", "paths/customPics"},
|
||||
{"paths/themes", "paths/themes"},
|
||||
{"paths/carddatabase", "paths/cardDatabase"},
|
||||
{"paths/customsets", "paths/customSets"},
|
||||
{"paths/tokendatabase", "paths/tokenDatabase"},
|
||||
{"paths/spoilerdatabase", "paths/spoilerDatabase"},
|
||||
{"paths/redirects", "paths/redirects"},
|
||||
};
|
||||
bool hasAny = false;
|
||||
for (auto it = pathsKeyMap.constBegin(); it != pathsKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
hasAny = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!hasAny) {
|
||||
return;
|
||||
}
|
||||
|
||||
QSettings pathsIni(settingsPath + "paths.ini", QSettings::IniFormat);
|
||||
for (const auto &key : pathsKeys) {
|
||||
pathsIni.setValue("paths/" + key, globalIni.value("paths/" + key));
|
||||
for (auto it = pathsKeyMap.constBegin(); it != pathsKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
pathsIni.setValue(it.value(), globalIni.value(it.key()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!hasAny) {
|
||||
|
|
@ -375,9 +478,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()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -395,9 +525,9 @@ static void migrateLegacySets(const QString &settingsPath)
|
|||
QSettings cardDbIni(settingsPath + "cardDatabase.ini", QSettings::IniFormat);
|
||||
for (const auto &shortName : groups) {
|
||||
legacySetting.beginGroup(shortName);
|
||||
cardDbIni.setValue("sets/" + shortName + "/sortkey", legacySetting.value("sortkey"));
|
||||
cardDbIni.setValue("sets/" + shortName + "/sortKey", legacySetting.value("sortkey"));
|
||||
cardDbIni.setValue("sets/" + shortName + "/enabled", legacySetting.value("enabled"));
|
||||
cardDbIni.setValue("sets/" + shortName + "/isknown", legacySetting.value("isknown"));
|
||||
cardDbIni.setValue("sets/" + shortName + "/isKnown", legacySetting.value("isknown"));
|
||||
legacySetting.endGroup();
|
||||
}
|
||||
legacySetting.endGroup();
|
||||
|
|
@ -413,13 +543,30 @@ static void migrateLegacyServers(const QString &settingsPath)
|
|||
return;
|
||||
}
|
||||
|
||||
const QMap<QString, QString> serverKeyMap = {
|
||||
{"previoushostlogin", "previousHostLogin"},
|
||||
{"previoushosts", "previousHosts"},
|
||||
{"previoushostName", "previousHostName"},
|
||||
{"auto_connect", "autoConnect"},
|
||||
{"fphostname", "fpHostName"},
|
||||
{"fpport", "fpPort"},
|
||||
{"fpplayername", "fpPlayerName"},
|
||||
{"save_debug_log", "saveDebugLog"},
|
||||
};
|
||||
|
||||
QSettings serversIni(settingsPath + "servers.ini", QSettings::IniFormat);
|
||||
serversIni.setValue("server/previoushostlogin", legacySetting.value("previoushostlogin"));
|
||||
serversIni.setValue("server/previoushosts", legacySetting.value("previoushosts"));
|
||||
serversIni.setValue("server/auto_connect", legacySetting.value("auto_connect"));
|
||||
serversIni.setValue("server/fphostname", legacySetting.value("fphostname"));
|
||||
serversIni.setValue("server/fpport", legacySetting.value("fpport"));
|
||||
serversIni.setValue("server/fpplayername", legacySetting.value("fpplayername"));
|
||||
for (auto it = serverKeyMap.constBegin(); it != serverKeyMap.constEnd(); ++it) {
|
||||
if (legacySetting.contains(it.key())) {
|
||||
serversIni.setValue("server/" + it.value(), legacySetting.value(it.key()));
|
||||
}
|
||||
}
|
||||
|
||||
legacySetting.beginGroup("server_details");
|
||||
const QStringList detailsKeys = legacySetting.allKeys();
|
||||
for (const auto &key : detailsKeys) {
|
||||
serversIni.setValue("server/server_details/" + key, legacySetting.value(key));
|
||||
}
|
||||
legacySetting.endGroup();
|
||||
legacySetting.endGroup();
|
||||
}
|
||||
|
||||
|
|
@ -454,9 +601,36 @@ static void migrateLegacyGameFilters(const QString &settingsPath)
|
|||
return;
|
||||
}
|
||||
|
||||
const QMap<QString, QString> filterKeyMap = {
|
||||
{"hide_buddies_only_games", "hideBuddiesOnlyGames"},
|
||||
{"hide_full_games", "hideFullGames"},
|
||||
{"hide_games_that_started", "hideGamesThatStarted"},
|
||||
{"hide_password_protected_games", "hidePasswordProtectedGames"},
|
||||
{"hide_ignored_user_games", "hideIgnoredUserGames"},
|
||||
{"hide_not_buddy_created_games", "hideNotBuddyCreatedGames"},
|
||||
{"hide_open_decklist_games", "hideOpenDecklistGames"},
|
||||
{"game_name_filter", "gameNameFilter"},
|
||||
{"creator_name_filter", "creatorNameFilter"},
|
||||
{"min_players", "minPlayers"},
|
||||
{"max_players", "maxPlayers"},
|
||||
{"max_game_age_time", "maxGameAgeTime"},
|
||||
{"show_only_if_spectators_can_watch", "showOnlyIfSpectatorsCanWatch"},
|
||||
{"show_spectator_password_protected", "showSpectatorPasswordProtected"},
|
||||
{"show_only_if_spectators_can_chat", "showOnlyIfSpectatorsCanChat"},
|
||||
{"show_only_if_spectators_can_see_hands", "showOnlyIfSpectatorsCanSeeHands"},
|
||||
};
|
||||
|
||||
QSettings filtersIni(settingsPath + "gamefilters.ini", QSettings::IniFormat);
|
||||
for (auto it = filterKeyMap.constBegin(); it != filterKeyMap.constEnd(); ++it) {
|
||||
if (legacySetting.contains(it.key())) {
|
||||
filtersIni.setValue("filter_games/" + it.value(), legacySetting.value(it.key()));
|
||||
}
|
||||
}
|
||||
const QString gameTypePrefix = "game_type/";
|
||||
for (const auto &key : keys) {
|
||||
filtersIni.setValue("filter_games/" + key, legacySetting.value(key));
|
||||
if (key.startsWith(gameTypePrefix)) {
|
||||
filtersIni.setValue("filter_games/gameType/" + key.mid(gameTypePrefix.size()), legacySetting.value(key));
|
||||
}
|
||||
}
|
||||
legacySetting.endGroup();
|
||||
}
|
||||
|
|
@ -503,10 +677,15 @@ bool SettingsMigration::migrateSettingsFromGlobalIni(const QString &settingsPath
|
|||
migrateCacheStorageSettings(settingsPath, globalIni);
|
||||
migrateUpdatesSettings(settingsPath, globalIni);
|
||||
migratePersonalSettings(settingsPath, globalIni);
|
||||
migrateDownloadSettings(settingsPath, globalIni);
|
||||
migrateCardsDisplaySettings(settingsPath, globalIni);
|
||||
migrateCardCounterSettings(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");
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ QString SoundSettings::getSoundThemeName() const
|
|||
|
||||
int SoundSettings::getMasterVolume() const
|
||||
{
|
||||
return getValue("mastervolume", QString(), QString(), 100).toInt();
|
||||
return getValue("masterVolume", QString(), QString(), 100).toInt();
|
||||
}
|
||||
|
||||
void SoundSettings::setSoundEnabled(bool _soundEnabled)
|
||||
|
|
@ -34,6 +34,6 @@ void SoundSettings::setSoundThemeName(const QString &_soundThemeName)
|
|||
|
||||
void SoundSettings::setMasterVolume(int _masterVolume)
|
||||
{
|
||||
setValue(_masterVolume, "mastervolume");
|
||||
setValue(_masterVolume, "masterVolume");
|
||||
emit masterVolumeChanged(_masterVolume);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,17 +45,17 @@ bool UpdatesSettings::getAlwaysEnableNewSets() const
|
|||
|
||||
bool UpdatesSettings::getNotifyAboutUpdates() const
|
||||
{
|
||||
return getValue("updatenotification", QString(), QString(), true).toBool();
|
||||
return getValue("updateNotification", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
bool UpdatesSettings::getNotifyAboutNewVersion() const
|
||||
{
|
||||
return getValue("newversionnotification", QString(), QString(), true).toBool();
|
||||
return getValue("newVersionNotification", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
int UpdatesSettings::getUpdateReleaseChannelIndex() const
|
||||
{
|
||||
return getValue("updatereleasechannel", QString(), QString(), 0).toInt();
|
||||
return getValue("updateReleaseChannel", QString(), QString(), 0).toInt();
|
||||
}
|
||||
|
||||
void UpdatesSettings::setCheckUpdatesOnStartup(bool value)
|
||||
|
|
@ -90,15 +90,15 @@ void UpdatesSettings::setAlwaysEnableNewSets(bool value)
|
|||
|
||||
void UpdatesSettings::setNotifyAboutUpdates(bool _notifyaboutupdate)
|
||||
{
|
||||
setValue(_notifyaboutupdate, "updatenotification");
|
||||
setValue(_notifyaboutupdate, "updateNotification");
|
||||
}
|
||||
|
||||
void UpdatesSettings::setNotifyAboutNewVersion(bool _notifyaboutnewversion)
|
||||
{
|
||||
setValue(_notifyaboutnewversion, "newversionnotification");
|
||||
setValue(_notifyaboutnewversion, "newVersionNotification");
|
||||
}
|
||||
|
||||
void UpdatesSettings::setUpdateReleaseChannelIndex(int value)
|
||||
{
|
||||
setValue(value, "updatereleasechannel");
|
||||
setValue(value, "updateReleaseChannel");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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