This repository has been archived by the owner on Feb 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
settings.h
214 lines (183 loc) · 5.78 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
212
213
214
#ifndef SETTINGS_H
#define SETTINGS_H
#include <QDir>
#include <QFile>
#include <QNetworkProxy>
class Settings
{
public:
Settings() = default;
~Settings();
void save();
void load();
bool searchOrFitler() const
{
return m_searchOrFitler;
}
void setSearchOrFitler(bool searchOrFitler)
{
m_searchOrFitler = searchOrFitler;
}
const QString &temporaryDirectory() const
{
return m_temporaryDirectory;
}
void setTemporaryDirectory(const QString &temporaryDirectory)
{
QDir d(temporaryDirectory);
if (!d.exists(temporaryDirectory))
d.mkpath(temporaryDirectory);
if (d.exists(temporaryDirectory))
m_temporaryDirectory = temporaryDirectory;
else
m_temporaryDirectory.clear();
}
const QString &lastOpenedDirectory() const
{
return m_lastOpenedDirectory;
}
void setLastOpenedDirectory(const QString &lastOpenedDirectory)
{
m_lastOpenedDirectory = lastOpenedDirectory;
}
const QString &sourceDirectory() const
{
return m_sourceDirectory;
}
void setSourceDirectory(const QString &sourceDirectory)
{
QDir d(sourceDirectory);
if (!d.exists(sourceDirectory))
d.mkpath(sourceDirectory);
if (d.exists(sourceDirectory))
m_sourceDirectory = sourceDirectory;
else
m_sourceDirectory.clear();
}
bool inMemoryDatabase() const
{
return m_inMemoryDatabase;
}
void setInMemoryDatabase(bool inMemoryDatabase)
{
m_inMemoryDatabase = inMemoryDatabase;
}
void initialize();
const QString &everythingPath() const
{
return m_everythingPath;
}
void setEverythingPath(const QString &everythingPath)
{
m_everythingPath = everythingPath;
}
bool fatalEnabled() const
{
return m_fatalEnabled;
}
void setFatalEnabled(bool fatalEnabled)
{
m_fatalEnabled = fatalEnabled;
}
bool errorEnabled() const
{
return m_errorEnabled;
}
void setErrorEnabled(bool errorEnabled)
{
m_errorEnabled = errorEnabled;
}
bool warnEnabled() const
{
return m_warnEnabled;
}
void setWarnEnabled(bool warnEnabled)
{
m_warnEnabled = warnEnabled;
}
bool infoEnabled() const
{
return m_infoEnabled;
}
void setInfoEnabled(bool infoEnabled)
{
m_infoEnabled = infoEnabled;
}
bool debugEnabled() const
{
return m_debugEnabled;
}
void setDebugEnabled(bool debugEnabled)
{
m_debugEnabled = debugEnabled;
}
bool traceEnabled() const
{
return m_traceEnabled;
}
void setTraceEnabled(bool traceEnabled)
{
m_traceEnabled = traceEnabled;
}
bool allLogLevelEnabled() const
{
return m_fatalEnabled && m_errorEnabled && m_warnEnabled && m_infoEnabled && m_debugEnabled && m_traceEnabled;
}
bool multiMonitorEnabled() const
{
return m_multiMonitorEnabled;
}
void setMultiMonitorEnabled(bool multiMonitorEnabled)
{
m_multiMonitorEnabled = multiMonitorEnabled;
}
const QString &prtTrackingSystemToken() const;
void setPrtTrackingSystemToken(const QString &prtTrackingSystemToken);
const QString &cecId() const;
void setCecId(const QString &cecId);
const QString &cecPassword() const;
void setCecPassword(const QString &cecPassword);
const QString &windbgPath() const;
void setWindbgPath(const QString &windbgPath);
const QString &sourceViewFontFamily() const;
void setSourceViewFontFamily(const QString &sourceViewFontFamily);
const QString &sourceViewTheme() const;
void setSourceViewTheme(const QString &sourceViewTheme);
int logTableColumnVisible() const;
void setLogTableColumnVisible(int logTableColumnVisible);
QNetworkProxy::ProxyType proxyType() const;
void setProxyType(const QNetworkProxy::ProxyType &proxyType);
const QString &proxyHostName() const;
void setProxyHostName(const QString &proxyHostName);
int proxyPort() const;
void setProxyPort(int proxyPort);
bool ftsEnabled() const;
void setFtsEnabled(bool ftsEnabled);
private:
bool m_inMemoryDatabase {true};
bool m_searchOrFitler {false};
bool m_fatalEnabled {true};
bool m_errorEnabled {true};
bool m_warnEnabled {true};
bool m_infoEnabled {true};
bool m_debugEnabled {true};
bool m_traceEnabled {true};
bool m_multiMonitorEnabled {true};
bool m_ftsEnabled {true};
int m_logTableColumnVisible;
QNetworkProxy::ProxyType m_proxyType;
QString m_proxyHostName;
int m_proxyPort;
QString m_temporaryDirectory;
QString m_lastOpenedDirectory;
QString m_sourceDirectory;
QString m_everythingPath;
QString m_prtTrackingSystemToken;
QString m_cecId;
QString m_cecPassword;
QString m_windbgPath;
QString m_sourceViewFontFamily;
QString m_sourceViewTheme;
};
inline Settings *g_settings = nullptr;
#endif // SETTINGS_H