From 35fa9c8f01a40d7903b6ca6216f1e3314b8843f2 Mon Sep 17 00:00:00 2001 From: Serhii Hadzhilov Date: Wed, 14 Apr 2021 14:03:40 +0300 Subject: [PATCH 01/12] SYNERGY-799 Move computer name --- src/gui/src/SettingsDialogBase.ui | 605 ++++++++++++++++-------------- 1 file changed, 321 insertions(+), 284 deletions(-) diff --git a/src/gui/src/SettingsDialogBase.ui b/src/gui/src/SettingsDialogBase.ui index 898bc27db..ab824a5aa 100644 --- a/src/gui/src/SettingsDialogBase.ui +++ b/src/gui/src/SettingsDialogBase.ui @@ -6,8 +6,8 @@ 0 0 - 396 - 879 + 400 + 909 @@ -17,10 +17,225 @@ - Settings + Preferences - + + 11 + + + 11 + + + 11 + + + + + + true + + + + Advanced + + + + + + + 0 + 0 + + + + + 75 + 0 + + + + &Language: + + + m_pComboLanguage + + + + + + + + + + + + + + + + + + + + + + 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 + 0 + + + + + true + + + + Logging + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + false + + + + + + + 75 + 0 + + + + &Logging level: + + + m_pComboLogLevel + + + + + + + + Info + + + + + Debug + + + + + Debug1 + + + + + Debug2 + + + + + + + + Log to file: + + + + + + + false + + + + + + + false + + + Browse... + + + + + + + @@ -33,7 +248,55 @@ - + + + + Qt::Vertical + + + QSizePolicy::Minimum + + + + 20 + 10 + + + + + + + + Qt::Vertical + + + QSizePolicy::Minimum + + + + 20 + 10 + + + + + + + + Qt::Vertical + + + QSizePolicy::MinimumExpanding + + + + 20 + 10 + + + + + @@ -44,6 +307,20 @@ &Miscellaneous + + + + Elevate + + + + + + + Minimize to System &Tray + + + @@ -69,30 +346,20 @@ - - + + - &Interface: + &Hide on startup + + + + + + + P&ort: - m_pLineEditInterface - - - - - - - Minimize to System &Tray - - - - - - - true - - - 255 + m_pSpinBoxPort @@ -115,46 +382,6 @@ - - - - - 75 - 0 - - - - Sc&reen name: - - - m_pLineEditScreenName - - - - - - - P&ort: - - - m_pSpinBoxPort - - - - - - - Elevate - - - - - - - &Hide on startup - - - @@ -162,80 +389,20 @@ - - - - - 0 - 0 - - - - color: #EC4C47; -font-size: 13px; -font-family: Arial; -font-weight: bold; - + + - + &Interface: - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + m_pLineEditInterface - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 20 - 10 - - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 20 - 10 - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 20 - 10 - - - - - true @@ -329,77 +496,17 @@ font-weight: bold; - - - - - true - + + + + Qt::Horizontal - - Use &settings profile from: + + QDialogButtonBox::Cancel|QDialogButtonBox::Save - - - - - All users - - - true - - - - - - - Current user - - - - - - - - - true - - - - Advanced - - - - - - - 0 - 0 - - - - - 75 - 0 - - - - &Language: - - - m_pComboLanguage - - - - - - - - - - + @@ -466,8 +573,8 @@ font-weight: bold; - - + + Qt::Vertical @@ -482,113 +589,44 @@ font-weight: bold; - - - - - 0 - 0 - - + + true - Logging + Use &settings profile from: - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - false - - - - - - - 75 - 0 - - - - &Logging level: - - - m_pComboLogLevel - - - - - - - - Info - - - - - Debug - - - - - Debug1 - - - - - Debug2 - - - - + - + - Log to file: + All users + + + true - - - false - - - - - - - false - + - Browse... + Current user - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Save - - - - - + + Qt::Vertical - QSizePolicy::MinimumExpanding + QSizePolicy::Minimum @@ -603,7 +641,6 @@ font-weight: bold; m_pRadioSystemScope m_pRadioUserScope - m_pLineEditScreenName m_pSpinBoxPort m_pLineEditInterface m_pComboElevate From 4fa82d5dcb551cf7950f1d620c8f0b97122946f2 Mon Sep 17 00:00:00 2001 From: Serhii Hadzhilov Date: Wed, 14 Apr 2021 14:42:58 +0300 Subject: [PATCH 02/12] SYNERGY-799 Move common settings --- src/gui/src/SettingsDialogBase.ui | 250 +++++++++++++++--------------- 1 file changed, 129 insertions(+), 121 deletions(-) diff --git a/src/gui/src/SettingsDialogBase.ui b/src/gui/src/SettingsDialogBase.ui index ab824a5aa..decf915a4 100644 --- a/src/gui/src/SettingsDialogBase.ui +++ b/src/gui/src/SettingsDialogBase.ui @@ -29,7 +29,7 @@ 11 - + @@ -74,6 +74,12 @@ + + 13 + + + 6 + @@ -142,10 +148,123 @@ font-weight: bold; + + + + 0 + + + + + P&ort + + + m_pSpinBoxPort + + + + + + + true + + + + 0 + 0 + + + + 65535 + + + 24800 + + + + + + + Network IP + + + m_pLineEditInterface + + + + + + + true + + + + + + + + + 0 + + + + + &Hide on startup + + + + + + + Minimize to system &tray + + + + + + + + + 0 + + + + + Elevate + + + + + + + Specify when the Synergy service should run at an elevated privilege level + + + 0 + + + + As Needed + + + + + Always + + + + + Never + + + + + + - + @@ -248,7 +367,7 @@ font-weight: bold; - + Qt::Vertical @@ -264,7 +383,7 @@ font-weight: bold; - + Qt::Vertical @@ -280,7 +399,7 @@ font-weight: bold; - + Qt::Vertical @@ -296,113 +415,7 @@ font-weight: bold; - - - - - true - - - - &Miscellaneous - - - - - - Elevate - - - - - - - Minimize to System &Tray - - - - - - - Specify when the Synergy service should run at an elevated privilege level - - - 0 - - - - As Needed - - - - - Always - - - - - Never - - - - - - - - &Hide on startup - - - - - - - P&ort: - - - m_pSpinBoxPort - - - - - - - true - - - - 0 - 0 - - - - 65535 - - - 24800 - - - - - - - true - - - - - - - &Interface: - - - m_pLineEditInterface - - - - - - - + true @@ -496,7 +509,7 @@ font-weight: bold; - + Qt::Horizontal @@ -506,7 +519,7 @@ font-weight: bold; - + @@ -573,7 +586,7 @@ font-weight: bold; - + Qt::Vertical @@ -620,7 +633,7 @@ font-weight: bold; - + Qt::Vertical @@ -641,11 +654,6 @@ font-weight: bold; m_pRadioSystemScope m_pRadioUserScope - m_pSpinBoxPort - m_pLineEditInterface - m_pComboElevate - m_pCheckBoxAutoHide - m_pCheckBoxMinimizeToTray m_pCheckBoxAutoConfig m_pCheckBoxEnableCrypto m_pComboBoxKeyLength From c3aab85f88f4214ae1ff667eea5e0065003a40ca Mon Sep 17 00:00:00 2001 From: Serhii Hadzhilov Date: Wed, 14 Apr 2021 15:51:07 +0300 Subject: [PATCH 03/12] SYNERGY-799 Security section --- src/gui/src/SettingsDialog.cpp | 3 - src/gui/src/SettingsDialogBase.ui | 805 +++++++++++++++--------------- 2 files changed, 414 insertions(+), 394 deletions(-) diff --git a/src/gui/src/SettingsDialog.cpp b/src/gui/src/SettingsDialog.cpp index 87af94aa2..5bfc04a44 100644 --- a/src/gui/src/SettingsDialog.cpp +++ b/src/gui/src/SettingsDialog.cpp @@ -174,17 +174,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 diff --git a/src/gui/src/SettingsDialogBase.ui b/src/gui/src/SettingsDialogBase.ui index decf915a4..d2d438d55 100644 --- a/src/gui/src/SettingsDialogBase.ui +++ b/src/gui/src/SettingsDialogBase.ui @@ -7,7 +7,7 @@ 0 0 400 - 909 + 708 @@ -29,6 +29,352 @@ 11 + + + + true + + + + 0 + 0 + + + + + true + + + + QGroupBox::title { + left: 0px; + top: -2px; +} + + + Security + + + + 2 + + + 9 + + + 6 + + + 9 + + + 3 + + + + + 0 + + + + + false + + + Enable &TLS encryption + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Key length + + + + + + + 1024 + + + + 1024 + + + + + 2048 + + + + + 4096 + + + + + + + + + + 0 + + + + + Certificate + + + + + + + Qt::Horizontal + + + QSizePolicy::Minimum + + + + 30 + 20 + + + + + + + + + + + Browse + + + + + + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Regenerate cert + + + + + + + + + + + + + 75 + true + + + + To edit settings for all users, Admin privileges are required. + + + + + + + + 0 + 0 + + + + + true + + + + Logging + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + false + + + + + + + 75 + 0 + + + + &Logging level: + + + m_pComboLogLevel + + + + + + + + Info + + + + + Debug + + + + + Debug1 + + + + + Debug2 + + + + + + + + Log to file: + + + + + + + false + + + + + + + false + + + Browse... + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Minimum + + + + 20 + 10 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Save + + + + + + + Qt::Vertical + + + QSizePolicy::MinimumExpanding + + + + 20 + 10 + + + + + + + + + true + + + + Use &settings profile from: + + + + + + All users + + + true + + + + + + + Current user + + + + + + @@ -77,6 +423,9 @@ 13 + + 9 + 6 @@ -264,375 +613,6 @@ font-weight: bold; - - - - - 0 - 0 - - - - - true - - - - Logging - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - false - - - - - - - 75 - 0 - - - - &Logging level: - - - m_pComboLogLevel - - - - - - - - Info - - - - - Debug - - - - - Debug1 - - - - - Debug2 - - - - - - - - Log to file: - - - - - - - false - - - - - - - false - - - Browse... - - - - - - - - - - - 75 - true - - - - To edit settings for all users, Admin privileges are required. - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 20 - 10 - - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 20 - 10 - - - - - - - - Qt::Vertical - - - QSizePolicy::MinimumExpanding - - - - 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 - - - - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Save - - - - - - - - true - - - - TLS/SSL Settings - - - - - - - - - Key length - - - - - - - Certificate Path - - - - - - - Browse - - - - - - - 1024 - - - - 1024 - - - - - 2048 - - - - - 4096 - - - - - - - - Regenerate Cert - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 20 - 10 - - - - - - - - - true - - - - Use &settings profile from: - - - - - - All users - - - true - - - - - - - Current user - - - - - - @@ -649,17 +629,76 @@ font-weight: bold; + + + + Qt::Vertical + + + QSizePolicy::Minimum + + + + 20 + 8 + + + + + + + + 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 + + + + + m_pRadioSystemScope m_pRadioUserScope m_pCheckBoxAutoConfig - m_pCheckBoxEnableCrypto - m_pComboBoxKeyLength - m_pLineEditCertificatePath - m_pPushButtonBrowseCert - m_pPushButtonRegenCert m_pComboLogLevel m_pCheckBoxLogToFile m_pLineEditLogFilename @@ -699,21 +738,5 @@ font-weight: bold; - - m_pCheckBoxEnableCrypto - toggled(bool) - m_pGroupBoxTLS - setVisible(bool) - - - 100 - 413 - - - 188 - 508 - - - From e690f40e65d1ca99de624630e40303eaecb50ba7 Mon Sep 17 00:00:00 2001 From: Serhii Hadzhilov Date: Wed, 14 Apr 2021 18:12:36 +0300 Subject: [PATCH 04/12] SYNERGY-799 Logs section --- src/gui/src/SettingsDialogBase.ui | 596 ++++++++++++++++-------------- 1 file changed, 314 insertions(+), 282 deletions(-) diff --git a/src/gui/src/SettingsDialogBase.ui b/src/gui/src/SettingsDialogBase.ui index d2d438d55..7179551c0 100644 --- a/src/gui/src/SettingsDialogBase.ui +++ b/src/gui/src/SettingsDialogBase.ui @@ -29,177 +29,23 @@ 11 - - - - true + + + + Qt::Vertical - - - 0 - 0 - + + QSizePolicy::Minimum - - - true - + + + 20 + 16 + - - QGroupBox::title { - left: 0px; - top: -2px; -} - - - Security - - - - 2 - - - 9 - - - 6 - - - 9 - - - 3 - - - - - 0 - - - - - false - - - Enable &TLS encryption - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Key length - - - - - - - 1024 - - - - 1024 - - - - - 2048 - - - - - 4096 - - - - - - - - - - 0 - - - - - Certificate - - - - - - - Qt::Horizontal - - - QSizePolicy::Minimum - - - - 30 - 20 - - - - - - - - - - - Browse - - - - - - - - - 0 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Regenerate cert - - - - - - - + - + @@ -212,97 +58,7 @@ - - - - - 0 - 0 - - - - - true - - - - Logging - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - false - - - - - - - 75 - 0 - - - - &Logging level: - - - m_pComboLogLevel - - - - - - - - Info - - - - - Debug - - - - - Debug1 - - - - - Debug2 - - - - - - - - Log to file: - - - - - - - false - - - - - - - false - - - Browse... - - - - - - - + Qt::Vertical @@ -318,7 +74,7 @@ - + Qt::Horizontal @@ -328,7 +84,7 @@ - + Qt::Vertical @@ -344,7 +100,7 @@ - + @@ -375,7 +131,7 @@ - + @@ -613,22 +369,6 @@ font-weight: bold; - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 20 - 10 - - - - @@ -645,7 +385,7 @@ font-weight: bold; - + 0 @@ -693,16 +433,308 @@ font-weight: bold; + + + + + 0 + 0 + + + + + true + + + + QGroupBox::title { + left: 0px; + top: -2px; +} + + + Logs + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + false + + + + 6 + + + 16 + + + 6 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + &Level + + + m_pComboLogLevel + + + + + + + Log to file + + + + + + + + Info + + + + + Debug + + + + + Debug1 + + + + + Debug2 + + + + + + + + false + + + Browse... + + + + + + + false + + + + + + + Log path + + + + + + + + + + true + + + + 0 + 0 + + + + + true + + + + QGroupBox::title { + left: 0px; + top: -2px; +} + + + Security + + + + 2 + + + 9 + + + 6 + + + 9 + + + 3 + + + + + 0 + + + + + false + + + Enable &TLS encryption + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Key length + + + + + + + 1024 + + + + 1024 + + + + + 2048 + + + + + 4096 + + + + + + + + + + 0 + + + + + Certificate + + + + + + + Qt::Horizontal + + + QSizePolicy::Minimum + + + + 30 + 20 + + + + + + + + + + + Browse + + + + + + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Regenerate cert + + + + + + + + m_pRadioSystemScope m_pRadioUserScope m_pCheckBoxAutoConfig - m_pComboLogLevel - m_pCheckBoxLogToFile m_pLineEditLogFilename - m_pButtonBrowseLog From 02618cb495973e48649a7399a630f5e522fee81a Mon Sep 17 00:00:00 2001 From: Serhii Hadzhilov Date: Thu, 15 Apr 2021 13:45:11 +0300 Subject: [PATCH 05/12] SYNERGY-799 Set default size --- src/gui/src/SettingsDialog.cpp | 2 + src/gui/src/SettingsDialogBase.ui | 503 ++++++++++++++++-------------- 2 files changed, 270 insertions(+), 235 deletions(-) diff --git a/src/gui/src/SettingsDialog.cpp b/src/gui/src/SettingsDialog.cpp index 5bfc04a44..5662abbcd 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() diff --git a/src/gui/src/SettingsDialogBase.ui b/src/gui/src/SettingsDialogBase.ui index 7179551c0..69f4236f4 100644 --- a/src/gui/src/SettingsDialogBase.ui +++ b/src/gui/src/SettingsDialogBase.ui @@ -7,7 +7,7 @@ 0 0 400 - 708 + 757 @@ -16,6 +16,12 @@ 0 + + + 400 + 620 + + Preferences @@ -29,36 +35,17 @@ 11 - - + + - Qt::Vertical + Qt::Horizontal - - QSizePolicy::Minimum - - - - 20 - 16 - - - - - - - - - 75 - true - - - - To edit settings for all users, Admin privileges are required. + + QDialogButtonBox::Cancel|QDialogButtonBox::Save - + Qt::Vertical @@ -69,28 +56,18 @@ 20 - 10 + 6 - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Save - - - - - + + Qt::Vertical - QSizePolicy::MinimumExpanding + QSizePolicy::Minimum @@ -100,18 +77,72 @@ - + + + + 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 + + + + + + true + + QGroupBox::title { + left: -3px; + top: -2px; +} + - Use &settings profile from: + Use &settings profile from - + All users @@ -128,16 +159,38 @@ + + + + false + + + + 50 + false + + + + Note: Only Admins can edit settings for all users. + + + - + true + + QGroupBox::title { + left: 0px; + top: -2px; +} + Advanced @@ -157,7 +210,7 @@ - &Language: + &Language m_pComboLanguage @@ -369,195 +422,6 @@ font-weight: bold; - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 20 - 8 - - - - - - - - 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 - - - - - - - - - - 0 - 0 - - - - - true - - - - QGroupBox::title { - left: 0px; - top: -2px; -} - - - Logs - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - false - - - - 6 - - - 16 - - - 6 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - &Level - - - m_pComboLogLevel - - - - - - - Log to file - - - - - - - - Info - - - - - Debug - - - - - Debug1 - - - - - Debug2 - - - - - - - - false - - - Browse... - - - - - - - false - - - - - - - Log path - - - - - - @@ -728,10 +592,179 @@ font-weight: bold; + + + + + 0 + 0 + + + + + true + + + + QGroupBox::title { + left: 0px; + top: -2px; +} + + + Logs + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + false + + + + 6 + + + 16 + + + 6 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + &Level + + + m_pComboLogLevel + + + + + + + Log to file + + + + + + + + Info + + + + + Debug + + + + + Debug1 + + + + + Debug2 + + + + + + + + false + + + Browse... + + + + + + + false + + + + + + + Log path + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Minimum + + + + 20 + 16 + + + + + + + + Qt::Vertical + + + QSizePolicy::Minimum + + + + 20 + 8 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + - m_pRadioSystemScope m_pRadioUserScope m_pCheckBoxAutoConfig m_pLineEditLogFilename From 2cecc9ad000898fa3052f83a48bdeee3102cc590 Mon Sep 17 00:00:00 2001 From: Serhii Hadzhilov Date: Thu, 15 Apr 2021 13:53:43 +0300 Subject: [PATCH 06/12] =?UTF-8?q?SYNERGY-799=20Move=20=E2=80=9CElevate?= =?UTF-8?q?=E2=80=9D=20to=20the=20=E2=80=9CAdvanced=E2=80=9D=20section?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gui/src/SettingsDialogBase.ui | 474 +++++++++++++++--------------- 1 file changed, 240 insertions(+), 234 deletions(-) diff --git a/src/gui/src/SettingsDialogBase.ui b/src/gui/src/SettingsDialogBase.ui index 69f4236f4..f21820257 100644 --- a/src/gui/src/SettingsDialogBase.ui +++ b/src/gui/src/SettingsDialogBase.ui @@ -217,207 +217,53 @@ - - - - - - - - - - - - - - 13 - - - 9 - - - 6 - - - - - - - - 75 - 0 - - - - Computer name - - - m_pLineEditScreenName - - - - - - - Qt::Horizontal - - - QSizePolicy::Maximum - - - - 20 - 20 - - - - - - - - true - - - 255 - - - - - - - - - - 0 - 0 - + + + + Specify when the Synergy service should run at an elevated privilege level - - color: #EC4C47; -font-size: 13px; -font-family: Arial; -font-weight: bold; + + 0 + + + As Needed + + + + + Always + + + + + Never + + + + + + - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + Elevate - - - - 0 - - - - - P&ort - - - m_pSpinBoxPort - - - - - - - true - - - - 0 - 0 - - - - 65535 - - - 24800 - - - - - - - Network IP - - - m_pLineEditInterface - - - - - - - true - - - - + + - - - - 0 + + + + Qt::Horizontal - - - - &Hide on startup - - - - - - - Minimize to system &tray - - - - - - - - - 0 + + + 40 + 20 + - - - - Elevate - - - - - - - Specify when the Synergy service should run at an elevated privilege level - - - 0 - - - - As Needed - - - - - Always - - - - - Never - - - - - + @@ -630,39 +476,10 @@ font-weight: bold; 6 - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - + + - &Level - - - m_pComboLogLevel - - - - - - - Log to file + Log path @@ -690,6 +507,42 @@ font-weight: bold; + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + false + + + + + + + + 0 + 0 + + + + &Level + + + m_pComboLogLevel + + + @@ -700,17 +553,10 @@ font-weight: bold; - - - - false - - - - - + + - Log path + Log to file @@ -762,6 +608,166 @@ font-weight: bold; + + + + + + + + 13 + + + 9 + + + 6 + + + + + + + + 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 + + + + + + + + From fe28d4c1262f8006985b6727a3e50455c1b30ab1 Mon Sep 17 00:00:00 2001 From: Serhii Hadzhilov Date: Thu, 15 Apr 2021 14:53:28 +0300 Subject: [PATCH 07/12] SYNERGY-799 Update browse buttons --- src/gui/res/Synergy.qrc | 1 + src/gui/res/icons/64x64/folder.png | Bin 0 -> 919 bytes src/gui/src/ServerConfigDialogBase.ui | 43 +- src/gui/src/SettingsDialogBase.ui | 810 ++++++++++++++------------ 4 files changed, 484 insertions(+), 370 deletions(-) create mode 100644 src/gui/res/icons/64x64/folder.png 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 0000000000000000000000000000000000000000..fb96ebdfe9f8ab1b0de979ff60afbcbee7764e3e GIT binary patch literal 919 zcmV;I18Dq-P)@~0drDELIAGL9O(c600d`2O+f$vv5yP*Al(5=FmwZS1;7d*k5!9ER8bzGD`;3j=>~$Azz)a`h*YXxOwQ?y z6GMDU6FZRDo=-v~zC7@04s&KaiNYApryq{idIzu$y=~yJ(5lsa|Duf&pn?}$CqIv1 zYzt3CNhJCLpIlx*2_!1#RrV<-{kk3Pqv@VoD}UiUF4)YkE>MfG5T7sm72B(sMcEY}i#I@alDSJ&&; z&gWk{$U#*F-lOfH!zC;-Qh9+4)&F0e*3CLHAOd}CqgJaq$bbkOVKWvKA}~PfSIB?} z%!vrhi3rSz2+WBH%!vrh$y~ZI*21NZ#CNSs-x$?H5n1ti$UqK(whx0ZW^i{l&-PH! z$R^NO7T2n>xPaLOS~RTDDR{y*;?uDSer zdV$8a>84KfFt>s9v(X^ERgvNExPw6MgW);~)!}rCCBI3go5BPp)D& znbk`O%*8~3%GmR0^wDF`-KCjkSSYs7!IdhIqpurD9RAXUD(oQ8T%jtAgDW))lfd}W zwe@|8zVNOjEdo34hwz5kk3Ne72%+Fg6quMe?CL25LS2jpS6m=h97&18+HD9FTz{M6 z??VFpZOh=U6TeLohYxk3qQMmv7>_=GUQZIoD7a!>C_R2bV&WJ!2`W!ga4`=86YAa3 z0D6^cU7w`j3J3(o>s{*Y(XU+yEbv|0Ih|VXLVbh4@SgZ8?WC4^cM`*TchVIqdSLj; zCGNI}K;9E~6B^0m#A;!wcZZ~P;iH81fl}{2kkm{`A|z1i-GFetJBj-x>y^B%e zXij^z3>QT(P|aCBd~+|5$263Ji^@WgXYA&*OE(}Cfdl33arQx_;2|m7Hs0NvVA^07 tRMNrWmrs;?D`O1$7}T%a*7F{6@DD%Je2PPL64U?y002ovPDHLkV1kKHqu>Al literal 0 HcmV?d00001 diff --git a/src/gui/src/ServerConfigDialogBase.ui b/src/gui/src/ServerConfigDialogBase.ui index 186a77782..edc2113e9 100644 --- a/src/gui/src/ServerConfigDialogBase.ui +++ b/src/gui/src/ServerConfigDialogBase.ui @@ -17,7 +17,7 @@ - 0 + 3 @@ -823,7 +823,7 @@ Double click on a screen to edit its settings. - 95 + 40 0 @@ -866,6 +866,22 @@ Double click on a screen to edit its settings. + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + @@ -898,12 +914,31 @@ Double click on a screen to edit its settings. - 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/SettingsDialogBase.ui b/src/gui/src/SettingsDialogBase.ui index f21820257..0d6bba8e4 100644 --- a/src/gui/src/SettingsDialogBase.ui +++ b/src/gui/src/SettingsDialogBase.ui @@ -6,8 +6,8 @@ 0 0 - 400 - 757 + 404 + 737 @@ -45,229 +45,6 @@ - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 20 - 6 - - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 20 - 10 - - - - - - - - 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 - - - - - - - - - - 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 - - - 0 - - - - As Needed - - - - - Always - - - - - Never - - - - - - - - Elevate - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - @@ -295,7 +72,7 @@ - 2 + 6 9 @@ -307,7 +84,7 @@ 9 - 3 + 9 @@ -397,12 +174,38 @@ - + + + + 0 + 0 + + + + + PointingHandCursor + + + margin: 0px; padding: 0px; + - Browse + + + + + :/res/icons/64x64/folder.png:/res/icons/64x64/folder.png + + + + 20 + 13 + + + + true @@ -438,130 +241,37 @@ - - - - - 0 - 0 - + + + + Qt::Vertical - - - true - + + QSizePolicy::Minimum - - QGroupBox::title { - left: 0px; - top: -2px; -} + + + 20 + 8 + - - Logs + + + + + + Qt::Vertical - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + QSizePolicy::Minimum - - false + + + 20 + 10 + - - - 6 - - - 16 - - - 6 - - - - - Log path - - - - - - - - Info - - - - - Debug - - - - - Debug1 - - - - - Debug2 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - false - - - - - - - - 0 - 0 - - - - &Level - - - m_pComboLogLevel - - - - - - - false - - - Browse... - - - - - - - Log to file - - - - - + @@ -579,22 +289,6 @@ - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 20 - 8 - - - - @@ -621,7 +315,7 @@ 9 - 6 + 9 @@ -768,14 +462,398 @@ font-weight: bold; + + + + 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 + + + 0 + + + + As Needed + + + + + Always + + + + + Never + + + + + + + + Elevate + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + 0 + 0 + + + + + true + + + + QGroupBox::title { + left: 0px; + top: -2px; +} + + + Logs + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + false + + + + 6 + + + 16 + + + 6 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + &Level + + + m_pComboLogLevel + + + + + + + + Info + + + + + Debug + + + + + Debug1 + + + + + Debug2 + + + + + + + + Log to file + + + + + + + 3 + + + 0 + + + + + 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 + + + + + + + + m_pRadioUserScope m_pCheckBoxAutoConfig - m_pLineEditLogFilename - + + + buttonBox From db2cb8954d1bc0ed66a270bfcea08c3b3f230982 Mon Sep 17 00:00:00 2001 From: Serhii Hadzhilov Date: Thu, 15 Apr 2021 16:02:37 +0300 Subject: [PATCH 08/12] SYNERGY-799 Update security controls enabling logic --- src/gui/src/ServerConfigDialogBase.ui | 2 +- src/gui/src/SettingsDialog.cpp | 32 ++++++++++++++++++--------- src/gui/src/SettingsDialogBase.ui | 6 ++--- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/src/gui/src/ServerConfigDialogBase.ui b/src/gui/src/ServerConfigDialogBase.ui index edc2113e9..bed456ad2 100644 --- a/src/gui/src/ServerConfigDialogBase.ui +++ b/src/gui/src/ServerConfigDialogBase.ui @@ -17,7 +17,7 @@ - 3 + 0 diff --git a/src/gui/src/SettingsDialog.cpp b/src/gui/src/SettingsDialog.cpp index 5662abbcd..05555d33e 100644 --- a/src/gui/src/SettingsDialog.cpp +++ b/src/gui/src/SettingsDialog.cpp @@ -208,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()); @@ -235,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&) @@ -287,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() { @@ -345,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 0d6bba8e4..019d620f9 100644 --- a/src/gui/src/SettingsDialogBase.ui +++ b/src/gui/src/SettingsDialogBase.ui @@ -115,7 +115,7 @@ - + Key length @@ -151,7 +151,7 @@ 0 - + Certificate @@ -776,7 +776,7 @@ font-weight: bold; 0 - + Log path From 3fabb2c294d58cf73fd1a0390f01f0efcf9d0c8c Mon Sep 17 00:00:00 2001 From: Serhii Hadzhilov Date: Thu, 15 Apr 2021 17:59:03 +0300 Subject: [PATCH 09/12] SYNERGY-799 Don't select type by default --- src/gui/src/AppConfig.cpp | 2 +- src/gui/src/MainWindow.cpp | 64 +++++++++++++++++++++-------------- src/gui/src/MainWindow.h | 6 ++-- src/gui/src/MainWindowBase.ui | 3 ++ 4 files changed, 47 insertions(+), 28 deletions(-) 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..b3b8ad2ce 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()); } @@ -1365,18 +1363,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 +1402,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 From 65889f809b22303fac23f90c9ce716cd85f03e84 Mon Sep 17 00:00:00 2001 From: Serhii Hadzhilov Date: Thu, 15 Apr 2021 18:25:36 +0300 Subject: [PATCH 10/12] SYNERGY-799 Fixed issue with screen name validation --- src/gui/src/validators/ScreenDuplicationsValidator.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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; From 8c9a261ed5097769173527693dbc199d1046dd31 Mon Sep 17 00:00:00 2001 From: Serhii Hadzhilov Date: Thu, 15 Apr 2021 18:54:01 +0300 Subject: [PATCH 11/12] SYNERGY-799 Fix code smell. Removed unused autoconfig function. --- ChangeLog | 1 + src/gui/src/MainWindow.cpp | 42 -------------------------------------- src/gui/src/MainWindow.h | 1 - 3 files changed, 1 insertion(+), 43 deletions(-) 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/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp index b3b8ad2ce..8ea7374e5 100644 --- a/src/gui/src/MainWindow.cpp +++ b/src/gui/src/MainWindow.cpp @@ -130,7 +130,6 @@ MainWindow::MainWindow (AppConfig& appConfig, m_pLabelScreenName->setText(appConfig.screenName()); connect(m_AppConfig, SIGNAL(screenNameChanged()), this, SLOT(updateScreenName())); - m_pLabelIpAddresses->setText(getIPAddresses()); #if defined(Q_OS_WIN) // ipc must always be enabled, so that we can disable command when switching to desktop mode. @@ -1039,42 +1038,6 @@ void MainWindow::setVisible(bool visible) #endif } -QString MainWindow::getIPAddresses() -{ - QList addresses = QNetworkInterface::allAddresses(); - - bool hinted = false; - QString result; - for (int i = 0; i < addresses.size(); i++) { - if (addresses[i].protocol() == QAbstractSocket::IPv4Protocol && - addresses[i] != QHostAddress(QHostAddress::LocalHost)) { - - QString address = addresses[i].toString(); - QString format = "%1, "; - - // 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")) { - hinted = true; - format = "%1, "; - } - //Prevent self assigned IPs being displayed - if (!address.startsWith("169.254")) { - result += format.arg(address); - } - } - } - - if (result == "") { - return tr("Unknown"); - } - - // remove trailing comma. - result.chop(2); - - return result; -} - void MainWindow::changeEvent(QEvent* event) { if (event != 0) @@ -1103,11 +1066,6 @@ void MainWindow::changeEvent(QEvent* event) void MainWindow::addZeroconfServer(const QString name) { - // don't add yourself to the server list. - if (getIPAddresses().contains(name)) { - return; - } - if (m_pComboServerList->findText(name) == -1) { m_pComboServerList->addItem(name); } diff --git a/src/gui/src/MainWindow.h b/src/gui/src/MainWindow.h index 55397f0b7..2b5bc0aac 100644 --- a/src/gui/src/MainWindow.h +++ b/src/gui/src/MainWindow.h @@ -182,7 +182,6 @@ public slots: void setStatus(const QString& status); void sendIpcMessage(qIpcMessageType type, const char* buffer, bool showErrors); void updateFromLogLine(const QString& line); - QString getIPAddresses(); void stopService(); void stopDesktop(); void changeEvent(QEvent* event); From 32bb5cbd7fcb7e616a6fe433e0521d9d87e07ed6 Mon Sep 17 00:00:00 2001 From: Serhii Hadzhilov Date: Fri, 16 Apr 2021 14:41:36 +0300 Subject: [PATCH 12/12] SYNERGY-799 Restore lost functionality --- src/gui/src/MainWindow.cpp | 38 ++++++++++++++++++++++++++++++++++++++ src/gui/src/MainWindow.h | 1 + 2 files changed, 39 insertions(+) diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp index 8ea7374e5..6bd477633 100644 --- a/src/gui/src/MainWindow.cpp +++ b/src/gui/src/MainWindow.cpp @@ -130,6 +130,7 @@ MainWindow::MainWindow (AppConfig& appConfig, m_pLabelScreenName->setText(appConfig.screenName()); connect(m_AppConfig, SIGNAL(screenNameChanged()), this, SLOT(updateScreenName())); + m_pLabelIpAddresses->setText(getIPAddresses()); #if defined(Q_OS_WIN) // ipc must always be enabled, so that we can disable command when switching to desktop mode. @@ -1038,6 +1039,38 @@ void MainWindow::setVisible(bool visible) #endif } +QString MainWindow::getIPAddresses() +{ + QStringList result; + bool hinted = false; + const auto localnet = QHostAddress::parseSubnet("192.168.0.0/16"); + const QList addresses = QNetworkInterface::allAddresses(); + + 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.isInSubnet(localnet)) { + QString format = "%1"; + result.append(format.arg(address.toString())); + hinted = true; + } + else { + result.append(address.toString()); + } + } + } + + if (result.isEmpty()) { + result.append(tr("Unknown")); + } + + return result.join(", "); +} + void MainWindow::changeEvent(QEvent* event) { if (event != 0) @@ -1066,6 +1099,11 @@ void MainWindow::changeEvent(QEvent* event) void MainWindow::addZeroconfServer(const QString name) { + // don't add yourself to the server list. + if (getIPAddresses().contains(name)) { + return; + } + if (m_pComboServerList->findText(name) == -1) { m_pComboServerList->addItem(name); } diff --git a/src/gui/src/MainWindow.h b/src/gui/src/MainWindow.h index 2b5bc0aac..55397f0b7 100644 --- a/src/gui/src/MainWindow.h +++ b/src/gui/src/MainWindow.h @@ -182,6 +182,7 @@ public slots: void setStatus(const QString& status); void sendIpcMessage(qIpcMessageType type, const char* buffer, bool showErrors); void updateFromLogLine(const QString& line); + QString getIPAddresses(); void stopService(); void stopDesktop(); void changeEvent(QEvent* event);