mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 08:34:52 -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
59
cockatrice/src/settings/layoutssettings.cpp
Normal file
59
cockatrice/src/settings/layoutssettings.cpp
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
#include "layoutssettings.h"
|
||||
|
||||
LayoutsSettings::LayoutsSettings(QString settingPath, QObject *parent)
|
||||
: SettingsManager(settingPath+"layouts.ini", parent)
|
||||
{
|
||||
}
|
||||
|
||||
const QByteArray LayoutsSettings::getDeckEditorLayoutState()
|
||||
{
|
||||
return getValue("layouts/deckEditor_state").toByteArray();
|
||||
}
|
||||
|
||||
void LayoutsSettings::setDeckEditorLayoutState(const QByteArray &value)
|
||||
{
|
||||
setValue(value,"layouts/deckEditor_state");
|
||||
}
|
||||
|
||||
const QByteArray LayoutsSettings::getDeckEditorGeometry()
|
||||
{
|
||||
return getValue("layouts/deckEditor_geometry").toByteArray();
|
||||
}
|
||||
|
||||
void LayoutsSettings::setDeckEditorGeometry(const QByteArray &value)
|
||||
{
|
||||
setValue(value,"layouts/deckEditor_geometry");
|
||||
}
|
||||
|
||||
const QSize LayoutsSettings::getDeckEditorCardSize()
|
||||
{
|
||||
QVariant previous = getValue("layouts/deckEditor_CardSize");
|
||||
return previous == QVariant() ? QSize(250,500) : previous.toSize();
|
||||
}
|
||||
|
||||
void LayoutsSettings::setDeckEditorCardSize(const QSize &value)
|
||||
{
|
||||
setValue(value,"layouts/deckEditor_CardSize");
|
||||
}
|
||||
|
||||
const QSize LayoutsSettings::getDeckEditorDeckSize()
|
||||
{
|
||||
QVariant previous = getValue("layouts/deckEditor_DeckSize");
|
||||
return previous == QVariant() ? QSize(250,360) : previous.toSize();
|
||||
}
|
||||
|
||||
void LayoutsSettings::setDeckEditorDeckSize(const QSize &value)
|
||||
{
|
||||
setValue(value,"layouts/deckEditor_DeckSize");
|
||||
}
|
||||
|
||||
const QSize LayoutsSettings::getDeckEditorFilterSize()
|
||||
{
|
||||
QVariant previous = getValue("layouts/deckEditor_FilterSize");
|
||||
return previous == QVariant() ? QSize(250,250) : previous.toSize();
|
||||
}
|
||||
|
||||
void LayoutsSettings::setDeckEditorFilterSize(const QSize &value)
|
||||
{
|
||||
setValue(value,"layouts/deckEditor_FilterSize");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue