From 6080b6937dcae7f9771d78cc018f03616dae441a Mon Sep 17 00:00:00 2001 From: Andrey Batyiev Date: Mon, 24 May 2021 16:06:16 +0300 Subject: [PATCH] Synergy 907 client tray language switcher reverts to en (#7014) * SYNERGY-907 Client tray language switcher reverts to EN *Fix checkbox spelling * SYNERGY-907 Client tray language switcher reverts to EN *Update changelog * SYNERGY-907 Client tray language switcher reverts to EN *Temporary disable language sync logic * SYNERGY-907 client tray language switcher reverts to en *Update changelog * Synergy 907 client tray language switcher reverts to en *Fix sonar * Synergy 907 client tray language switcher reverts to en *Fix sonar * Synergy 907 client tray language switcher reverts to en *Fix chnagelog Co-authored-by: Andrii Batyiev --- ChangeLog | 1 + src/gui/src/AppConfig.cpp | 3 --- src/gui/src/AppConfig.h | 3 +-- src/gui/src/MainWindow.cpp | 5 ----- src/gui/src/SettingsDialog.cpp | 9 +++------ src/lib/synergy/ArgParser.cpp | 3 --- src/lib/synergy/ArgsBase.h | 2 +- src/lib/synergy/KeyMap.cpp | 3 +++ 8 files changed, 9 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 43ae93435..7de5e081c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20,6 +20,7 @@ Bug fixes: - #7010 Fix Ubuntu 16.04 pipeline in Azure - #7011 Fix language synchronisation checkbox spelling - #7013 Wrong connection pop up appears if the user connects using a domain name which is assigned to list of IP's +- #7014 Temporary disable language sync logic Enhancements: - #6954 Move language selection to advanced section diff --git a/src/gui/src/AppConfig.cpp b/src/gui/src/AppConfig.cpp index f5404bbcc..c85840d5a 100644 --- a/src/gui/src/AppConfig.cpp +++ b/src/gui/src/AppConfig.cpp @@ -77,7 +77,6 @@ const char* AppConfig::m_SynergySettingsName[] = { "serverHostname", "tlsCertPath", "tlsKeyLength", - "languageSync", }; static const char* logLevelNames[] = @@ -240,7 +239,6 @@ void AppConfig::loadSettings() m_UseInternalConfig = loadSetting(kUseInternalConfig, false).toBool(); m_ClientGroupChecked = loadSetting(kGroupClientCheck, false).toBool(); m_ServerHostname = loadSetting(kServerHostname).toString(); - m_LanguageSync = loadSetting(kLanguageSync, false).toBool(); //only change the serial key if the settings being loaded contains a key bool updateSerial = ConfigWriter::make() @@ -301,7 +299,6 @@ void AppConfig::saveSettings() setSetting(kUseInternalConfig, m_UseInternalConfig); setSetting(kGroupClientCheck, m_ClientGroupChecked); setSetting(kServerHostname, m_ServerHostname); - setSetting(kLanguageSync, m_LanguageSync); } m_unsavedChanges = false; diff --git a/src/gui/src/AppConfig.h b/src/gui/src/AppConfig.h index 6fdcd2320..b5d1dfa73 100644 --- a/src/gui/src/AppConfig.h +++ b/src/gui/src/AppConfig.h @@ -202,7 +202,6 @@ protected: kServerHostname, kTLSCertPath, kTLSKeyLength, - kLanguageSync }; void setScreenName(const QString& s); @@ -245,7 +244,7 @@ protected: int m_LastExpiringWarningTime; bool m_ActivationHasRun; bool m_MinimizeToTray; - bool m_LanguageSync = false; + bool m_LanguageSync = true; bool m_ServerGroupChecked; bool m_UseExternalConfig; diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp index 398d1d4a6..850007254 100644 --- a/src/gui/src/MainWindow.cpp +++ b/src/gui/src/MainWindow.cpp @@ -753,11 +753,6 @@ bool MainWindow::clientArgs(QStringList& args, QString& app) args << "--log" << appConfig().logFilenameCmd(); } - if (appConfig().getLanguageSync()) - { - args << "--sync-language"; - } - #if !defined(SYNERGY_ENTERPRISE) && defined(SYNERGY_AUTOCONFIG) // check auto config first, if it is disabled or no server detected, diff --git a/src/gui/src/SettingsDialog.cpp b/src/gui/src/SettingsDialog.cpp index 0c5429798..15f98449a 100644 --- a/src/gui/src/SettingsDialog.cpp +++ b/src/gui/src/SettingsDialog.cpp @@ -52,7 +52,9 @@ SettingsDialog::SettingsDialog(QWidget* parent, AppConfig& config) : buttonBox->button(QDialogButtonBox::Save)->setEnabled(false); enableControls(appConfig().isWritable()); - m_pCheckBoxLanguageSync->setVisible(m_pMainWindow->synergyType() == MainWindow::synergyClient); + //temporary disable language sync logic + m_pCheckBoxLanguageSync->setVisible(false); + const auto& serveConfig = m_pMainWindow->serverConfig(); m_pLineEditScreenName->setValidator(new validators::ScreenNameValidator(m_pLineEditScreenName, m_pLabelNameError, (&serveConfig.screens()))); @@ -62,7 +64,6 @@ SettingsDialog::SettingsDialog(QWidget* parent, AppConfig& config) : connect(m_pCheckBoxAutoConfig, SIGNAL(clicked()), this, SLOT(onChange())); connect(m_pCheckBoxMinimizeToTray, SIGNAL(clicked()), this, SLOT(onChange())); connect(m_pCheckBoxAutoHide, SIGNAL(clicked()), this, SLOT(onChange())); - connect(m_pCheckBoxLanguageSync, SIGNAL(clicked()), this, SLOT(onChange())); connect(m_pLineEditInterface, SIGNAL(textEdited(QString)), this, SLOT(onChange())); connect(m_pSpinBoxPort, SIGNAL(valueChanged(int)), this, SLOT(onChange())); connect(m_pLineEditScreenName, SIGNAL(textEdited(QString)), this, SLOT(onChange())); @@ -83,7 +84,6 @@ void SettingsDialog::accept() appConfig().setLanguage(m_pComboLanguage->itemData(m_pComboLanguage->currentIndex()).toString()); appConfig().setElevateMode(static_cast(m_pComboElevate->currentIndex())); appConfig().setAutoHide(m_pCheckBoxAutoHide->isChecked()); - appConfig().setLanguageSync(m_pCheckBoxLanguageSync->isChecked()); appConfig().setAutoConfig(m_pCheckBoxAutoConfig->isChecked()); appConfig().setMinimizeToTray(m_pCheckBoxMinimizeToTray->isChecked()); appConfig().setTLSCertPath(m_pLineEditCertificatePath->text()); @@ -142,7 +142,6 @@ void SettingsDialog::loadFromConfig() { m_pLineEditLogFilename->setText(appConfig().logFilename()); setIndexFromItemData(m_pComboLanguage, appConfig().language()); m_pCheckBoxAutoHide->setChecked(appConfig().getAutoHide()); - m_pCheckBoxLanguageSync->setChecked(appConfig().getLanguageSync()); m_pCheckBoxMinimizeToTray->setChecked(appConfig().getMinimizeToTray()); m_pLineEditCertificatePath->setText(appConfig().getTLSCertPath()); m_pCheckBoxEnableCrypto->setChecked(m_appConfig.getCryptoEnabled()); @@ -330,7 +329,6 @@ bool SettingsDialog::isModified() || appConfig().language() != m_pComboLanguage->itemData(m_pComboLanguage->currentIndex()).toString() || appConfig().elevateMode() != static_cast(m_pComboElevate->currentIndex()) || appConfig().getAutoHide() != m_pCheckBoxAutoHide->isChecked() - || appConfig().getLanguageSync() != m_pCheckBoxLanguageSync->isChecked() || appConfig().autoConfig() != m_pCheckBoxAutoConfig->isChecked() || appConfig().getMinimizeToTray() != m_pCheckBoxMinimizeToTray->isChecked() || appConfig().getTLSCertPath() != m_pLineEditCertificatePath->text() @@ -349,7 +347,6 @@ void SettingsDialog::enableControls(bool enable) { m_pComboLanguage->setEnabled(enable); m_pComboElevate->setEnabled(enable); m_pCheckBoxAutoHide->setEnabled(enable); - m_pCheckBoxLanguageSync->setEnabled(enable); m_pCheckBoxAutoConfig->setEnabled(enable); m_pCheckBoxMinimizeToTray->setEnabled(enable); m_pLineEditCertificatePath->setEnabled(enable); diff --git a/src/lib/synergy/ArgParser.cpp b/src/lib/synergy/ArgParser.cpp index 0da591325..222d96427 100644 --- a/src/lib/synergy/ArgParser.cpp +++ b/src/lib/synergy/ArgParser.cpp @@ -101,9 +101,6 @@ ArgParser::parseClientArgs(lib::synergy::ClientArgs& args, int argc, const char* ++i; continue; } - else if (isArg(i, argc, argv, nullptr, "--sync-language")) { - argsBase().m_enableLangSync = true; - } else if (isArg(i, argc, argv, nullptr, "--camp")) { // ignore -- included for backwards compatibility } diff --git a/src/lib/synergy/ArgsBase.h b/src/lib/synergy/ArgsBase.h index c03fb241e..a388d3191 100644 --- a/src/lib/synergy/ArgsBase.h +++ b/src/lib/synergy/ArgsBase.h @@ -57,7 +57,7 @@ namespace lib { String m_profileDirectory; /// @brief The profile DIR to use for the application String m_pluginDirectory; /// @brief //TODO Plugins? Get set in ARCH but doesn't seem to get used String m_tlsCertFile; /// @brief Contains the location of the TLS certificate file - bool m_enableLangSync = false; /// @brief Should keyboard input be in same language as on server + bool m_enableLangSync = true; /// @brief Should keyboard input be in same language as on server #if SYSAPI_WIN32 bool m_debugServiceWait = false; diff --git a/src/lib/synergy/KeyMap.cpp b/src/lib/synergy/KeyMap.cpp index 6950a160f..824636133 100644 --- a/src/lib/synergy/KeyMap.cpp +++ b/src/lib/synergy/KeyMap.cpp @@ -612,6 +612,8 @@ KeyMap::mapCharacterKey(Keystrokes& keys, KeyID id, SInt32 group, if (i == m_keyIDMap.end()) { // unknown key LOG((CLOG_DEBUG1 "key %04x is not on keyboard", id)); + + return NULL; } const KeyGroupTable& keyGroupTable = i->second; @@ -763,6 +765,7 @@ KeyMap::keysForKeyItem(const KeyItem& keyItem, SInt32& group, KeyModifierAltGr | KeyModifierNumLock | KeyModifierScrollLock; // add keystrokes to adjust the group + if (App::instance().argsBase().m_enableLangSync && group != keyItem.m_group) { group = keyItem.m_group;