SYNERGY-124 - Start synergy if the service is idle (#7015)

* SYNERGY-127 - Start synergy if the service is idle

* SYNERGY-127 - Update changelog

* SYNERGY-127 - Simplify if statement
This commit is contained in:
Igor Sikachyna 2021-05-27 01:05:53 -07:00 committed by GitHub
parent d9b96e1988
commit a7f3b95b4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

View file

@ -32,6 +32,7 @@ Bug fixes:
- #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
- #7015 Fix Windows service not starting up after sleep
Enhancements:
- #6954 Move language selection to advanced section

View file

@ -139,6 +139,7 @@ MainWindow::MainWindow (AppConfig& appConfig,
connect(&m_IpcClient, SIGNAL(readLogLine(const QString&)), this, SLOT(appendLogRaw(const QString&)));
connect(&m_IpcClient, SIGNAL(errorMessage(const QString&)), this, SLOT(appendLogError(const QString&)));
connect(&m_IpcClient, SIGNAL(infoMessage(const QString&)), this, SLOT(appendLogInfo(const QString&)));
connect(&m_IpcClient, SIGNAL(readLogLine(const QString&)), this, SLOT(handleIdleService(const QString&)));
m_IpcClient.connectToHost();
#endif
@ -246,7 +247,7 @@ void MainWindow::open()
// only start if user has previously started. this stops the gui from
// auto hiding before the user has configured synergy (which of course
// confuses first time users, who think synergy has crashed).
if (appConfig().startedBefore() && appConfig().processMode() == Desktop) {
if (appConfig().startedBefore() && appConfig().processMode() == ProcessMode::Desktop) {
startSynergy();
}
}
@ -435,6 +436,16 @@ void MainWindow::appendLogRaw(const QString& text)
}
}
void MainWindow::handleIdleService(const QString& text)
{
foreach(QString line, text.split(QRegExp("\r|\n|\r\n"))) {
// only start if there is no active service running
if (!line.isEmpty() && line.contains("service status: idle") && appConfig().startedBefore()) {
startSynergy();
}
}
}
void MainWindow::updateFromLogLine(const QString &line)
{
// TODO: This shouldn't be updating from log needs a better way of doing this

View file

@ -144,6 +144,7 @@ public slots:
void startSynergy();
void retryStart(); // If the connection failed this will retry a startSynergy
void actionStart();
void handleIdleService(const QString& text);
protected slots:
void updateLocalFingerprint();