-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigman.h
109 lines (90 loc) · 2.02 KB
/
configman.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
#ifndef CONFIGMANAGER_H
#define CONFIGMANAGER_H
#include <QString>
#include <QJsonArray>
#include <QFont>
#include <QFile>
#include <QDir>
#include <QJsonDocument>
#include <QJsonObject>
enum VolumeAdjustMethod {
ALSA = 0,
PulseAudio = 1
};
enum PanelLocation {
Top = 1,
Bottom = 2,
Left = 3,
Right = 4
};
struct PanelCfg {
bool isNull = false;
QJsonArray applets;
QString screen;
QString backgroundImagePath;
int shift;
double opacity;
int margin;
int spacing;
qint8 thickness;
qint8 launcherIconSize;
PanelLocation location;
bool expand;
bool setOnCenter;
bool enableAutoHide;
int autoHideInterval;
};
class ConfigManager {
public:
ConfigManager();
void readConfig();
void setFields();
QJsonObject mConfigObj;
// General settings
QString mAccent;
QString mAvatar;
QString mIconTheme;
QString mStylesheet;
bool mTransparent;
int mCountPanels;
int mSecondsUntilPowerOff;
bool mEnableAnimation;
// Font
QString mFontFamily;
int mFontSize;
QFont mFont;
// App Menu applet settings
QJsonArray mFavApps;
QString mMenuIcon;
QString mMenuText;
int mMenuIconSize;
bool mUseTriangularTabs;
// Date & Time applet settings
QString mDateFormat;
QString mTimeFormat;
Qt::DayOfWeek mFirstDayOfWeek;
bool mShowDate;
bool mShowWeekNumbers;
// Volume applet settings
bool mEnableOveramplification;
VolumeAdjustMethod mVolumeAdjMethod;
int mDefaultVolume;
// Keyboard Layout applet settings
QString mKbToggleMethod;
QString mKbLayouts;
bool mUseCountryFlag;
// Window List applet settings
int mWinListIconSize;
bool mWinListShowTitles;
// Workspaces applet settings
bool mShowDesktopNames;
// IPv4 applet settings
QString mNetworkInterface;
QString mIPAddrColor;
// Sounds
QString mStartupSound;
QString mLogoutSound;
// Panels
QList<PanelCfg> mPanels;
};
#endif // CONFIGMANAGER_H