Merge pull request #6993 from symless/SYNERGY-936-Fix-preferences-UI

SYNERGY-936 fix preferences UI
This commit is contained in:
Andrey Batyiev 2021-05-13 04:35:11 +03:00 committed by GitHub
commit 350e2e247b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 690 additions and 535 deletions

View File

@ -11,7 +11,9 @@ Bug fixes:
- #6976 Fix windows builds
- #6979 Manual config error in client mode
- #6983 Fix that mac client listens on ipv4 only
- #6993 Fix issues with prefences UI
- #6992 UI issues and use cases
=======
Enhancements:
- #6954 Move language selection to advanced section

View File

@ -850,10 +850,10 @@ top: 3px;</string>
</action>
<action name="m_pActionSettings">
<property name="text">
<string>Settings</string>
<string>Preferences</string>
</property>
<property name="statusTip">
<string>Edit settings</string>
<property name="toolTip">
<string>Preferences</string>
</property>
<property name="shortcut">
<string notr="true"/>

View File

@ -66,7 +66,7 @@ SettingsDialog::SettingsDialog(QWidget* parent, AppConfig& config) :
connect(m_pLineEditScreenName, SIGNAL(textEdited(QString)), this, SLOT(onChange()));
connect(m_pComboElevate, SIGNAL(currentIndexChanged(int)), this, SLOT(onChange()));
resize(400, 620);
adjustSize();
}
void SettingsDialog::accept()
@ -177,16 +177,6 @@ void SettingsDialog::loadFromConfig() {
m_pCheckBoxEnableCrypto->setChecked(m_appConfig.getCryptoEnabled());
#ifdef SYNERGY_ENTERPRISE
m_pCheckBoxEnableCrypto->setEnabled(true);
#else
m_pCheckBoxEnableCrypto->setEnabled(m_appConfig.isCryptoAvailable());
#endif
#if !defined(SYNERGY_ENTERPRISE) && defined(SYNERGY_AUTOCONFIG)
m_pCheckBoxAutoConfig->setChecked(appConfig().autoConfig());
#else
@ -194,7 +184,6 @@ void SettingsDialog::loadFromConfig() {
m_pLabelInstallBonjour->hide();
#endif
adjustSize();
}
void SettingsDialog::allowAutoConfig()
@ -234,16 +223,33 @@ void SettingsDialog::on_m_pComboLanguage_currentIndexChanged(int index)
buttonBox->button(QDialogButtonBox::Save)->setEnabled(isModified());
}
void SettingsDialog::on_m_pCheckBoxEnableCrypto_toggled(bool checked)
void SettingsDialog::on_m_pCheckBoxEnableCrypto_clicked(bool checked)
{
m_pLabelKeyLength->setEnabled(checked);
m_pComboBoxKeyLength->setEnabled(checked);
m_pLabelCertificate->setEnabled(checked);
m_pLineEditCertificatePath->setEnabled(checked);
m_pPushButtonBrowseCert->setEnabled(checked);
m_pPushButtonRegenCert->setEnabled(checked);
if (appConfig().isCryptoAvailable())
{
m_pLabelKeyLength->setEnabled(checked);
m_pComboBoxKeyLength->setEnabled(checked);
m_pLabelCertificate->setEnabled(checked);
m_pLineEditCertificatePath->setEnabled(checked);
m_pPushButtonBrowseCert->setEnabled(checked);
m_pPushButtonRegenCert->setEnabled(checked);
buttonBox->button(QDialogButtonBox::Save)->setEnabled(isModified());
buttonBox->button(QDialogButtonBox::Save)->setEnabled(isModified());
}
else
{
m_pCheckBoxEnableCrypto->setChecked(false);
QMessageBox message(this);
message.addButton(QObject::tr("Close"), QMessageBox::RejectRole);
message.addButton(QObject::tr("Upgrade"), QMessageBox::AcceptRole);
message.setText(QObject::tr("TLS encryption is Synergy Pro feature.\nPlease upgrade if this is important to you"));
if (message.exec() == QMessageBox::Accepted)
{
QDesktopServices::openUrl(QUrl(QCoreApplication::organizationDomain() + "account"));
}
}
}
void SettingsDialog::on_m_pLabelInstallBonjour_linkActivated(const QString&)
@ -343,13 +349,13 @@ void SettingsDialog::enableControls(bool enable) {
m_pLineEditCertificatePath->setEnabled(enable);
m_pComboBoxKeyLength->setEnabled(enable);
m_pPushButtonBrowseCert->setEnabled(enable);
m_pCheckBoxEnableCrypto->setEnabled(enable);
m_labelAdminRightsMessage->setVisible(!enable);
if (enable) {
m_pLabelLogPath->setEnabled(m_pCheckBoxLogToFile->isChecked());
m_pLineEditLogFilename->setEnabled(m_pCheckBoxLogToFile->isChecked());
m_pButtonBrowseLog->setEnabled(m_pCheckBoxLogToFile->isChecked());
m_pCheckBoxEnableCrypto->setEnabled(m_appConfig.isCryptoAvailable());
m_pLabelKeyLength->setEnabled(m_pCheckBoxEnableCrypto->isChecked());
m_pComboBoxKeyLength->setEnabled(m_pCheckBoxEnableCrypto->isChecked());
m_pLabelCertificate->setEnabled(m_pCheckBoxEnableCrypto->isChecked());
@ -361,7 +367,6 @@ void SettingsDialog::enableControls(bool enable) {
m_pLabelLogPath->setEnabled(enable);
m_pLineEditLogFilename->setEnabled(enable);
m_pButtonBrowseLog->setEnabled(enable);
m_pCheckBoxEnableCrypto->setEnabled(enable);
m_pLabelKeyLength->setEnabled(enable);
m_pComboBoxKeyLength->setEnabled(enable);
m_pLabelCertificate->setEnabled(enable);

View File

@ -77,7 +77,7 @@ class SettingsDialog : public QDialog, public Ui::SettingsDialogBase
bool m_isSystemAtStart = false;
private slots:
void on_m_pCheckBoxEnableCrypto_toggled(bool checked);
void on_m_pCheckBoxEnableCrypto_clicked(bool checked);
void on_m_pComboLanguage_currentIndexChanged(int index);
void on_m_pCheckBoxLogToFile_stateChanged(int );
void on_m_pButtonBrowseLog_clicked();

File diff suppressed because it is too large Load Diff