diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp index 775ae5bb..60adc5f3 100644 --- a/src/gui/src/MainWindow.cpp +++ b/src/gui/src/MainWindow.cpp @@ -451,19 +451,13 @@ void MainWindow::checkFingerprint(const QString& line) .arg(fingerprint), QMessageBox::Yes | QMessageBox::No); + stopSynergy(); + if (fingerprintReply == QMessageBox::Yes) { // restart core process after trusting fingerprint. Fingerprint::trustedServers().trust(fingerprint); startSynergy(); } - else { - // on all platforms, the core process will stop if the - // fingerprint is not trusted, so technically the stop - // isn't really needed. however on windows, the core - // process will keep trying (and failing) unless we - // tell it to stop. - stopSynergy(); - } } bool MainWindow::autoHide() @@ -483,6 +477,12 @@ QString MainWindow::getTimeStamp() return '[' + current.toString(Qt::ISODate) + ']'; } +void MainWindow::restartSynergy() +{ + stopSynergy(); + startSynergy(); +} + void MainWindow::clearLog() { m_pLogOutput->clear(); @@ -1072,7 +1072,7 @@ void MainWindow::autoAddScreen(const QString name) } } else { - startSynergy(); + restartSynergy(); } } } @@ -1097,8 +1097,7 @@ void MainWindow::on_m_pActionWizard_triggered() void MainWindow::on_m_pButtonApply_clicked() { - stopSynergy(); - startSynergy(); + restartSynergy(); } #if defined(Q_OS_WIN) @@ -1282,7 +1281,7 @@ void MainWindow::updateEdition() void MainWindow::on_m_pComboServerList_currentIndexChanged(QString ) { if (m_pComboServerList->count() != 0) { - startSynergy(); + restartSynergy(); } } diff --git a/src/gui/src/MainWindow.h b/src/gui/src/MainWindow.h index 5f0035ac..c159747a 100644 --- a/src/gui/src/MainWindow.h +++ b/src/gui/src/MainWindow.h @@ -178,6 +178,7 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase void checkFingerprint(const QString& line); bool autoHide(); QString getTimeStamp(); + void restartSynergy(); private: QSettings& m_Settings;