1 #include "layoutssettings.h"
2 
LayoutsSettings(QString settingPath,QObject * parent)3 LayoutsSettings::LayoutsSettings(QString settingPath, QObject *parent)
4     : SettingsManager(settingPath + "layouts.ini", parent)
5 {
6 }
7 
getDeckEditorLayoutState()8 const QByteArray LayoutsSettings::getDeckEditorLayoutState()
9 {
10     return getValue("layouts/deckEditor_state").toByteArray();
11 }
12 
setDeckEditorLayoutState(const QByteArray & value)13 void LayoutsSettings::setDeckEditorLayoutState(const QByteArray &value)
14 {
15     setValue(value, "layouts/deckEditor_state");
16 }
17 
getDeckEditorGeometry()18 const QByteArray LayoutsSettings::getDeckEditorGeometry()
19 {
20     return getValue("layouts/deckEditor_geometry").toByteArray();
21 }
22 
setDeckEditorGeometry(const QByteArray & value)23 void LayoutsSettings::setDeckEditorGeometry(const QByteArray &value)
24 {
25     setValue(value, "layouts/deckEditor_geometry");
26 }
27 
getDeckEditorCardSize()28 const QSize LayoutsSettings::getDeckEditorCardSize()
29 {
30     QVariant previous = getValue("layouts/deckEditor_CardSize");
31     return previous == QVariant() ? QSize(250, 500) : previous.toSize();
32 }
33 
setDeckEditorCardSize(const QSize & value)34 void LayoutsSettings::setDeckEditorCardSize(const QSize &value)
35 {
36     setValue(value, "layouts/deckEditor_CardSize");
37 }
38 
getDeckEditorDeckSize()39 const QSize LayoutsSettings::getDeckEditorDeckSize()
40 {
41     QVariant previous = getValue("layouts/deckEditor_DeckSize");
42     return previous == QVariant() ? QSize(250, 360) : previous.toSize();
43 }
44 
setDeckEditorDeckSize(const QSize & value)45 void LayoutsSettings::setDeckEditorDeckSize(const QSize &value)
46 {
47     setValue(value, "layouts/deckEditor_DeckSize");
48 }
49 
getDeckEditorFilterSize()50 const QSize LayoutsSettings::getDeckEditorFilterSize()
51 {
52     QVariant previous = getValue("layouts/deckEditor_FilterSize");
53     return previous == QVariant() ? QSize(250, 250) : previous.toSize();
54 }
55 
setDeckEditorFilterSize(const QSize & value)56 void LayoutsSettings::setDeckEditorFilterSize(const QSize &value)
57 {
58     setValue(value, "layouts/deckEditor_FilterSize");
59 }
60 
getDeckEditorDbHeaderState()61 const QByteArray LayoutsSettings::getDeckEditorDbHeaderState()
62 {
63     return getValue("layouts/deckEditorDbHeader_state").toByteArray();
64 }
65 
setDeckEditorDbHeaderState(const QByteArray & value)66 void LayoutsSettings::setDeckEditorDbHeaderState(const QByteArray &value)
67 {
68     setValue(value, "layouts/deckEditorDbHeader_state");
69 }
70 
setGamePlayAreaGeometry(const QByteArray & value)71 void LayoutsSettings::setGamePlayAreaGeometry(const QByteArray &value)
72 {
73     setValue(value, "layouts/gameplayarea_geometry");
74 }
75 
setGamePlayAreaState(const QByteArray & value)76 void LayoutsSettings::setGamePlayAreaState(const QByteArray &value)
77 {
78     setValue(value, "layouts/gameplayarea_state");
79 }
80 
getGamePlayAreaLayoutState()81 const QByteArray LayoutsSettings::getGamePlayAreaLayoutState()
82 {
83     return getValue("layouts/gameplayarea_state").toByteArray();
84 }
85 
getGamePlayAreaGeometry()86 const QByteArray LayoutsSettings::getGamePlayAreaGeometry()
87 {
88     return getValue("layouts/gameplayarea_geometry").toByteArray();
89 }
90 
getGameCardInfoSize()91 const QSize LayoutsSettings::getGameCardInfoSize()
92 {
93     QVariant previous = getValue("layouts/gameplayarea_CardInfoSize");
94     return previous == QVariant() ? QSize(250, 360) : previous.toSize();
95 }
96 
setGameCardInfoSize(const QSize & value)97 void LayoutsSettings::setGameCardInfoSize(const QSize &value)
98 {
99     setValue(value, "layouts/gameplayarea_CardInfoSize");
100 }
101 
getGameMessageLayoutSize()102 const QSize LayoutsSettings::getGameMessageLayoutSize()
103 {
104     QVariant previous = getValue("layouts/gameplayarea_MessageLayoutSize");
105     return previous == QVariant() ? QSize(250, 250) : previous.toSize();
106 }
107 
setGameMessageLayoutSize(const QSize & value)108 void LayoutsSettings::setGameMessageLayoutSize(const QSize &value)
109 {
110     setValue(value, "layouts/gameplayarea_MessageLayoutSize");
111 }
112 
getGamePlayerListSize()113 const QSize LayoutsSettings::getGamePlayerListSize()
114 {
115     QVariant previous = getValue("layouts/gameplayarea_PlayerListSize");
116     return previous == QVariant() ? QSize(250, 50) : previous.toSize();
117 }
118 
setGamePlayerListSize(const QSize & value)119 void LayoutsSettings::setGamePlayerListSize(const QSize &value)
120 {
121     setValue(value, "layouts/gameplayarea_PlayerListSize");
122 }
123 
setReplayPlayAreaGeometry(const QByteArray & value)124 void LayoutsSettings::setReplayPlayAreaGeometry(const QByteArray &value)
125 {
126     setValue(value, "layouts/replayplayarea_geometry");
127 }
128 
setReplayPlayAreaState(const QByteArray & value)129 void LayoutsSettings::setReplayPlayAreaState(const QByteArray &value)
130 {
131     setValue(value, "layouts/replayplayarea_state");
132 }
133 
getReplayPlayAreaLayoutState()134 const QByteArray LayoutsSettings::getReplayPlayAreaLayoutState()
135 {
136     return getValue("layouts/replayplayarea_state").toByteArray();
137 }
138 
getReplayPlayAreaGeometry()139 const QByteArray LayoutsSettings::getReplayPlayAreaGeometry()
140 {
141     return getValue("layouts/replayplayarea_geometry").toByteArray();
142 }
143 
getReplayCardInfoSize()144 const QSize LayoutsSettings::getReplayCardInfoSize()
145 {
146     QVariant previous = getValue("layouts/replayplayarea_CardInfoSize");
147     return previous == QVariant() ? QSize(250, 360) : previous.toSize();
148 }
149 
setReplayCardInfoSize(const QSize & value)150 void LayoutsSettings::setReplayCardInfoSize(const QSize &value)
151 {
152     setValue(value, "layouts/replayplayarea_CardInfoSize");
153 }
154 
getReplayMessageLayoutSize()155 const QSize LayoutsSettings::getReplayMessageLayoutSize()
156 {
157     QVariant previous = getValue("layouts/replayplayarea_MessageLayoutSize");
158     return previous == QVariant() ? QSize(250, 200) : previous.toSize();
159 }
160 
setReplayMessageLayoutSize(const QSize & value)161 void LayoutsSettings::setReplayMessageLayoutSize(const QSize &value)
162 {
163     setValue(value, "layouts/replayplayarea_MessageLayoutSize");
164 }
165 
getReplayPlayerListSize()166 const QSize LayoutsSettings::getReplayPlayerListSize()
167 {
168     QVariant previous = getValue("layouts/replayplayarea_PlayerListSize");
169     return previous == QVariant() ? QSize(250, 50) : previous.toSize();
170 }
171 
setReplayPlayerListSize(const QSize & value)172 void LayoutsSettings::setReplayPlayerListSize(const QSize &value)
173 {
174     setValue(value, "layouts/replayplayarea_PlayerListSize");
175 }
176 
getReplayReplaySize()177 const QSize LayoutsSettings::getReplayReplaySize()
178 {
179     QVariant previous = getValue("layouts/replayplayarea_ReplaySize");
180     return previous == QVariant() ? QSize(900, 100) : previous.toSize();
181 }
182 
setReplayReplaySize(const QSize & value)183 void LayoutsSettings::setReplayReplaySize(const QSize &value)
184 {
185     setValue(value, "layouts/replayplayarea_ReplaySize");
186 }