Stopped old process before start a new one #4908

This commit is contained in:
Jerry 2015-07-30 15:52:14 -07:00 committed by Jerry (Xinyu Hou)
parent e472e47815
commit d70c19b099
2 changed files with 12 additions and 12 deletions

View File

@ -451,19 +451,13 @@ void MainWindow::checkFingerprint(const QString& line)
.arg(fingerprint), .arg(fingerprint),
QMessageBox::Yes | QMessageBox::No); QMessageBox::Yes | QMessageBox::No);
stopSynergy();
if (fingerprintReply == QMessageBox::Yes) { if (fingerprintReply == QMessageBox::Yes) {
// restart core process after trusting fingerprint. // restart core process after trusting fingerprint.
Fingerprint::trustedServers().trust(fingerprint); Fingerprint::trustedServers().trust(fingerprint);
startSynergy(); 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() bool MainWindow::autoHide()
@ -483,6 +477,12 @@ QString MainWindow::getTimeStamp()
return '[' + current.toString(Qt::ISODate) + ']'; return '[' + current.toString(Qt::ISODate) + ']';
} }
void MainWindow::restartSynergy()
{
stopSynergy();
startSynergy();
}
void MainWindow::clearLog() void MainWindow::clearLog()
{ {
m_pLogOutput->clear(); m_pLogOutput->clear();
@ -1072,7 +1072,7 @@ void MainWindow::autoAddScreen(const QString name)
} }
} }
else { else {
startSynergy(); restartSynergy();
} }
} }
} }
@ -1097,8 +1097,7 @@ void MainWindow::on_m_pActionWizard_triggered()
void MainWindow::on_m_pButtonApply_clicked() void MainWindow::on_m_pButtonApply_clicked()
{ {
stopSynergy(); restartSynergy();
startSynergy();
} }
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
@ -1282,7 +1281,7 @@ void MainWindow::updateEdition()
void MainWindow::on_m_pComboServerList_currentIndexChanged(QString ) void MainWindow::on_m_pComboServerList_currentIndexChanged(QString )
{ {
if (m_pComboServerList->count() != 0) { if (m_pComboServerList->count() != 0) {
startSynergy(); restartSynergy();
} }
} }

View File

@ -178,6 +178,7 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
void checkFingerprint(const QString& line); void checkFingerprint(const QString& line);
bool autoHide(); bool autoHide();
QString getTimeStamp(); QString getTimeStamp();
void restartSynergy();
private: private:
QSettings& m_Settings; QSettings& m_Settings;