mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-28 11:50:25 -07:00
[Settings] Split cache_settings monolith into multiple SettingsManager sub-classes (#7050)
* [Settings] Split cache_settings into multiple files Took 9 minutes Took 4 minutes * [Settings] Fwd declare settings classes in cache_settings Took 15 minutes * Fix oracle includes. Took 8 minutes * Address comments, fix windows CI Took 8 minutes * fix copy constructor visibility Took 3 minutes * lint Took 2 minutes * Fix native format tests. Took 5 minutes * Remove test header guard Took 4 seconds * Remove tests invalid in CI environ Took 24 seconds * Adjust to rebase. Took 11 minutes * Change settings file name. Took 8 minutes --------- Co-authored-by: Lukas Brübach <lukas.bruebach@bdosecurity.de> Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
cf0b453e75
commit
12f0f59453
166 changed files with 5589 additions and 3066 deletions
|
|
@ -3,10 +3,21 @@ set(CMAKE_AUTOUIC ON)
|
|||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
set(HEADERS
|
||||
libcockatrice/interfaces/interface_cache_storage_settings_provider.h
|
||||
libcockatrice/interfaces/interface_card_database_path_provider.h
|
||||
libcockatrice/interfaces/interface_card_preference_provider.h
|
||||
libcockatrice/interfaces/interface_card_set_priority_controller.h
|
||||
libcockatrice/interfaces/interface_cards_display_settings_provider.h
|
||||
libcockatrice/interfaces/interface_chat_settings_provider.h
|
||||
libcockatrice/interfaces/interface_game_settings_provider.h
|
||||
libcockatrice/interfaces/interface_interface_settings_provider.h
|
||||
libcockatrice/interfaces/interface_network_settings_provider.h
|
||||
libcockatrice/interfaces/interface_paths_settings_provider.h
|
||||
libcockatrice/interfaces/interface_personal_settings_provider.h
|
||||
libcockatrice/interfaces/interface_sound_settings_provider.h
|
||||
libcockatrice/interfaces/interface_tabs_settings_provider.h
|
||||
libcockatrice/interfaces/interface_updates_settings_provider.h
|
||||
libcockatrice/interfaces/interface_visual_deck_storage_settings_provider.h
|
||||
libcockatrice/interfaces/noop_card_database_path_provider.h
|
||||
libcockatrice/interfaces/noop_card_preference_provider.h
|
||||
libcockatrice/interfaces/noop_card_set_priority_controller.h
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
#ifndef COCKATRICE_INTERFACE_CACHE_STORAGE_SETTINGS_PROVIDER_H
|
||||
#define COCKATRICE_INTERFACE_CACHE_STORAGE_SETTINGS_PROVIDER_H
|
||||
|
||||
class ICacheStorageSettingsProvider
|
||||
{
|
||||
public:
|
||||
virtual ~ICacheStorageSettingsProvider() = default;
|
||||
|
||||
[[nodiscard]] virtual int getPixmapCacheSize() const = 0;
|
||||
[[nodiscard]] virtual int getNetworkCacheSizeInMB() const = 0;
|
||||
[[nodiscard]] virtual int getRedirectCacheTtl() const = 0;
|
||||
};
|
||||
|
||||
#endif // COCKATRICE_INTERFACE_CACHE_STORAGE_SETTINGS_PROVIDER_H
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
#ifndef COCKATRICE_INTERFACE_CARDS_DISPLAY_SETTINGS_PROVIDER_H
|
||||
#define COCKATRICE_INTERFACE_CARDS_DISPLAY_SETTINGS_PROVIDER_H
|
||||
|
||||
class ICardsDisplaySettingsProvider
|
||||
{
|
||||
public:
|
||||
virtual ~ICardsDisplaySettingsProvider() = default;
|
||||
|
||||
[[nodiscard]] virtual bool getDisplayCardNames() const = 0;
|
||||
[[nodiscard]] virtual bool getRoundCardCorners() const = 0;
|
||||
[[nodiscard]] virtual bool getOverrideAllCardArtWithPersonalPreference() const = 0;
|
||||
[[nodiscard]] virtual bool getBumpSetsWithCardsInDeckToTop() const = 0;
|
||||
[[nodiscard]] virtual int getPrintingSelectorSortOrder() const = 0;
|
||||
[[nodiscard]] virtual int getPrintingSelectorCardSize() const = 0;
|
||||
[[nodiscard]] virtual bool getIncludeRebalancedCards() const = 0;
|
||||
[[nodiscard]] virtual bool getPrintingSelectorNavigationButtonsVisible() const = 0;
|
||||
[[nodiscard]] virtual bool getDeckEditorBannerCardComboBoxVisible() const = 0;
|
||||
[[nodiscard]] virtual bool getDeckEditorTagsWidgetVisible() const = 0;
|
||||
[[nodiscard]] virtual bool getTapAnimation() const = 0;
|
||||
[[nodiscard]] virtual bool getAutoRotateSidewaysLayoutCards() const = 0;
|
||||
[[nodiscard]] virtual bool getScaleCards() const = 0;
|
||||
[[nodiscard]] virtual int getStackCardOverlapPercent() const = 0;
|
||||
[[nodiscard]] virtual int getCardInfoViewMode() const = 0;
|
||||
[[nodiscard]] virtual bool getShowShortcuts() const = 0;
|
||||
[[nodiscard]] virtual bool getShowGameSelectorFilterToolbar() const = 0;
|
||||
};
|
||||
|
||||
#endif // COCKATRICE_INTERFACE_CARDS_DISPLAY_SETTINGS_PROVIDER_H
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
#ifndef COCKATRICE_INTERFACE_CHAT_SETTINGS_PROVIDER_H
|
||||
#define COCKATRICE_INTERFACE_CHAT_SETTINGS_PROVIDER_H
|
||||
|
||||
#include <QString>
|
||||
|
||||
class IChatSettingsProvider
|
||||
{
|
||||
public:
|
||||
virtual ~IChatSettingsProvider() = default;
|
||||
|
||||
[[nodiscard]] virtual bool getChatMention() const = 0;
|
||||
[[nodiscard]] virtual bool getChatMentionCompleter() const = 0;
|
||||
[[nodiscard]] virtual QString getChatMentionColor() const = 0;
|
||||
[[nodiscard]] virtual QString getChatHighlightColor() const = 0;
|
||||
[[nodiscard]] virtual bool getChatMentionForeground() const = 0;
|
||||
[[nodiscard]] virtual bool getChatHighlightForeground() const = 0;
|
||||
[[nodiscard]] virtual bool getIgnoreUnregisteredUsers() const = 0;
|
||||
[[nodiscard]] virtual bool getIgnoreUnregisteredUserMessages() const = 0;
|
||||
[[nodiscard]] virtual bool getIgnoreNonBuddyUserMessages() const = 0;
|
||||
[[nodiscard]] virtual bool getShowMessagePopup() const = 0;
|
||||
[[nodiscard]] virtual bool getShowMentionPopup() const = 0;
|
||||
[[nodiscard]] virtual bool getRoomHistory() const = 0;
|
||||
[[nodiscard]] virtual QString getHighlightWords() const = 0;
|
||||
};
|
||||
|
||||
#endif // COCKATRICE_INTERFACE_CHAT_SETTINGS_PROVIDER_H
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
#ifndef COCKATRICE_INTERFACE_GAME_SETTINGS_PROVIDER_H
|
||||
#define COCKATRICE_INTERFACE_GAME_SETTINGS_PROVIDER_H
|
||||
|
||||
#include <QString>
|
||||
|
||||
class IGameSettingsProvider
|
||||
{
|
||||
public:
|
||||
virtual ~IGameSettingsProvider() = default;
|
||||
|
||||
[[nodiscard]] virtual QString getGameDescription() const = 0;
|
||||
[[nodiscard]] virtual int getMaxPlayers() const = 0;
|
||||
[[nodiscard]] virtual QString getGameTypes() const = 0;
|
||||
[[nodiscard]] virtual bool getOnlyBuddies() const = 0;
|
||||
[[nodiscard]] virtual bool getOnlyRegistered() const = 0;
|
||||
[[nodiscard]] virtual bool getSpectatorsAllowed() const = 0;
|
||||
[[nodiscard]] virtual bool getSpectatorsNeedPassword() const = 0;
|
||||
[[nodiscard]] virtual bool getSpectatorsCanTalk() const = 0;
|
||||
[[nodiscard]] virtual bool getSpectatorsCanSeeEverything() const = 0;
|
||||
[[nodiscard]] virtual bool getCreateGameAsSpectator() const = 0;
|
||||
[[nodiscard]] virtual int getDefaultStartingLifeTotal() const = 0;
|
||||
[[nodiscard]] virtual bool getShareDecklistsOnLoad() const = 0;
|
||||
[[nodiscard]] virtual bool getRememberGameSettings() const = 0;
|
||||
[[nodiscard]] virtual bool getLocalGameRememberSettings() const = 0;
|
||||
[[nodiscard]] virtual int getLocalGameMaxPlayers() const = 0;
|
||||
[[nodiscard]] virtual int getLocalGameStartingLifeTotal() const = 0;
|
||||
};
|
||||
|
||||
#endif // COCKATRICE_INTERFACE_GAME_SETTINGS_PROVIDER_H
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
#ifndef COCKATRICE_INTERFACE_INTERFACE_SETTINGS_PROVIDER_H
|
||||
#define COCKATRICE_INTERFACE_INTERFACE_SETTINGS_PROVIDER_H
|
||||
|
||||
#include <QString>
|
||||
|
||||
class IInterfaceSettingsProvider
|
||||
{
|
||||
public:
|
||||
virtual ~IInterfaceSettingsProvider() = default;
|
||||
|
||||
[[nodiscard]] virtual bool getUseTearOffMenus() const = 0;
|
||||
[[nodiscard]] virtual int getCardViewInitialRowsMax() const = 0;
|
||||
[[nodiscard]] virtual int getCardViewExpandedRowsMax() const = 0;
|
||||
[[nodiscard]] virtual bool getCloseEmptyCardView() const = 0;
|
||||
[[nodiscard]] virtual bool getFocusCardViewSearchBar() const = 0;
|
||||
[[nodiscard]] virtual bool getKeepGameChatFocus() const = 0;
|
||||
[[nodiscard]] virtual bool getNotificationsEnabled() const = 0;
|
||||
[[nodiscard]] virtual bool getSpectatorNotificationsEnabled() const = 0;
|
||||
[[nodiscard]] virtual bool getBuddyConnectNotificationsEnabled() const = 0;
|
||||
[[nodiscard]] virtual bool getDoubleClickToPlay() const = 0;
|
||||
[[nodiscard]] virtual bool getClickPlaysAllSelected() const = 0;
|
||||
[[nodiscard]] virtual bool getPlayToStack() const = 0;
|
||||
[[nodiscard]] virtual bool getDoNotDeleteArrowsInSubPhases() const = 0;
|
||||
[[nodiscard]] virtual int getStartingHandSize() const = 0;
|
||||
[[nodiscard]] virtual bool getAnnotateTokens() const = 0;
|
||||
[[nodiscard]] virtual bool getShowDragSelectionCount() const = 0;
|
||||
[[nodiscard]] virtual bool getShowTotalSelectionCount() const = 0;
|
||||
[[nodiscard]] virtual int getTallyType() const = 0;
|
||||
[[nodiscard]] virtual bool getHorizontalHand() const = 0;
|
||||
[[nodiscard]] virtual bool getInvertVerticalCoordinate() const = 0;
|
||||
[[nodiscard]] virtual int getMinPlayersForMultiColumnLayout() const = 0;
|
||||
[[nodiscard]] virtual bool getOpenDeckInNewTab() const = 0;
|
||||
[[nodiscard]] virtual int getRewindBufferingMs() const = 0;
|
||||
[[nodiscard]] virtual qreal getFastForwardSpeed() const = 0;
|
||||
[[nodiscard]] virtual bool getStyleUserList() const = 0;
|
||||
[[nodiscard]] virtual bool getLeftJustified() const = 0;
|
||||
[[nodiscard]] virtual int getZoneViewGroupByIndex() const = 0;
|
||||
[[nodiscard]] virtual int getZoneViewSortByIndex() const = 0;
|
||||
[[nodiscard]] virtual bool getZoneViewPileView() const = 0;
|
||||
[[nodiscard]] virtual QString getKnownMissingFeatures() = 0;
|
||||
};
|
||||
|
||||
#endif // COCKATRICE_INTERFACE_INTERFACE_SETTINGS_PROVIDER_H
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
#ifndef COCKATRICE_INTERFACE_PATHS_SETTINGS_PROVIDER_H
|
||||
#define COCKATRICE_INTERFACE_PATHS_SETTINGS_PROVIDER_H
|
||||
|
||||
#include <QString>
|
||||
|
||||
class IPathsSettingsProvider
|
||||
{
|
||||
public:
|
||||
virtual ~IPathsSettingsProvider() = default;
|
||||
|
||||
[[nodiscard]] virtual QString getDeckPath() const = 0;
|
||||
[[nodiscard]] virtual QString getFiltersPath() const = 0;
|
||||
[[nodiscard]] virtual QString getReplaysPath() const = 0;
|
||||
[[nodiscard]] virtual QString getPicsPath() const = 0;
|
||||
[[nodiscard]] virtual QString getCustomPicsPath() const = 0;
|
||||
[[nodiscard]] virtual QString getThemesPath() const = 0;
|
||||
[[nodiscard]] virtual QString getCardDatabasePath() const = 0;
|
||||
[[nodiscard]] virtual QString getCustomCardDatabasePath() const = 0;
|
||||
[[nodiscard]] virtual QString getTokenDatabasePath() const = 0;
|
||||
[[nodiscard]] virtual QString getSpoilerCardDatabasePath() const = 0;
|
||||
[[nodiscard]] virtual QString getRedirectCachePath() const = 0;
|
||||
};
|
||||
|
||||
#endif // COCKATRICE_INTERFACE_PATHS_SETTINGS_PROVIDER_H
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
#ifndef COCKATRICE_INTERFACE_PERSONAL_SETTINGS_PROVIDER_H
|
||||
#define COCKATRICE_INTERFACE_PERSONAL_SETTINGS_PROVIDER_H
|
||||
|
||||
#include <QDate>
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
|
||||
class IPersonalSettingsProvider
|
||||
{
|
||||
public:
|
||||
virtual ~IPersonalSettingsProvider() = default;
|
||||
|
||||
[[nodiscard]] virtual QString getLang() const = 0;
|
||||
[[nodiscard]] virtual QString getClientID() = 0;
|
||||
[[nodiscard]] virtual QString getClientVersion() = 0;
|
||||
[[nodiscard]] virtual int getKeepAlive() const = 0;
|
||||
[[nodiscard]] virtual int getTimeOut() const = 0;
|
||||
[[nodiscard]] virtual bool getPicDownload() const = 0;
|
||||
[[nodiscard]] virtual bool getShowStatusBar() const = 0;
|
||||
[[nodiscard]] virtual int getMaxFontSize() const = 0;
|
||||
[[nodiscard]] virtual QString getHighlightWords() const = 0;
|
||||
[[nodiscard]] virtual QString getHomeTabBackgroundSource() const = 0;
|
||||
[[nodiscard]] virtual int getHomeTabBackgroundShuffleFrequency() const = 0;
|
||||
[[nodiscard]] virtual bool getHomeTabDisplayCardName() const = 0;
|
||||
[[nodiscard]] virtual bool getShowTipsOnStartup() const = 0;
|
||||
[[nodiscard]] virtual QList<int> getSeenTips() const = 0;
|
||||
[[nodiscard]] virtual bool getDownloadSpoilersStatus() const = 0;
|
||||
};
|
||||
|
||||
#endif // COCKATRICE_INTERFACE_PERSONAL_SETTINGS_PROVIDER_H
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
#ifndef COCKATRICE_INTERFACE_SOUND_SETTINGS_PROVIDER_H
|
||||
#define COCKATRICE_INTERFACE_SOUND_SETTINGS_PROVIDER_H
|
||||
|
||||
#include <QString>
|
||||
|
||||
class ISoundSettingsProvider
|
||||
{
|
||||
public:
|
||||
virtual ~ISoundSettingsProvider() = default;
|
||||
|
||||
[[nodiscard]] virtual bool getSoundEnabled() const = 0;
|
||||
[[nodiscard]] virtual QString getSoundThemeName() const = 0;
|
||||
[[nodiscard]] virtual int getMasterVolume() const = 0;
|
||||
};
|
||||
|
||||
#endif // COCKATRICE_INTERFACE_SOUND_SETTINGS_PROVIDER_H
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
#ifndef COCKATRICE_INTERFACE_TABS_SETTINGS_PROVIDER_H
|
||||
#define COCKATRICE_INTERFACE_TABS_SETTINGS_PROVIDER_H
|
||||
|
||||
class ITabsSettingsProvider
|
||||
{
|
||||
public:
|
||||
virtual ~ITabsSettingsProvider() = default;
|
||||
|
||||
[[nodiscard]] virtual bool getTabVisualDeckStorageOpen() const = 0;
|
||||
[[nodiscard]] virtual bool getTabServerOpen() const = 0;
|
||||
[[nodiscard]] virtual bool getTabAccountOpen() const = 0;
|
||||
[[nodiscard]] virtual bool getTabDeckStorageOpen() const = 0;
|
||||
[[nodiscard]] virtual bool getTabReplaysOpen() const = 0;
|
||||
[[nodiscard]] virtual bool getTabAdminOpen() const = 0;
|
||||
[[nodiscard]] virtual bool getTabLogOpen() const = 0;
|
||||
};
|
||||
|
||||
#endif // COCKATRICE_INTERFACE_TABS_SETTINGS_PROVIDER_H
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
#ifndef COCKATRICE_INTERFACE_UPDATES_SETTINGS_PROVIDER_H
|
||||
#define COCKATRICE_INTERFACE_UPDATES_SETTINGS_PROVIDER_H
|
||||
|
||||
#include <QDate>
|
||||
|
||||
class IUpdatesSettingsProvider
|
||||
{
|
||||
public:
|
||||
virtual ~IUpdatesSettingsProvider() = default;
|
||||
|
||||
[[nodiscard]] virtual bool getCheckUpdatesOnStartup() const = 0;
|
||||
[[nodiscard]] virtual bool getStartupCardUpdateCheckPromptForUpdate() = 0;
|
||||
[[nodiscard]] virtual bool getStartupCardUpdateCheckAlwaysUpdate() = 0;
|
||||
[[nodiscard]] virtual int getCardUpdateCheckInterval() const = 0;
|
||||
[[nodiscard]] virtual QDate getLastCardUpdateCheck() const = 0;
|
||||
[[nodiscard]] virtual bool getCardUpdateCheckRequired() const = 0;
|
||||
[[nodiscard]] virtual bool getAlwaysEnableNewSets() const = 0;
|
||||
[[nodiscard]] virtual bool getNotifyAboutUpdates() const = 0;
|
||||
[[nodiscard]] virtual bool getNotifyAboutNewVersion() const = 0;
|
||||
[[nodiscard]] virtual int getUpdateReleaseChannelIndex() const = 0;
|
||||
};
|
||||
|
||||
#endif // COCKATRICE_INTERFACE_UPDATES_SETTINGS_PROVIDER_H
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
#ifndef COCKATRICE_INTERFACE_VISUAL_DECK_STORAGE_SETTINGS_PROVIDER_H
|
||||
#define COCKATRICE_INTERFACE_VISUAL_DECK_STORAGE_SETTINGS_PROVIDER_H
|
||||
|
||||
#include <QStringList>
|
||||
|
||||
class IVisualDeckStorageSettingsProvider
|
||||
{
|
||||
public:
|
||||
virtual ~IVisualDeckStorageSettingsProvider() = default;
|
||||
|
||||
[[nodiscard]] virtual int getVisualDeckStorageSortingOrder() const = 0;
|
||||
[[nodiscard]] virtual bool getVisualDeckStorageShowFolders() const = 0;
|
||||
[[nodiscard]] virtual bool getVisualDeckStorageShowTagFilter() const = 0;
|
||||
[[nodiscard]] virtual QStringList getVisualDeckStorageDefaultTagsList() const = 0;
|
||||
[[nodiscard]] virtual bool getVisualDeckStorageSearchFolderNames() const = 0;
|
||||
[[nodiscard]] virtual bool getVisualDeckStorageShowColorIdentity() const = 0;
|
||||
[[nodiscard]] virtual bool getVisualDeckStorageShowBannerCardComboBox() const = 0;
|
||||
[[nodiscard]] virtual bool getVisualDeckStorageShowTagsOnDeckPreviews() const = 0;
|
||||
[[nodiscard]] virtual int getVisualDeckStorageCardSize() const = 0;
|
||||
[[nodiscard]] virtual bool getVisualDeckStorageDrawUnusedColorIdentities() const = 0;
|
||||
[[nodiscard]] virtual int getVisualDeckStorageUnusedColorIdentitiesOpacity() const = 0;
|
||||
[[nodiscard]] virtual int getVisualDeckStorageTooltipType() const = 0;
|
||||
[[nodiscard]] virtual bool getVisualDeckStoragePromptForConversion() const = 0;
|
||||
[[nodiscard]] virtual bool getVisualDeckStorageAlwaysConvert() const = 0;
|
||||
[[nodiscard]] virtual bool getVisualDeckStorageInGame() const = 0;
|
||||
[[nodiscard]] virtual bool getVisualDeckStorageSelectionAnimation() const = 0;
|
||||
[[nodiscard]] virtual int getVisualDeckEditorCardSize() const = 0;
|
||||
[[nodiscard]] virtual int getVisualDeckEditorSampleHandSize() const = 0;
|
||||
[[nodiscard]] virtual int getVisualDatabaseDisplayCardSize() const = 0;
|
||||
[[nodiscard]] virtual bool getVisualDatabaseDisplayFilterToMostRecentSetsEnabled() const = 0;
|
||||
[[nodiscard]] virtual int getVisualDatabaseDisplayFilterToMostRecentSetsAmount() const = 0;
|
||||
[[nodiscard]] virtual int getEDHRecCardSize() const = 0;
|
||||
[[nodiscard]] virtual int getArchidektPreviewSize() const = 0;
|
||||
[[nodiscard]] virtual int getDefaultDeckEditorType() const = 0;
|
||||
};
|
||||
|
||||
#endif // COCKATRICE_INTERFACE_VISUAL_DECK_STORAGE_SETTINGS_PROVIDER_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue