diff --git a/ChangeLog b/ChangeLog index 6e9ba7ce0..61dfc0b18 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,6 +16,7 @@ Enhancements: - #6969 Update synergy UI. Validation for aliases. - #6973 Update synergy UI. Main window - #6977 Update synergy UI. Configure server +- #6978 Update synergy UI. Settings window - #6962 | #6965 Add macOS 10.13 builder =========== diff --git a/src/gui/res/Synergy.qrc b/src/gui/res/Synergy.qrc index f1f2e2c56..001e0fc2c 100644 --- a/src/gui/res/Synergy.qrc +++ b/src/gui/res/Synergy.qrc @@ -20,5 +20,6 @@ icons/64x64/synergy-light-disconnected.png icons/64x64/synergy-light-connected.png image/welcome.png + icons/64x64/folder.png diff --git a/src/gui/res/icons/64x64/folder.png b/src/gui/res/icons/64x64/folder.png new file mode 100644 index 000000000..fb96ebdfe Binary files /dev/null and b/src/gui/res/icons/64x64/folder.png differ diff --git a/src/gui/src/AppConfig.cpp b/src/gui/src/AppConfig.cpp index e0f4fd3a3..61eecda17 100644 --- a/src/gui/src/AppConfig.cpp +++ b/src/gui/src/AppConfig.cpp @@ -237,7 +237,7 @@ void AppConfig::loadSettings() m_UseExternalConfig = loadSetting(kUseExternalConfig, false).toBool(); m_ConfigFile = loadSetting(kConfigFile, QDir::homePath() + "/" + synergyConfigName).toString(); m_UseInternalConfig = loadSetting(kUseInternalConfig, false).toBool(); - m_ClientGroupChecked = loadSetting(kGroupClientCheck, true).toBool(); + m_ClientGroupChecked = loadSetting(kGroupClientCheck, false).toBool(); m_ServerHostname = loadSetting(kServerHostname).toString(); //only change the serial key if the settings being loaded contains a key diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp index d9bbbfb6f..6bd477633 100644 --- a/src/gui/src/MainWindow.cpp +++ b/src/gui/src/MainWindow.cpp @@ -298,10 +298,8 @@ void MainWindow::createMenuBar() void MainWindow::loadSettings() { - on_m_pRadioGroupServer_clicked(appConfig().getServerGroupChecked()); - on_m_pRadioGroupClient_clicked(appConfig().getClientGroupChecked()); - m_pRadioGroupServer->setChecked(appConfig().getServerGroupChecked()); - m_pRadioGroupClient->setChecked(appConfig().getClientGroupChecked()); + enableServer(appConfig().getServerGroupChecked()); + enableClient(appConfig().getClientGroupChecked()); m_pLineEditHostname->setText(appConfig().getServerHostname()); } @@ -1043,38 +1041,34 @@ void MainWindow::setVisible(bool visible) QString MainWindow::getIPAddresses() { - QList addresses = QNetworkInterface::allAddresses(); - + QStringList result; bool hinted = false; - QString result; - for (int i = 0; i < addresses.size(); i++) { - if (addresses[i].protocol() == QAbstractSocket::IPv4Protocol && - addresses[i] != QHostAddress(QHostAddress::LocalHost)) { + const auto localnet = QHostAddress::parseSubnet("192.168.0.0/16"); + const QList addresses = QNetworkInterface::allAddresses(); - QString address = addresses[i].toString(); - QString format = "%1, "; + for (const auto& address : addresses) { + if (address.protocol() == QAbstractSocket::IPv4Protocol && + address != QHostAddress(QHostAddress::LocalHost) && + !address.isLinkLocal()) { // usually 192.168.x.x is a useful ip for the user, so indicate // this by making it bold. - if (!hinted && address.startsWith("192.168")) { + if (!hinted && address.isInSubnet(localnet)) { + QString format = "%1"; + result.append(format.arg(address.toString())); hinted = true; - format = "%1, "; } - //Prevent self assigned IPs being displayed - if (!address.startsWith("169.254")) { - result += format.arg(address); + else { + result.append(address.toString()); } } } - if (result == "") { - return tr("Unknown"); + if (result.isEmpty()) { + result.append(tr("Unknown")); } - // remove trailing comma. - result.chop(2); - - return result; + return result.join(", "); } void MainWindow::changeEvent(QEvent* event) @@ -1365,18 +1359,38 @@ void MainWindow::updateScreenName() serverConfig().updateServerName(); } -void MainWindow::on_m_pRadioGroupServer_clicked(bool on) +void MainWindow::enableServer(bool enable) { - m_pRadioGroupServer->setChecked(true); - if (on) + m_pRadioGroupServer->setChecked(enable); + + if (enable) { - //show server controls m_pButtonConfigureServer->show(); m_pLabelServerState->show(); updateLocalFingerprint(); + m_pButtonToggleStart->setEnabled(enable); + } + else + { + m_pLabelFingerprint->hide(); + m_pButtonConfigureServer->hide(); + m_pLabelServerState->hide(); + } +} - //hide client controls - m_pRadioGroupClient->setChecked(false); +void MainWindow::enableClient(bool enable) +{ + m_pRadioGroupClient->setChecked(enable); + + if (enable) + { + m_pLabelServerName->show(); + m_pLineEditHostname->show(); + m_pButtonConnect->show(); + m_pButtonToggleStart->setEnabled(enable); + } + else + { m_pLabelClientState->hide(); m_pLabelServerName->hide(); m_pLineEditHostname->hide(); @@ -1384,25 +1398,21 @@ void MainWindow::on_m_pRadioGroupServer_clicked(bool on) } } -void MainWindow::on_m_pRadioGroupClient_clicked(bool on) -{ - m_pRadioGroupClient->setChecked(true); - if (on) - { - //show client controls - m_pLabelServerName->show(); - m_pLineEditHostname->show(); - m_pButtonConnect->show(); - //hide server controls - m_pRadioGroupServer->setChecked(false); - m_pLabelFingerprint->hide(); - m_pButtonConfigureServer->hide(); - m_pLabelServerState->hide(); - } +void MainWindow::on_m_pRadioGroupServer_clicked(bool) +{ + enableServer(true); + enableClient(false); +} + +void MainWindow::on_m_pRadioGroupClient_clicked(bool) +{ + enableClient(true); + enableServer(false); } void MainWindow::on_m_pButtonConnect_clicked() { restartSynergy(); } + diff --git a/src/gui/src/MainWindow.h b/src/gui/src/MainWindow.h index dec656ab2..55397f0b7 100644 --- a/src/gui/src/MainWindow.h +++ b/src/gui/src/MainWindow.h @@ -143,8 +143,8 @@ public slots: protected slots: void updateLocalFingerprint(); void updateScreenName(); - void on_m_pRadioGroupServer_clicked(bool on); - void on_m_pRadioGroupClient_clicked(bool on); + void on_m_pRadioGroupServer_clicked(bool); + void on_m_pRadioGroupClient_clicked(bool); void on_m_pButtonConfigureServer_clicked(); bool on_m_pActionSave_triggered(); void on_m_pActionAbout_triggered(); @@ -187,6 +187,8 @@ public slots: void stopDesktop(); void changeEvent(QEvent* event); void retranslateMenuBar(); + void enableServer(bool enable); + void enableClient(bool enable); #if defined(Q_OS_WIN) bool isServiceRunning(QString name); diff --git a/src/gui/src/MainWindowBase.ui b/src/gui/src/MainWindowBase.ui index f8aebf3a0..79d3604e1 100644 --- a/src/gui/src/MainWindowBase.ui +++ b/src/gui/src/MainWindowBase.ui @@ -866,6 +866,9 @@ + + false + &Start diff --git a/src/gui/src/ServerConfigDialogBase.ui b/src/gui/src/ServerConfigDialogBase.ui index e9c9d6530..41ab40ddf 100644 --- a/src/gui/src/ServerConfigDialogBase.ui +++ b/src/gui/src/ServerConfigDialogBase.ui @@ -1028,7 +1028,7 @@ - 95 + 40 0 @@ -1071,6 +1071,22 @@ + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + @@ -1103,12 +1119,31 @@ - 40 + 0 0 + + PointingHandCursor + + + margin: 0px; padding: 0px; + - &Browse... + + + + + :/res/icons/64x64/folder.png:/res/icons/64x64/folder.png + + + + 20 + 13 + + + + true diff --git a/src/gui/src/SettingsDialog.cpp b/src/gui/src/SettingsDialog.cpp index f1f2ae87f..00ff22d08 100644 --- a/src/gui/src/SettingsDialog.cpp +++ b/src/gui/src/SettingsDialog.cpp @@ -65,6 +65,8 @@ SettingsDialog::SettingsDialog(QWidget* parent, AppConfig& config) : connect(m_pSpinBoxPort, SIGNAL(valueChanged(int)), this, SLOT(onChange())); connect(m_pLineEditScreenName, SIGNAL(textEdited(QString)), this, SLOT(onChange())); connect(m_pComboElevate, SIGNAL(currentIndexChanged(int)), this, SLOT(onChange())); + + resize(400, 620); } void SettingsDialog::accept() @@ -174,17 +176,14 @@ void SettingsDialog::loadFromConfig() { #endif m_pCheckBoxEnableCrypto->setChecked(m_appConfig.getCryptoEnabled()); - m_pGroupBoxTLS->setVisible(m_appConfig.getCryptoEnabled()); #ifdef SYNERGY_ENTERPRISE m_pCheckBoxEnableCrypto->setEnabled(true); - m_pLabelProUpgrade->hide(); #else m_pCheckBoxEnableCrypto->setEnabled(m_appConfig.isCryptoAvailable()); - m_pLabelProUpgrade->setVisible(!m_appConfig.isCryptoAvailable()); #endif @@ -209,6 +208,7 @@ void SettingsDialog::on_m_pCheckBoxLogToFile_stateChanged(int i) { bool checked = i == 2; + m_pLabelLogPath->setEnabled(checked); m_pLineEditLogFilename->setEnabled(checked); m_pButtonBrowseLog->setEnabled(checked); buttonBox->button(QDialogButtonBox::Save)->setEnabled(isModified()); @@ -236,13 +236,14 @@ void SettingsDialog::on_m_pComboLanguage_currentIndexChanged(int index) void SettingsDialog::on_m_pCheckBoxEnableCrypto_toggled(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); + buttonBox->button(QDialogButtonBox::Save)->setEnabled(isModified()); - if (checked) { - verticalSpacer_4->changeSize(10, 10, QSizePolicy::Minimum); - } else { - verticalSpacer_4->changeSize(10, 0, QSizePolicy::Ignored); - } - adjustSize(); } void SettingsDialog::on_m_pLabelInstallBonjour_linkActivated(const QString&) @@ -288,10 +289,9 @@ void SettingsDialog::updateRegenButton() { // Disable the Regenerate cert button if the key length is different to saved auto keyChanged = appConfig().getTLSKeyLength() != m_pComboBoxKeyLength->currentText(); auto pathChanged = appConfig().getTLSCertPath() != m_pLineEditCertificatePath->text(); - auto cryptoChanged = appConfig().getCryptoEnabled() != m_pCheckBoxEnableCrypto->isChecked(); //NOR the above bools, if any have changed regen should be disabled as it will be done on save - auto nor = !(keyChanged || pathChanged || cryptoChanged); - m_pPushButtonRegenCert->setEnabled(nor); + auto nor = !(keyChanged || pathChanged); + m_pPushButtonRegenCert->setEnabled(nor && m_pCheckBoxEnableCrypto->isChecked()); } void SettingsDialog::on_m_pPushButtonRegenCert_clicked() { @@ -346,18 +346,29 @@ void SettingsDialog::enableControls(bool 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()); + m_pLineEditCertificatePath->setEnabled(m_pCheckBoxEnableCrypto->isChecked()); + m_pPushButtonBrowseCert->setEnabled(m_pCheckBoxEnableCrypto->isChecked()); updateRegenButton(); } else { + 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); + m_pLineEditCertificatePath->setEnabled(enable); + m_pPushButtonBrowseCert->setEnabled(enable); m_pPushButtonRegenCert->setEnabled(enable); } - } void SettingsDialog::onChange() diff --git a/src/gui/src/SettingsDialogBase.ui b/src/gui/src/SettingsDialogBase.ui index 898bc27db..019d620f9 100644 --- a/src/gui/src/SettingsDialogBase.ui +++ b/src/gui/src/SettingsDialogBase.ui @@ -6,8 +6,8 @@ 0 0 - 396 - 879 + 404 + 737 @@ -16,35 +16,609 @@ 0 + + + 400 + 620 + + - Settings + Preferences - - - - - 75 - true - + + 11 + + + 11 + + + 11 + + + + + Qt::Horizontal - - To edit settings for all users, Admin privileges are required. + + QDialogButtonBox::Cancel|QDialogButtonBox::Save - - + + + + true + + + + 0 + 0 + + true - - &Miscellaneous + + QGroupBox::title { + left: 0px; + top: -2px; +} - - + + Security + + + + 6 + + + 9 + + + 6 + + + 9 + + + 9 + + + + + 0 + + + + + false + + + Enable &TLS encryption + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Key length + + + + + + + 1024 + + + + 1024 + + + + + 2048 + + + + + 4096 + + + + + + + + + + 0 + + + + + Certificate + + + + + + + Qt::Horizontal + + + QSizePolicy::Minimum + + + + 30 + 20 + + + + + + + + + 0 + 0 + + + + + + + + PointingHandCursor + + + margin: 0px; padding: 0px; + + + + + + + :/res/icons/64x64/folder.png:/res/icons/64x64/folder.png + + + + 20 + 13 + + + + true + + + + + + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Regenerate cert + + + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Minimum + + + + 20 + 8 + + + + + + + + Qt::Vertical + + + QSizePolicy::Minimum + + + + 20 + 10 + + + + + + + + Qt::Vertical + + + QSizePolicy::Minimum + + + + 20 + 16 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + 13 + + + 9 + + + 9 + + + + + + + + 75 + 0 + + + + Computer name + + + m_pLineEditScreenName + + + + + + + Qt::Horizontal + + + QSizePolicy::Maximum + + + + 20 + 20 + + + + + + + + true + + + 255 + + + + + + + + + + 0 + 0 + + + + color: #EC4C47; +font-size: 13px; +font-family: Arial; +font-weight: bold; + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 0 + + + + + P&ort + + + m_pSpinBoxPort + + + + + + + true + + + + 0 + 0 + + + + 65535 + + + 24800 + + + + + + + Network IP + + + m_pLineEditInterface + + + + + + + true + + + + + + + + + 0 + + + + + &Hide on startup + + + + + + + Minimize to system &tray + + + + + + + + + + + + 0 + + + 1 + + + 0 + + + 6 + + + + + false + + + + 0 + 0 + + + + Enable Auto Config + + + + + + + + 0 + 0 + + + + <html><head/><body><p><a href="#"><span style=" text-decoration: underline; color:#007af4;">Install Bonjour</span></a></p></body></html> + + + Qt::RichText + + + + + + + + + Qt::Vertical + + + QSizePolicy::Minimum + + + + 20 + 6 + + + + + + + + + true + + + + QGroupBox::title { + left: -3px; + top: -2px; +} + + + Use &settings profile from + + + + + + All users + + + true + + + + + + + Current user + + + + + + + false + + + + 50 + false + + + + Note: Only Admins can edit settings for all users. + + + + + + + + + + + true + + + + QGroupBox::title { + left: 0px; + top: -2px; +} + + + Advanced + + + + + + + 0 + 0 + + + + + 75 + 0 + + + + &Language + + + m_pComboLanguage + + + + Specify when the Synergy service should run at an elevated privilege level @@ -69,420 +643,33 @@ - - - - &Interface: - - - m_pLineEditInterface - - - - - - - Minimize to System &Tray - - - - - - - true - - - 255 - - - - - - - true - - - - 0 - 0 - - - - 65535 - - - 24800 - - - - - - - - 75 - 0 - - - - Sc&reen name: - - - m_pLineEditScreenName - - - - - - - P&ort: - - - m_pSpinBoxPort - - - - + Elevate - - - - &Hide on startup - - - - - - - true - - - - - - - - 0 - 0 - - - - color: #EC4C47; -font-size: 13px; -font-family: Arial; -font-weight: bold; - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 20 - 10 - - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 20 - 10 - - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 20 - 10 - - - - - - - - true - - - - 0 - 0 - - - - - true - - - - &Network - - - - 2 - - - 12 - - - 2 - - - 12 - - - - - 0 - - - 12 - - - - - <html><head/><body><p><a href="https://symless.com/account?source=gui&amp;intent=upgrade"><span style=" text-decoration: underline; color:#007af4;">Upgrade to Pro</span></a></p></body></html> - - - Qt::RichText - - - true - - - - - - - <html><head/><body><p><a href="#"><span style=" text-decoration: underline; color:#007af4;">Install Bonjour</span></a></p></body></html> - - - Qt::RichText - - - - - - - false - - - - 0 - 0 - - - - Enable Auto Config - - - - - - - false - - - Enable &TLS Encryption - - - - - - - - - - - - - true - - - - Use &settings profile from: - - - - - - All users - - - true - - - - - - - Current user - - - - - - - - - - - true - - - - Advanced - - - - - - - 0 - 0 - - - - - 75 - 0 - - - - &Language: - - - m_pComboLanguage - - - - - - - - - - - true - - - - TLS/SSL Settings - - - - - - - - - Key length + + + + Qt::Horizontal - - - - - - Certificate Path + + + 40 + 20 + - - - - - - Browse - - - - - - - 1024 - - - - 1024 - - - - - 2048 - - - - - 4096 - - - - - - - - Regenerate Cert - - + - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 20 - 10 - - - - - + @@ -495,8 +682,14 @@ font-weight: bold; true + + QGroupBox::title { + left: 0px; + top: -2px; +} + - Logging + Logs Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter @@ -505,23 +698,45 @@ font-weight: bold; false - + + 6 + + + 16 + + + 6 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + - 75 + 0 0 - &Logging level: + &Level m_pComboLogLevel - + @@ -545,82 +760,100 @@ font-weight: bold; - + - Log to file: + Log to file - - - - false + + + + 3 - - - - - - false + + 0 - - Browse... - - + + + + Log path + + + + + + + Qt::Horizontal + + + QSizePolicy::Minimum + + + + 30 + 20 + + + + + + + + false + + + + 0 + 0 + + + + + + + + false + + + PointingHandCursor + + + margin: 0px; padding: 0px; + + + + + + + :/res/icons/64x64/folder.png:/res/icons/64x64/folder.png + + + + 20 + 13 + + + + true + + + + - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Save - - - - - - - Qt::Vertical - - - QSizePolicy::MinimumExpanding - - - - 20 - 10 - - - - - m_pRadioSystemScope m_pRadioUserScope - m_pLineEditScreenName - m_pSpinBoxPort - m_pLineEditInterface - m_pComboElevate - m_pCheckBoxAutoHide - m_pCheckBoxMinimizeToTray m_pCheckBoxAutoConfig - m_pCheckBoxEnableCrypto - m_pComboBoxKeyLength - m_pLineEditCertificatePath - m_pPushButtonBrowseCert - m_pPushButtonRegenCert - m_pComboLogLevel - m_pCheckBoxLogToFile - m_pLineEditLogFilename - m_pButtonBrowseLog - + + + buttonBox @@ -654,21 +887,5 @@ font-weight: bold; - - m_pCheckBoxEnableCrypto - toggled(bool) - m_pGroupBoxTLS - setVisible(bool) - - - 100 - 413 - - - 188 - 508 - - - diff --git a/src/gui/src/validators/ScreenDuplicationsValidator.cpp b/src/gui/src/validators/ScreenDuplicationsValidator.cpp index 8a6d245f7..0af01f352 100644 --- a/src/gui/src/validators/ScreenDuplicationsValidator.cpp +++ b/src/gui/src/validators/ScreenDuplicationsValidator.cpp @@ -36,9 +36,8 @@ bool ScreenDuplicationsValidator::validate(const QString& input) const { for (const auto& screen : (*m_pScreenList)) { - if (!screen.isNull() && - input != m_defaultName && - input == screen.name()) + if (!screen.isNull() && !screen.isServer() && + input != m_defaultName && input == screen.name()) { result = false; break;