SYNERGY-1287 display language notifications only on client side (#7111)

* SYNERGY-1287 Display language notification only on client side

* SYNERGY-1287 Always show notification on the client side

* Update ChangeLog

* Fix doxygen job
This commit is contained in:
SerhiiGadzhilov 2021-10-21 13:48:40 +03:00 committed by GitHub
parent 5e2d355a3a
commit 940e2ecd20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 11 additions and 41 deletions

View file

@ -3,7 +3,7 @@ jobs:
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master') condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
pool: pool:
vmImage: 'ubuntu-16.04' vmImage: 'ubuntu-latest'
steps: steps:
- script: | - script: |

View file

@ -2,7 +2,7 @@ v1.14.2-snapshot
=========== ===========
Bug fixes: Bug fixes:
- #7070 Fix radio button shifted focus on macOS - #7070 Fix radio button shifted focus on macOS
- #7038 | #7104 Fix client and server different keyboard layout errors - #7038 | #7104 | #7111 Fix client and server different keyboard layout errors
- #7078 Fix clipboard re-enables automatically - #7078 Fix clipboard re-enables automatically
- #7077 Fix Ubuntu, CentOS and Debian build after SYNERGY-1161 - #7077 Fix Ubuntu, CentOS and Debian build after SYNERGY-1161
- #7080 Add trace if the system can't open file with trusted fingerprints - #7080 Add trace if the system can't open file with trusted fingerprints

View file

@ -752,10 +752,7 @@ Client::handleHello(const Event&, void*)
// say hello back // say hello back
LOG((CLOG_DEBUG1 "say hello version %d.%d", helloBackMajor, helloBackMinor)); LOG((CLOG_DEBUG1 "say hello version %d.%d", helloBackMajor, helloBackMinor));
auto localLanguages = m_languageManager.getSerializedLocalLanguages(); ProtocolUtil::writef(m_stream, kMsgHelloBack, helloBackMajor, helloBackMinor, &m_name);
ProtocolUtil::writef(m_stream, kMsgHelloBack,
helloBackMajor,
helloBackMinor, & m_name, &localLanguages);
// now connected but waiting to complete handshake // now connected but waiting to complete handshake
setupScreen(); setupScreen();
@ -820,15 +817,11 @@ Client::onFileRecieveCompleted()
void void
Client::checkMissedLanguages() const Client::checkMissedLanguages() const
{ {
if (m_args.m_enableLangSync) { auto missedLanguages = m_languageManager.getMissedLanguages();
auto missedLanguages = m_languageManager.getMissedLanguages(); if (!missedLanguages.empty()) {
if (!missedLanguages.empty()) { AppUtil::instance().showNotification("Language synchronization error",
AppUtil::instance().showNotification("Language synchronization error", "You need to install these languages on this computer to enable support for multiple languages: "
"These languages are required for the client to work: " + missedLanguages); + missedLanguages);
}
}
else {
LOG((CLOG_DEBUG "Language sync logic is disabled."));
} }
} }

View file

@ -194,13 +194,9 @@ ClientProxyUnknown::handleData(const Event&, void*)
// parse the reply to hello // parse the reply to hello
SInt16 major, minor; SInt16 major, minor;
String remoteLanguages; if (!ProtocolUtil::readf(m_stream, kMsgHelloBack, &major, &minor, &name)) {
if (!ProtocolUtil::readf(m_stream, kMsgHelloBack,
&major, &minor, &name, &remoteLanguages)) {
throw XBadClient(); throw XBadClient();
} }
m_languageManager.setRemoteLanguages(remoteLanguages);
m_server->setLanguageManager(m_languageManager);
// disallow invalid version numbers // disallow invalid version numbers
if (major <= 0 || minor < 0) { if (major <= 0 || minor < 0) {

View file

@ -348,8 +348,6 @@ Server::adoptClient(BaseClientProxy* client)
client->screensaver(true); client->screensaver(true);
} }
checkMissedLanguages();
// send notification // send notification
Server::ScreenConnectedInfo* info = Server::ScreenConnectedInfo* info =
new Server::ScreenConnectedInfo(getName(client)); new Server::ScreenConnectedInfo(getName(client));
@ -1933,16 +1931,6 @@ Server::sendDragInfo(BaseClientProxy* newScreen)
} }
} }
void
Server::checkMissedLanguages() const
{
auto missedLanguages = m_languageManager.getMissedLanguages();
if (!missedLanguages.empty()) {
AppUtil::instance().showNotification("Language synchronization error",
"These languages are required for the server to work: " + missedLanguages);
}
}
void void
Server::onMouseMoveSecondary(SInt32 dx, SInt32 dy) Server::onMouseMoveSecondary(SInt32 dx, SInt32 dy)
{ {

View file

@ -157,9 +157,6 @@ public:
//! Store ClientListener pointer //! Store ClientListener pointer
void setListener(ClientListener* p) { m_clientListener = p; } void setListener(ClientListener* p) { m_clientListener = p; }
//! Set language manager
void setLanguageManager(const synergy::languages::LanguageManager& manager) { m_languageManager = manager; }
//@} //@}
//! @name accessors //! @name accessors
//@{ //@{
@ -377,9 +374,6 @@ private:
// send drag info to new client screen // send drag info to new client screen
void sendDragInfo(BaseClientProxy* newScreen); void sendDragInfo(BaseClientProxy* newScreen);
//Shows notification if there are missed languages
void checkMissedLanguages() const;
public: public:
bool m_mock; bool m_mock;
@ -494,5 +488,4 @@ private:
ClientListener* m_clientListener; ClientListener* m_clientListener;
lib::synergy::ServerArgs m_args; lib::synergy::ServerArgs m_args;
synergy::languages::LanguageManager m_languageManager;
}; };

View file

@ -19,7 +19,7 @@
#include "synergy/protocol_types.h" #include "synergy/protocol_types.h"
const char* const kMsgHello = "Synergy%2i%2i%s"; const char* const kMsgHello = "Synergy%2i%2i%s";
const char* const kMsgHelloBack = "Synergy%2i%2i%s%s"; const char* const kMsgHelloBack = "Synergy%2i%2i%s";
const char* const kMsgCNoop = "CNOP"; const char* const kMsgCNoop = "CNOP";
const char* const kMsgCClose = "CBYE"; const char* const kMsgCClose = "CBYE";
const char* const kMsgCEnter = "CINN%2i%2i%4i%2i"; const char* const kMsgCEnter = "CINN%2i%2i%4i%2i";

View file

@ -109,7 +109,7 @@ extern const char* const kMsgHello;
// respond to hello from server; secondary -> primary // respond to hello from server; secondary -> primary
// $1 = protocol major version number supported by client. $2 = // $1 = protocol major version number supported by client. $2 =
// protocol minor version number supported by client. $3 = client // protocol minor version number supported by client. $3 = client
// name. $4 = client language list // name.
extern const char* const kMsgHelloBack; extern const char* const kMsgHelloBack;