From aec76ce0835448f6745da8d530b9c0404b5670bf Mon Sep 17 00:00:00 2001 From: Nick Bolton Date: Fri, 13 Jul 2012 14:00:42 +0000 Subject: [PATCH] fixed: gui doesn't connect to service on first load. --- src/gui/src/MainWindow.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp index f1ddba9a..4a17cd84 100644 --- a/src/gui/src/MainWindow.cpp +++ b/src/gui/src/MainWindow.cpp @@ -78,14 +78,6 @@ MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig) : m_SetupWizard = new SetupWizard(*this, false); connect(m_SetupWizard, SIGNAL(finished(int)), this, SLOT(refreshStartButton())); - - if (appConfig.processMode() == Service) - { - 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&))); - m_IpcClient.connectToHost(); - } } MainWindow::~MainWindow() @@ -99,8 +91,19 @@ void MainWindow::start(bool firstRun) { refreshStartButton(); - if (!firstRun && appConfig().autoConnect() && appConfig().processMode() == Desktop) + if (appConfig().processMode() == Service) + { + 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&))); + m_IpcClient.connectToHost(); startSynergy(); + } + + if (appConfig().processMode() == Desktop && !firstRun && appConfig().autoConnect()) + { + startSynergy(); + } createTrayIcon();