forked from Hackeridze/Qtnp
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Settings.h
211 lines (179 loc) · 4.04 KB
/
Settings.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
#ifndef SETTINGS_H
#define SETTINGS_H
#include <QSettings>
#include <QColor>
#include <QPoint>
#include <QDir>
/*
* Define Qtnp version
*/
#define VERSION "2.0.0-beta"
/*
* Config file settings:
*/
/*
* Background color for new images
*/
#define BG_COLOR "bgColor"
#define DBG_COLOR white
/*
* Grid color for new grids
*/
#define GRID_COLOR "gridColor"
#define DGRID_COLOR black
/*
* Coordinate plane color for new coordinate planes
*/
#define CP_COLOR "cpColor"
#define DCP_COLOR black
/*
* Graphic color for new graphics
*/
#define GRAPHIC_COLOR "graphicColor"
#define DGRAPHIC_COLOR black
/*
* Pen color
*/
#define P_COLOR "penColor"
#define DP_COLOR black
/*
* Right pen color
*/
#define R_COLOR "rpenColor"
#define DR_COLOR white
/*
* Default template for new images
*/
#define IMAGE_TEMPLATE "imageTemplate"
#define DIMAGE_TEMPLATE 5
/*
* Thicknesses for instruments
*/
#define THICKNESS "thickness"
#define DTHICKNESS 3
#define GRID_THICKNESS "gridThickness"
#define DGRID_THICKNESS 1
#define CP_THICKNESS "cpThickness"
#define DCP_THICKNESS 3
#define GRAPHIC_THICKNESS "graphicThickness"
#define DGRAPHIC_THICKNESS 3
/*
* Steps
*/
#define GRID_STEP "gridStep"
#define DGRID_STEP 50
#define CP_STEP "cpStep"
#define DCP_STEP 50
/*
* Reverse toolsbar's buttons place
* false for RIGHT_TO_LEFT
* true for LEFT_TO_RIGHT
* Starting with FULLSCREEN_BUTTON
*/
#define REVERSE_TOOLBAR "reverseToolBar"
#define DREVERSE_TOOLBAR false
/*
* Repeat grid's settings automaticaly for coordinate plane in GCPWidget
*/
#define SYNC_CP_TO_GRID "syncCPToGrid"
#define DSYNC_CP_TO_GRID true
/*
* Start presentation automaticaly
*/
#define AUTO_PRESENTATION "autoPresentation"
#define DAUTO_PRESENTATION false
/*
* ui language
*/
#define LANGUAGE "language"
#define DLANGUAGE "en"
/*
* Presentation directory
*/
#define PRESENTATION_DIRECTORY "presentationDirectory"
#define DPRESENTATION_DIRECTORY QDir::homePath()
/*
* real grid
*/
#define REALGRID "realGrid"
#define DREALGRID true
/*
* real coordinate plane
*/
#define REALCP "realCP"
#define DREALCP true
/*
* Numbers opacity in coordinate plane
*/
#define NUMBERSOPACITY "numbersOpacity"
#define DNUMBERSOPACITY 0.65
/*
* Run in fullscreen
*/
#define FULLSCREEN "fullscreen"
#define DFULLSCREEN false
/*
* Window geometry
*/
#define GEOMETRY "geometry"
//#define DGEOMETRY false
class Settings : public QSettings
{
Q_OBJECT
public:
explicit Settings(QObject *parent = 0);
QColor bgColor();
QColor gridColor();
QColor cpColor();
QColor graphicColor();
QColor penColor();
QColor rpenColor();
int imageTemplate();
int thickness();
int gridThickness();
int cpThickness();
int graphicThickness();
int gridStep();
int cpStep();
qreal numbersOpacity();
bool reverseToolBar();
bool syncCPToGrid();
bool autoPresentation();
bool realGrid();
bool realCP();
bool fullscreen();
QString language();
QString presentationDirectory();
QList<QPoint>* templates();
QByteArray geometry();
signals:
public slots:
void restoreDefaults();
void setBgColor(QColor c);
void setGridColor(QColor c);
void setCpColor(QColor c);
void setGraphicColor(QColor c);
void setPenColor(QColor c);
void setRpenColor(QColor c);
void setImageTemplate(int t);
void setThickness(int t);
void setGridThickness(int t);
void setCpThickness(int t);
void setGraphicThickness(int t);
void setGridStep(int s);
void setCpStep(int s);
void setNumbersOpacity(qreal o);
void setReverseToolBar(bool r);
void setSyncCPToGrid(bool p);
void setAutoPresentation(bool p);
void setLanguage(QString l);
void setPresentationDirectory(QString d);
void setRealGrid(bool p);
void setRealCP(bool p);
void setFullscreen(bool p);
void setGeometry(QByteArray g);
private:
QColor white, black;
QList<QPoint> standartImageTemplates;
};
#endif // SETTINGS_H