mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-14 10:04:46 -07:00
Refactred settings to use settingscache & ini files
This commit is contained in:
parent
9c28cdd1f5
commit
c8d59eec5e
29 changed files with 780 additions and 241 deletions
|
|
@ -5,6 +5,11 @@
|
|||
#include <QSize>
|
||||
#include <QStringList>
|
||||
#include "shortcutssettings.h"
|
||||
#include "settings/carddatabasesettings.h"
|
||||
#include "settings/serverssettings.h"
|
||||
#include "settings/messagesettings.h"
|
||||
#include "settings/gamefilterssettings.h"
|
||||
#include "settings/layoutssettings.h"
|
||||
|
||||
// the falbacks are used for cards without a muid
|
||||
#define PIC_URL_DEFAULT "http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=!cardid!&type=card"
|
||||
|
|
@ -48,6 +53,12 @@ signals:
|
|||
private:
|
||||
QSettings *settings;
|
||||
ShortcutsSettings *shortcutsSettings;
|
||||
CardDatabaseSettings *cardDatabaseSettings;
|
||||
ServersSettings *serversSettings;
|
||||
MessageSettings *messageSettings;
|
||||
GameFiltersSettings *gameFiltersSettings;
|
||||
LayoutsSettings *layoutsSettings;
|
||||
|
||||
QByteArray mainWindowGeometry;
|
||||
QString lang;
|
||||
QString deckPath, replaysPath, picsPath, cardDatabasePath, tokenDatabasePath;
|
||||
|
|
@ -103,10 +114,8 @@ private:
|
|||
bool spectatorsCanTalk;
|
||||
bool spectatorsCanSeeEverything;
|
||||
int keepalive;
|
||||
QByteArray deckEditorLayoutState, deckEditorGeometry;
|
||||
QSize deckEditorFilterSize, deckEditorDeckSize, deckEditorCardSize;
|
||||
QString getSettingsPath();
|
||||
|
||||
void translateLegacySettings();
|
||||
public:
|
||||
SettingsCache();
|
||||
const QByteArray &getMainWindowGeometry() const { return mainWindowGeometry; }
|
||||
|
|
@ -180,19 +189,13 @@ public:
|
|||
bool getSpectatorsCanSeeEverything() const { return spectatorsCanSeeEverything; }
|
||||
int getKeepAlive() const { return keepalive; }
|
||||
void setClientID(QString clientID);
|
||||
QString getClientID() { return clientID; }
|
||||
QByteArray getDeckEditorLayoutState() const { return deckEditorLayoutState; }
|
||||
void setDeckEditorLayoutState(const QByteArray &value);
|
||||
QByteArray getDeckEditorGeometry() const { return deckEditorGeometry; }
|
||||
void setDeckEditorGeometry(const QByteArray &value);
|
||||
QSize getDeckEditorCardSize() const { return deckEditorCardSize; }
|
||||
void setDeckEditorCardSize(const QSize &value);
|
||||
QSize getDeckEditorDeckSize() const { return deckEditorDeckSize; }
|
||||
void setDeckEditorDeckSize(const QSize &value);
|
||||
QSize getDeckEditorFilterSize() const { return deckEditorFilterSize; }
|
||||
void setDeckEditorFilterSize(const QSize &value);
|
||||
QString getClientID() { return clientID; }
|
||||
ShortcutsSettings& shortcuts() const { return *shortcutsSettings; }
|
||||
|
||||
CardDatabaseSettings& cardDatabase() const { return *cardDatabaseSettings; }
|
||||
ServersSettings& servers() const { return *serversSettings; }
|
||||
MessageSettings& messages() const { return *messageSettings; }
|
||||
GameFiltersSettings& gameFilters() const { return *gameFiltersSettings; }
|
||||
LayoutsSettings& layouts() const { return *layoutsSettings; }
|
||||
public slots:
|
||||
void setMainWindowGeometry(const QByteArray &_mainWindowGeometry);
|
||||
void setLang(const QString &_lang);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue