Introduced new env vars for testing (#7436)
* New env vars for testing * Update ChangeLog
This commit is contained in:
parent
b7d64f962e
commit
30ea95fb3d
13 changed files with 133 additions and 46 deletions
|
|
@ -24,6 +24,12 @@
|
||||||
# Reset all settings and delete all data on startup
|
# Reset all settings and delete all data on startup
|
||||||
# SYNERGY_RESET_ALL=true
|
# SYNERGY_RESET_ALL=true
|
||||||
|
|
||||||
|
# Enable the activation dialog (used for testing)
|
||||||
|
# SYNERGY_ENABLE_ACTIVATION=true
|
||||||
|
|
||||||
|
# Show licensed product menu items, etc (used for testing)
|
||||||
|
# SYNERGY_LICENSED_PRODUCT=true
|
||||||
|
|
||||||
#
|
#
|
||||||
# Build
|
# Build
|
||||||
#
|
#
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,7 @@ Enhancements:
|
||||||
- #7432 Only show close to tray reminder when not quitting the app
|
- #7432 Only show close to tray reminder when not quitting the app
|
||||||
- #7434 Show dark logo in dark mode and improve .env loader
|
- #7434 Show dark logo in dark mode and improve .env loader
|
||||||
- #7435 Add reset settings menu action and env var
|
- #7435 Add reset settings menu action and env var
|
||||||
|
- #7436 Introduced new env vars for testing
|
||||||
|
|
||||||
# 1.14.6
|
# 1.14.6
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@
|
||||||
#include "gui/diagnostic.h"
|
#include "gui/diagnostic.h"
|
||||||
#include "gui/dialogs/SettingsDialog.h"
|
#include "gui/dialogs/SettingsDialog.h"
|
||||||
#include "gui/license/LicenseHandler.h"
|
#include "gui/license/LicenseHandler.h"
|
||||||
|
#include "gui/license/license_config.h"
|
||||||
#include "gui/license/license_notices.h"
|
#include "gui/license/license_notices.h"
|
||||||
#include "gui/messages.h"
|
#include "gui/messages.h"
|
||||||
#include "gui/string_utils.h"
|
#include "gui/string_utils.h"
|
||||||
|
|
@ -62,6 +63,7 @@
|
||||||
|
|
||||||
using namespace synergy::gui;
|
using namespace synergy::gui;
|
||||||
using namespace synergy::license;
|
using namespace synergy::license;
|
||||||
|
using namespace synergy::gui::license;
|
||||||
|
|
||||||
using CoreMode = CoreProcess::Mode;
|
using CoreMode = CoreProcess::Mode;
|
||||||
using CoreConnectionState = CoreProcess::ConnectionState;
|
using CoreConnectionState = CoreProcess::ConnectionState;
|
||||||
|
|
@ -134,14 +136,14 @@ void MainWindow::saveWindow() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::setupControls() {
|
void MainWindow::setupControls() {
|
||||||
if (!kEnableActivation) {
|
if (!isActivationEnabled()) {
|
||||||
updateWindowTitle();
|
updateWindowTitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!kLicensedProduct) {
|
if (!isLicensedProduct()) {
|
||||||
m_pActionHelp->setText("Report a bug");
|
m_pActionHelp->setText("Report a bug");
|
||||||
m_pActionActivate->setText("Purchase");
|
m_pActionActivate->setText("Purchase");
|
||||||
} else if (!kEnableActivation) {
|
} else if (!isActivationEnabled()) {
|
||||||
m_pActionActivate->setVisible(false);
|
m_pActionActivate->setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -287,7 +289,7 @@ void MainWindow::onCreated() {
|
||||||
|
|
||||||
applyCloseToTray();
|
applyCloseToTray();
|
||||||
|
|
||||||
if (kEnableActivation && !m_AppConfig.serialKey().isEmpty()) {
|
if (isActivationEnabled() && !m_AppConfig.serialKey().isEmpty()) {
|
||||||
m_LicenseHandler.changeSerialKey(m_AppConfig.serialKey());
|
m_LicenseHandler.changeSerialKey(m_AppConfig.serialKey());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -300,7 +302,7 @@ void MainWindow::onCreated() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onShown() {
|
void MainWindow::onShown() {
|
||||||
if (kEnableActivation) {
|
if (isActivationEnabled()) {
|
||||||
const auto &license = m_LicenseHandler.license();
|
const auto &license = m_LicenseHandler.license();
|
||||||
if (!m_AppConfig.activationHasRun() || !license.isValid() ||
|
if (!m_AppConfig.activationHasRun() || !license.isValid() ||
|
||||||
license.isExpired()) {
|
license.isExpired()) {
|
||||||
|
|
@ -435,7 +437,7 @@ void MainWindow::on_m_pActionAbout_triggered() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_m_pActionHelp_triggered() const {
|
void MainWindow::on_m_pActionHelp_triggered() const {
|
||||||
if (kLicensedProduct) {
|
if (isLicensedProduct()) {
|
||||||
QDesktopServices::openUrl(QUrl(kUrlHelp));
|
QDesktopServices::openUrl(QUrl(kUrlHelp));
|
||||||
} else {
|
} else {
|
||||||
QDesktopServices::openUrl(QUrl(kUrlBugReport));
|
QDesktopServices::openUrl(QUrl(kUrlBugReport));
|
||||||
|
|
@ -464,7 +466,7 @@ void MainWindow::on_m_pButtonConfigureServer_clicked() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_m_pActionActivate_triggered() {
|
void MainWindow::on_m_pActionActivate_triggered() {
|
||||||
if (kLicensedProduct) {
|
if (isLicensedProduct()) {
|
||||||
showActivationDialog();
|
showActivationDialog();
|
||||||
} else {
|
} else {
|
||||||
QDesktopServices::openUrl(QUrl(kUrlPurchase));
|
QDesktopServices::openUrl(QUrl(kUrlPurchase));
|
||||||
|
|
@ -573,7 +575,7 @@ void MainWindow::open() {
|
||||||
|
|
||||||
void MainWindow::onCoreProcessStarting() {
|
void MainWindow::onCoreProcessStarting() {
|
||||||
|
|
||||||
if (kEnableActivation) {
|
if (isActivationEnabled()) {
|
||||||
const auto &license = m_LicenseHandler.license();
|
const auto &license = m_LicenseHandler.license();
|
||||||
if (license.isExpired() && showActivationDialog() == QDialog::Rejected) {
|
if (license.isExpired() && showActivationDialog() == QDialog::Rejected) {
|
||||||
qDebug("license expired, cancelling core start");
|
qDebug("license expired, cancelling core start");
|
||||||
|
|
@ -704,7 +706,7 @@ void MainWindow::updateFromLogLine(const QString &line) {
|
||||||
checkConnected(line);
|
checkConnected(line);
|
||||||
checkFingerprint(line);
|
checkFingerprint(line);
|
||||||
|
|
||||||
if (kEnableActivation) {
|
if (isActivationEnabled()) {
|
||||||
checkLicense(line);
|
checkLicense(line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -816,7 +818,7 @@ void MainWindow::showDevThanksMessage() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kEnableActivation) {
|
if (isActivationEnabled()) {
|
||||||
qDebug("activation enabled, skipping dev thanks message");
|
qDebug("activation enabled, skipping dev thanks message");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -1014,7 +1016,7 @@ void MainWindow::updateLocalFingerprint() {
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MainWindow::productName() const {
|
QString MainWindow::productName() const {
|
||||||
if (kEnableActivation) {
|
if (isActivationEnabled()) {
|
||||||
return m_LicenseHandler.productName();
|
return m_LicenseHandler.productName();
|
||||||
} else if (!kProductName.isEmpty()) {
|
} else if (!kProductName.isEmpty()) {
|
||||||
return kProductName;
|
return kProductName;
|
||||||
|
|
@ -1061,7 +1063,7 @@ void MainWindow::showConfigureServer(const QString &message) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int MainWindow::showActivationDialog() {
|
int MainWindow::showActivationDialog() {
|
||||||
if (!kEnableActivation) {
|
if (!isActivationEnabled()) {
|
||||||
qFatal("cannot show activation dialog when activation is disabled");
|
qFatal("cannot show activation dialog when activation is disabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,19 +53,4 @@ const QString kProductName = SYNERGY_PRODUCT_NAME;
|
||||||
const QString kProductName;
|
const QString kProductName;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SYNERGY_LICENSED_PRODUCT
|
|
||||||
const bool kLicensedProduct = true;
|
|
||||||
#else
|
|
||||||
const bool kLicensedProduct = false;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef SYNERGY_ENABLE_ACTIVATION
|
|
||||||
#ifndef SYNERGY_LICENSED_PRODUCT
|
|
||||||
#error "activation requires licensed product"
|
|
||||||
#endif
|
|
||||||
const bool kEnableActivation = true;
|
|
||||||
#else
|
|
||||||
const bool kEnableActivation = false;
|
|
||||||
#endif // SYNERGY_ENABLE_ACTIVATION
|
|
||||||
|
|
||||||
} // namespace synergy::gui
|
} // namespace synergy::gui
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,9 @@
|
||||||
|
|
||||||
#include "CoreProcess.h"
|
#include "CoreProcess.h"
|
||||||
|
|
||||||
#include "constants.h"
|
|
||||||
#include "gui/config/IAppConfig.h"
|
#include "gui/config/IAppConfig.h"
|
||||||
#include "gui/core/CoreTool.h"
|
#include "gui/core/CoreTool.h"
|
||||||
|
#include "gui/license/license_config.h"
|
||||||
#include "gui/paths.h"
|
#include "gui/paths.h"
|
||||||
#include "tls/TlsUtility.h"
|
#include "tls/TlsUtility.h"
|
||||||
|
|
||||||
|
|
@ -36,6 +36,9 @@
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
|
using namespace synergy::license;
|
||||||
|
using namespace synergy::gui::license;
|
||||||
|
|
||||||
namespace synergy::gui {
|
namespace synergy::gui {
|
||||||
|
|
||||||
const int kRetryDelay = 1000;
|
const int kRetryDelay = 1000;
|
||||||
|
|
@ -136,8 +139,8 @@ QString CoreProcess::Deps::getProfileRoot() const {
|
||||||
//
|
//
|
||||||
|
|
||||||
CoreProcess::CoreProcess(
|
CoreProcess::CoreProcess(
|
||||||
IAppConfig &appConfig, IServerConfig &serverConfig,
|
IAppConfig &appConfig, IServerConfig &serverConfig, const ILicense &license,
|
||||||
const license::ILicense &license, std::shared_ptr<Deps> deps)
|
std::shared_ptr<Deps> deps)
|
||||||
: m_appConfig(appConfig),
|
: m_appConfig(appConfig),
|
||||||
m_serverConfig(serverConfig),
|
m_serverConfig(serverConfig),
|
||||||
m_license(license),
|
m_license(license),
|
||||||
|
|
@ -534,7 +537,7 @@ bool CoreProcess::addServerArgs(QStringList &args, QString &app) {
|
||||||
args << "-c" << configFilename;
|
args << "-c" << configFilename;
|
||||||
qInfo("core config file: %s", qPrintable(configFilename));
|
qInfo("core config file: %s", qPrintable(configFilename));
|
||||||
|
|
||||||
if (kEnableActivation && !m_appConfig.serialKey().isEmpty()) {
|
if (isActivationEnabled() && !m_appConfig.serialKey().isEmpty()) {
|
||||||
args << "--serial-key" << m_appConfig.serialKey();
|
args << "--serial-key" << m_appConfig.serialKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
#include "gui/config/IServerConfig.h"
|
#include "gui/config/IServerConfig.h"
|
||||||
#include "gui/ipc/QIpcClient.h"
|
#include "gui/ipc/QIpcClient.h"
|
||||||
#include "gui/proxy/QProcessProxy.h"
|
#include "gui/proxy/QProcessProxy.h"
|
||||||
#include "license/License.h"
|
#include "license/ILicense.h"
|
||||||
|
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
@ -35,6 +35,7 @@ class CoreProcess : public QObject {
|
||||||
using IServerConfig = synergy::gui::IServerConfig;
|
using IServerConfig = synergy::gui::IServerConfig;
|
||||||
using QProcessProxy = synergy::gui::proxy::QProcessProxy;
|
using QProcessProxy = synergy::gui::proxy::QProcessProxy;
|
||||||
using IQIpcClient = synergy::gui::ipc::IQIpcClient;
|
using IQIpcClient = synergy::gui::ipc::IQIpcClient;
|
||||||
|
using ILicense = synergy::license::ILicense;
|
||||||
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
|
@ -59,7 +60,7 @@ public:
|
||||||
|
|
||||||
explicit CoreProcess(
|
explicit CoreProcess(
|
||||||
IAppConfig &appConfig, IServerConfig &serverConfig,
|
IAppConfig &appConfig, IServerConfig &serverConfig,
|
||||||
const license::ILicense &license,
|
const ILicense &license,
|
||||||
std::shared_ptr<Deps> deps = std::make_shared<Deps>());
|
std::shared_ptr<Deps> deps = std::make_shared<Deps>());
|
||||||
|
|
||||||
void extracted(QString &app, QStringList &args);
|
void extracted(QString &app, QStringList &args);
|
||||||
|
|
@ -120,7 +121,7 @@ private:
|
||||||
|
|
||||||
IAppConfig &m_appConfig;
|
IAppConfig &m_appConfig;
|
||||||
IServerConfig &m_serverConfig;
|
IServerConfig &m_serverConfig;
|
||||||
const license::ILicense &m_license;
|
const ILicense &m_license;
|
||||||
std::shared_ptr<Deps> m_pDeps;
|
std::shared_ptr<Deps> m_pDeps;
|
||||||
QString m_address;
|
QString m_address;
|
||||||
ProcessState m_processState = ProcessState::Stopped;
|
ProcessState m_processState = ProcessState::Stopped;
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@
|
||||||
#include "SettingsDialog.h"
|
#include "SettingsDialog.h"
|
||||||
|
|
||||||
#include "UpgradeDialog.h"
|
#include "UpgradeDialog.h"
|
||||||
#include "gui/constants.h"
|
|
||||||
#include "gui/core/CoreProcess.h"
|
#include "gui/core/CoreProcess.h"
|
||||||
|
#include "gui/license/license_config.h"
|
||||||
#include "gui/tls/TlsCertificate.h"
|
#include "gui/tls/TlsCertificate.h"
|
||||||
#include "gui/tls/TlsUtility.h"
|
#include "gui/tls/TlsUtility.h"
|
||||||
#include "gui/validators/ScreenNameValidator.h"
|
#include "gui/validators/ScreenNameValidator.h"
|
||||||
|
|
@ -88,7 +88,7 @@ void SettingsDialog::on_m_pButtonBrowseLog_clicked() {
|
||||||
void SettingsDialog::on_m_pCheckBoxEnableTls_clicked(bool) {
|
void SettingsDialog::on_m_pCheckBoxEnableTls_clicked(bool) {
|
||||||
updateTlsControlsEnabled();
|
updateTlsControlsEnabled();
|
||||||
|
|
||||||
if (kEnableActivation && !m_tlsUtility.isAvailable()) {
|
if (license::isActivationEnabled() && !m_tlsUtility.isAvailable()) {
|
||||||
m_pCheckBoxEnableTls->setChecked(false);
|
m_pCheckBoxEnableTls->setChecked(false);
|
||||||
updateTlsControlsEnabled();
|
updateTlsControlsEnabled();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "gui/constants.h"
|
#include "gui/constants.h"
|
||||||
|
#include "gui/license/license_config.h"
|
||||||
#include "license/License.h"
|
#include "license/License.h"
|
||||||
#include "license/ProductEdition.h"
|
#include "license/ProductEdition.h"
|
||||||
|
|
||||||
|
|
@ -52,6 +53,6 @@ signals:
|
||||||
void invalidLicense() const;
|
void invalidLicense() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_enabled = synergy::gui::kEnableActivation;
|
bool m_enabled = synergy::gui::license::isActivationEnabled();
|
||||||
License m_license = License::invalid();
|
License m_license = License::invalid();
|
||||||
};
|
};
|
||||||
|
|
|
||||||
58
src/lib/gui/license/license_config.cpp
Normal file
58
src/lib/gui/license/license_config.cpp
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
/*
|
||||||
|
* synergy -- mouse and keyboard sharing utility
|
||||||
|
* Copyright (C) 2024 Synergy Ltd.
|
||||||
|
*
|
||||||
|
* 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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "license_config.h"
|
||||||
|
|
||||||
|
#include "string_utils.h"
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
#include <QtGlobal>
|
||||||
|
|
||||||
|
namespace synergy::gui::license {
|
||||||
|
|
||||||
|
#ifdef SYNERGY_LICENSED_PRODUCT
|
||||||
|
const bool kLicensedProduct = true;
|
||||||
|
#else
|
||||||
|
const bool kLicensedProduct = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef SYNERGY_ENABLE_ACTIVATION
|
||||||
|
#ifndef SYNERGY_LICENSED_PRODUCT
|
||||||
|
#error "activation requires licensed product"
|
||||||
|
#endif
|
||||||
|
const bool kEnableActivation = true;
|
||||||
|
#else
|
||||||
|
const bool kEnableActivation = false;
|
||||||
|
#endif // SYNERGY_ENABLE_ACTIVATION
|
||||||
|
|
||||||
|
bool isLicensedProduct() {
|
||||||
|
if (strToTrue(qEnvironmentVariable("SYNERGY_LICENSED_PRODUCT"))) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return kLicensedProduct;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isActivationEnabled() {
|
||||||
|
if (strToTrue(qEnvironmentVariable("SYNERGY_ENABLE_ACTIVATION"))) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return kEnableActivation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace synergy::gui::license
|
||||||
25
src/lib/gui/license/license_config.h
Normal file
25
src/lib/gui/license/license_config.h
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
* synergy -- mouse and keyboard sharing utility
|
||||||
|
* Copyright (C) 2024 Synergy Ltd.
|
||||||
|
*
|
||||||
|
* 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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace synergy::gui::license {
|
||||||
|
|
||||||
|
bool isLicensedProduct();
|
||||||
|
bool isActivationEnabled();
|
||||||
|
|
||||||
|
} // namespace synergy::gui::license
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
#include "Logger.h"
|
#include "Logger.h"
|
||||||
#include "common/version.h"
|
#include "common/version.h"
|
||||||
#include "constants.h"
|
#include "constants.h"
|
||||||
|
#include "gui/license/license_config.h"
|
||||||
#include "styles.h"
|
#include "styles.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
|
@ -30,6 +31,8 @@
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
using namespace synergy::gui::license;
|
||||||
|
|
||||||
namespace synergy::gui::messages {
|
namespace synergy::gui::messages {
|
||||||
|
|
||||||
struct Errors {
|
struct Errors {
|
||||||
|
|
@ -60,7 +63,7 @@ void showErrorDialog(
|
||||||
text = "<p>Sorry, a critical error has occurred.</p>";
|
text = "<p>Sorry, a critical error has occurred.</p>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kLicensedProduct) {
|
if (isLicensedProduct()) {
|
||||||
text += QString(R"(<p>Please <a href="%1" style="color: %2">contact us</a>)"
|
text += QString(R"(<p>Please <a href="%1" style="color: %2">contact us</a>)"
|
||||||
" and copy/paste the following error:</p>")
|
" and copy/paste the following error:</p>")
|
||||||
.arg(kUrlContact, kColorSecondary);
|
.arg(kUrlContact, kColorSecondary);
|
||||||
|
|
|
||||||
|
|
@ -18,20 +18,22 @@
|
||||||
#include "TlsUtility.h"
|
#include "TlsUtility.h"
|
||||||
|
|
||||||
#include "TlsCertificate.h"
|
#include "TlsCertificate.h"
|
||||||
#include "constants.h"
|
#include "gui/license/license_config.h"
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
|
using namespace synergy::license;
|
||||||
|
using namespace synergy::gui::license;
|
||||||
|
|
||||||
namespace synergy::gui {
|
namespace synergy::gui {
|
||||||
|
|
||||||
TlsUtility::TlsUtility(
|
TlsUtility::TlsUtility(const IAppConfig &appConfig, const ILicense &license)
|
||||||
const IAppConfig &appConfig, const license::ILicense &license)
|
|
||||||
: m_appConfig(appConfig),
|
: m_appConfig(appConfig),
|
||||||
m_license(license) {}
|
m_license(license) {}
|
||||||
|
|
||||||
bool TlsUtility::isAvailable() const {
|
bool TlsUtility::isAvailable() const {
|
||||||
return !kEnableActivation || m_license.isTlsAvailable();
|
return !isActivationEnabled() || m_license.isTlsAvailable();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TlsUtility::isAvailableAndEnabled() const {
|
bool TlsUtility::isAvailableAndEnabled() const {
|
||||||
|
|
|
||||||
|
|
@ -20,18 +20,18 @@
|
||||||
#include "gui/config/IAppConfig.h"
|
#include "gui/config/IAppConfig.h"
|
||||||
|
|
||||||
#include "TlsCertificate.h"
|
#include "TlsCertificate.h"
|
||||||
#include "license/License.h"
|
#include "license/ILicense.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
namespace synergy::gui {
|
namespace synergy::gui {
|
||||||
|
|
||||||
class TlsUtility : public QObject {
|
class TlsUtility : public QObject {
|
||||||
|
using ILicense = synergy::license::ILicense;
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit TlsUtility(
|
explicit TlsUtility(const IAppConfig &appConfig, const ILicense &license);
|
||||||
const IAppConfig &appConfig, const license::ILicense &license);
|
|
||||||
|
|
||||||
bool generateCertificate();
|
bool generateCertificate();
|
||||||
bool persistCertificate();
|
bool persistCertificate();
|
||||||
|
|
@ -52,7 +52,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const IAppConfig &m_appConfig;
|
const IAppConfig &m_appConfig;
|
||||||
const license::ILicense &m_license;
|
const ILicense &m_license;
|
||||||
TlsCertificate m_certificate;
|
TlsCertificate m_certificate;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue