blob: c9ed38de80ee42757353e8237e4dfdb3aeb135f8 (
plain) (
blame)
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
|
/*
* barrier -- mouse and keyboard sharing utility
* Copyright (C) 2012-2016 Symless Ltd.
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
* This package is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* found in the file LICENSE that should have accompanied this file.
*
* This package is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined(APPCONFIG_H)
#define APPCONFIG_H
#include <QObject>
#include <QString>
#include "ElevateMode.h"
// this should be incremented each time a new page is added. this is
// saved to settings when the user finishes running the wizard. if
// the saved wizard version is lower than this number, the wizard
// will be displayed. each version incrememnt should be described
// here...
//
// 1: first version
// 2: added language page
// 3: added premium page and removed
// 4: ssl plugin 'ns' v1.0
// 5: ssl plugin 'ns' v1.1
// 6: ssl plugin 'ns' v1.2
// 7: serial key activation
// 8: Visual Studio 2015 support
// 9: synergy->barrier and de-commercialized
//
const int kWizardVersion = 9;
class QSettings;
class SettingsDialog;
enum ProcessMode {
Service,
Desktop
};
class AppConfig: public QObject
{
Q_OBJECT
friend class SettingsDialog;
friend class MainWindow;
friend class SetupWizard;
public:
AppConfig(QSettings* settings);
~AppConfig();
public:
const QString& screenName() const;
int port() const;
const QString& networkInterface() const;
int logLevel() const;
bool logToFile() const;
const QString& logFilename() const;
const QString logFilenameCmd() const;
QString logLevelText() const;
ProcessMode processMode() const;
bool wizardShouldRun() const;
const QString& language() const;
bool startedBefore() const;
bool autoConfig() const;
void setAutoConfig(bool autoConfig);
bool autoConfigPrompted();
void setAutoConfigPrompted(bool prompted);
QString barriersName() const;
QString barriercName() const;
QString barrierProgramDir() const;
QString barrierLogDir() const;
void persistLogDir();
ElevateMode elevateMode();
void setCryptoEnabled(bool e);
bool getCryptoEnabled() const;
void setAutoHide(bool b);
bool getAutoHide();
void setMinimizeToTray(bool b);
bool getMinimizeToTray();
void saveSettings();
protected:
QSettings& settings();
void setScreenName(const QString& s);
void setPort(int i);
void setNetworkInterface(const QString& s);
void setLogLevel(int i);
void setLogToFile(bool b);
void setLogFilename(const QString& s);
void setWizardHasRun();
void setLanguage(const QString language);
void setStartedBefore(bool b);
void setElevateMode(ElevateMode em);
void loadSettings();
private:
QSettings* m_pSettings;
QString m_ScreenName;
int m_Port;
QString m_Interface;
int m_LogLevel;
bool m_LogToFile;
QString m_LogFilename;
int m_WizardLastRun;
ProcessMode m_ProcessMode;
QString m_Language;
bool m_StartedBefore;
bool m_AutoConfig;
ElevateMode m_ElevateMode;
bool m_AutoConfigPrompted;
bool m_CryptoEnabled;
bool m_AutoHide;
bool m_MinimizeToTray;
static const char m_BarriersName[];
static const char m_BarriercName[];
static const char m_BarrierLogDir[];
};
#endif
|