Skip to content

Commit 7157997

Browse files
authored
Enable TLS after activation dialog if available (symless#32)
1 parent 1ac2d40 commit 7157997

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/lib/synergy/gui/license/LicenseHandler.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ bool LicenseHandler::handleStart(QMainWindow *parent, AppConfig *appConfig) {
7777
if (m_license.isValid()) {
7878
qDebug("license is valid, continuing with start");
7979
updateWindowTitle();
80-
clampFeatures();
80+
clampFeatures(false);
8181
return true;
8282
}
8383

@@ -151,7 +151,7 @@ bool LicenseHandler::showActivationDialog() {
151151
if (result == QDialog::Accepted) {
152152
saveSettings();
153153
updateWindowTitle();
154-
clampFeatures();
154+
clampFeatures(true);
155155

156156
qDebug("license activation dialog accepted");
157157
return true;
@@ -299,8 +299,11 @@ void LicenseHandler::validate() {
299299
qDebug("license validation succeeded");
300300
}
301301

302-
void LicenseHandler::clampFeatures() {
303-
if (m_appConfig->tlsEnabled() && !m_license.isTlsAvailable()) {
302+
void LicenseHandler::clampFeatures(bool enableTlsIfAvailable) {
303+
if (enableTlsIfAvailable && m_license.isTlsAvailable()) {
304+
qDebug("tls available, enabling tls");
305+
m_appConfig->setTlsEnabled(true);
306+
} else if (m_appConfig->tlsEnabled() && !m_license.isTlsAvailable()) {
304307
qWarning("tls not available, disabling tls");
305308
m_appConfig->setTlsEnabled(false);
306309
}

src/lib/synergy/gui/license/LicenseHandler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class LicenseHandler : public QObject {
6363
QString productName() const;
6464
SetSerialKeyResult
6565
setLicense(const QString &hexString, bool allowExpired = false);
66-
void clampFeatures();
66+
void clampFeatures(bool enableTlsIfAvailable);
6767

6868
private:
6969
void checkTlsCheckBox(

0 commit comments

Comments
 (0)