2012-06-10 16:50:54 +00:00
|
|
|
/*
|
|
|
|
|
* synergy -- mouse and keyboard sharing utility
|
2016-09-07 14:24:00 +00:00
|
|
|
* Copyright (C) 2012-2016 Symless Ltd.
|
2012-06-10 16:50:54 +00:00
|
|
|
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
|
2016-10-18 17:45:15 +00:00
|
|
|
*
|
2012-06-10 16:50:54 +00:00
|
|
|
* This package is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
2015-05-03 02:33:52 +00:00
|
|
|
* found in the file LICENSE that should have accompanied this file.
|
2016-10-18 17:45:15 +00:00
|
|
|
*
|
2012-06-10 16:50:54 +00:00
|
|
|
* 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
|
|
|
|
|
|
2016-10-04 12:41:27 +00:00
|
|
|
#include <QObject>
|
2012-06-10 16:50:54 +00:00
|
|
|
#include <QString>
|
2016-06-10 14:33:30 +00:00
|
|
|
#include "ElevateMode.h"
|
2016-10-14 16:38:31 +00:00
|
|
|
#include <EditionType.h>
|
2013-04-11 16:51:17 +00:00
|
|
|
|
|
|
|
|
// 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
|
2013-05-29 20:46:24 +00:00
|
|
|
// will be displayed. each version incrememnt should be described
|
|
|
|
|
// here...
|
|
|
|
|
//
|
|
|
|
|
// 1: first version
|
2013-06-04 17:37:27 +00:00
|
|
|
// 2: added language page
|
2014-10-14 16:20:57 +00:00
|
|
|
// 3: added premium page and removed
|
2015-07-23 22:56:38 +00:00
|
|
|
// 4: ssl plugin 'ns' v1.0
|
|
|
|
|
// 5: ssl plugin 'ns' v1.1
|
|
|
|
|
// 6: ssl plugin 'ns' v1.2
|
2016-07-20 17:09:39 +00:00
|
|
|
// 7: serial key activation
|
2016-06-24 17:27:03 +00:00
|
|
|
// 8: Visual Studio 2015 support
|
2013-05-29 20:46:24 +00:00
|
|
|
//
|
2016-06-24 17:27:03 +00:00
|
|
|
const int kWizardVersion = 8;
|
2012-06-10 16:50:54 +00:00
|
|
|
|
|
|
|
|
class QSettings;
|
|
|
|
|
class SettingsDialog;
|
|
|
|
|
|
|
|
|
|
enum ProcessMode {
|
|
|
|
|
Service,
|
|
|
|
|
Desktop
|
|
|
|
|
};
|
|
|
|
|
|
2016-10-04 12:41:27 +00:00
|
|
|
class AppConfig: public QObject
|
2012-06-10 16:50:54 +00:00
|
|
|
{
|
2016-10-04 12:41:27 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
2012-06-10 16:50:54 +00:00
|
|
|
friend class SettingsDialog;
|
|
|
|
|
friend class MainWindow;
|
|
|
|
|
friend class SetupWizard;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
AppConfig(QSettings* settings);
|
|
|
|
|
~AppConfig();
|
|
|
|
|
|
|
|
|
|
public:
|
2016-09-30 14:03:49 +00:00
|
|
|
const QString& screenName() const;
|
|
|
|
|
int port() const;
|
2016-10-12 09:41:44 +00:00
|
|
|
const QString& networkInterface() const;
|
2016-09-30 14:03:49 +00:00
|
|
|
int logLevel() const;
|
|
|
|
|
bool logToFile() const;
|
|
|
|
|
const QString& logFilename() const;
|
2014-06-18 12:59:30 +00:00
|
|
|
const QString logFilenameCmd() const;
|
2012-06-10 16:50:54 +00:00
|
|
|
QString logLevelText() const;
|
2016-09-30 14:03:49 +00:00
|
|
|
ProcessMode processMode() const;
|
|
|
|
|
bool wizardShouldRun() const;
|
|
|
|
|
const QString& language() const;
|
|
|
|
|
bool startedBefore() const;
|
|
|
|
|
bool autoConfig() const;
|
2014-11-28 10:51:52 +00:00
|
|
|
void setAutoConfig(bool autoConfig);
|
2016-09-30 14:03:49 +00:00
|
|
|
bool autoConfigPrompted();
|
2014-11-28 10:51:52 +00:00
|
|
|
void setAutoConfigPrompted(bool prompted);
|
2016-10-14 16:38:31 +00:00
|
|
|
void setEdition(Edition);
|
|
|
|
|
Edition edition() const;
|
2016-10-14 10:28:37 +00:00
|
|
|
QString setSerialKey(QString serial);
|
2016-09-30 14:03:49 +00:00
|
|
|
void clearSerialKey();
|
|
|
|
|
QString serialKey();
|
|
|
|
|
int lastExpiringWarningTime() const;
|
|
|
|
|
void setLastExpiringWarningTime(int t);
|
|
|
|
|
|
|
|
|
|
QString synergysName() const;
|
|
|
|
|
QString synergycName() const;
|
2012-06-10 16:50:54 +00:00
|
|
|
QString synergyProgramDir() const;
|
|
|
|
|
QString synergyLogDir() const;
|
|
|
|
|
|
|
|
|
|
bool detectPath(const QString& name, QString& path);
|
|
|
|
|
void persistLogDir();
|
2016-06-07 16:20:22 +00:00
|
|
|
ElevateMode elevateMode();
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2016-09-30 14:03:49 +00:00
|
|
|
void setCryptoEnabled(bool e);
|
2016-09-30 16:01:43 +00:00
|
|
|
bool getCryptoEnabled() const;
|
2016-10-06 10:29:34 +00:00
|
|
|
|
2016-09-30 14:03:49 +00:00
|
|
|
void setAutoHide(bool b);
|
|
|
|
|
bool getAutoHide();
|
2015-02-12 15:50:08 +00:00
|
|
|
|
2016-09-30 15:04:49 +00:00
|
|
|
bool activationHasRun() const;
|
|
|
|
|
AppConfig& activationHasRun(bool value);
|
2015-02-12 15:50:08 +00:00
|
|
|
|
2016-10-26 14:57:38 +00:00
|
|
|
QString lastVersion() const;
|
|
|
|
|
|
2015-11-18 23:03:06 +00:00
|
|
|
void saveSettings();
|
2016-10-26 14:57:38 +00:00
|
|
|
void setLastVersion(QString version);
|
2015-11-18 23:03:06 +00:00
|
|
|
|
2016-10-18 17:45:15 +00:00
|
|
|
protected:
|
2016-09-30 14:03:49 +00:00
|
|
|
QSettings& settings();
|
|
|
|
|
void setScreenName(const QString& s);
|
|
|
|
|
void setPort(int i);
|
2016-10-12 09:41:44 +00:00
|
|
|
void setNetworkInterface(const QString& s);
|
2016-09-30 14:03:49 +00:00
|
|
|
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);
|
2012-06-10 16:50:54 +00:00
|
|
|
void loadSettings();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
QSettings* m_pSettings;
|
|
|
|
|
QString m_ScreenName;
|
|
|
|
|
int m_Port;
|
|
|
|
|
QString m_Interface;
|
|
|
|
|
int m_LogLevel;
|
|
|
|
|
bool m_LogToFile;
|
|
|
|
|
QString m_LogFilename;
|
2013-04-11 16:51:17 +00:00
|
|
|
int m_WizardLastRun;
|
2012-06-10 16:50:54 +00:00
|
|
|
ProcessMode m_ProcessMode;
|
2013-05-29 20:46:24 +00:00
|
|
|
QString m_Language;
|
2014-03-21 09:22:18 +00:00
|
|
|
bool m_StartedBefore;
|
2014-11-28 10:51:52 +00:00
|
|
|
bool m_AutoConfig;
|
2016-06-07 16:20:22 +00:00
|
|
|
ElevateMode m_ElevateMode;
|
2014-11-28 10:51:52 +00:00
|
|
|
bool m_AutoConfigPrompted;
|
2016-10-14 16:38:31 +00:00
|
|
|
Edition m_Edition;
|
2015-02-05 14:17:34 +00:00
|
|
|
QString m_ActivateEmail;
|
2015-02-12 15:50:08 +00:00
|
|
|
bool m_CryptoEnabled;
|
2015-04-23 14:37:07 +00:00
|
|
|
bool m_AutoHide;
|
2015-10-22 23:31:46 +00:00
|
|
|
QString m_Serialkey;
|
2016-10-26 14:57:38 +00:00
|
|
|
QString m_lastVersion;
|
2015-11-17 22:51:04 +00:00
|
|
|
int m_LastExpiringWarningTime;
|
2016-09-30 15:04:49 +00:00
|
|
|
bool m_ActivationHasRun;
|
2012-06-10 16:50:54 +00:00
|
|
|
|
|
|
|
|
static const char m_SynergysName[];
|
|
|
|
|
static const char m_SynergycName[];
|
|
|
|
|
static const char m_SynergyLogDir[];
|
2016-10-04 12:41:27 +00:00
|
|
|
|
|
|
|
|
signals:
|
2016-10-06 10:29:34 +00:00
|
|
|
void sslToggled(bool enabled);
|
2012-06-10 16:50:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|