diff --git a/src/gui/src/SettingsDialog.cpp b/src/gui/src/SettingsDialog.cpp index bcaa2263..dbd3ef27 100644 --- a/src/gui/src/SettingsDialog.cpp +++ b/src/gui/src/SettingsDialog.cpp @@ -37,7 +37,8 @@ SettingsDialog::SettingsDialog(QWidget* parent, AppConfig& config) : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint), Ui::SettingsDialogBase(), m_AppConfig(config), - m_SuppressElevateWarning(false) + m_SuppressElevateWarning(false), + m_SuppressEncryptionWarning(false) { setupUi(this); @@ -68,7 +69,9 @@ SettingsDialog::SettingsDialog(QWidget* parent, AppConfig& config) : m_pCheckBoxEnableCrypto->setChecked(false); } else { + m_SuppressEncryptionWarning = true; m_pCheckBoxEnableCrypto->setChecked(m_AppConfig.getCryptoEnabled()); + m_SuppressEncryptionWarning = false; } } @@ -83,6 +86,7 @@ void SettingsDialog::accept() appConfig().setLanguage(m_pComboLanguage->itemData(m_pComboLanguage->currentIndex()).toString()); appConfig().setElevateMode(m_pCheckBoxElevateMode->isChecked()); appConfig().setAutoHide(m_pCheckBoxAutoHide->isChecked()); + appConfig().setCryptoEnabled(m_pCheckBoxEnableCrypto->isChecked()); appConfig().saveSettings(); QDialog::accept(); } @@ -164,5 +168,17 @@ void SettingsDialog::on_m_pCheckBoxElevateMode_toggled(bool checked) void SettingsDialog::on_m_pCheckBoxEnableCrypto_toggled(bool checked) { - m_AppConfig.setCryptoEnabled(checked); + if (checked && !m_SuppressEncryptionWarning) { + int r = QMessageBox::warning( + this, tr("Synergy SSL Encryption"), + tr("Are you sure you want to enable SSL encryption?\n\n" + "This allows Synergy to establish a secure connection, " + "but can slow down the data transfer of clipboard and file."), + QMessageBox::Yes | QMessageBox::No); + + if (r != QMessageBox::Yes) { + m_pCheckBoxEnableCrypto->setChecked(false); + return; + } + } } diff --git a/src/gui/src/SettingsDialog.h b/src/gui/src/SettingsDialog.h index 8ab2e1e0..dc0d1bb2 100644 --- a/src/gui/src/SettingsDialog.h +++ b/src/gui/src/SettingsDialog.h @@ -47,6 +47,7 @@ class SettingsDialog : public QDialog, public Ui::SettingsDialogBase SynergyLocale m_Locale; CoreInterface m_CoreInterface; bool m_SuppressElevateWarning; + bool m_SuppressEncryptionWarning; private slots: void on_m_pCheckBoxEnableCrypto_toggled(bool checked);