diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp index 76909e46..de6ff520 100644 --- a/src/gui/src/MainWindow.cpp +++ b/src/gui/src/MainWindow.cpp @@ -75,7 +75,8 @@ MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig) : m_pMenuEdit(NULL), m_pMenuWindow(NULL), m_pMenuHelp(NULL), - m_pZeroconfService(NULL) + m_pZeroconfService(NULL), + m_SuppressBonjourWarning(appConfig.autoConnect()) { setupUi(this); @@ -105,8 +106,6 @@ MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig) : setMinimumSize(size()); #endif - updateZeroconfService(); - m_pAutoConnectCheckBox->setChecked(appConfig.autoConnect()); } @@ -894,6 +893,28 @@ void MainWindow::on_m_pButtonApply_clicked() void MainWindow::on_m_pAutoConnectCheckBox_toggled(bool checked) { + if (!isBonjourRunning() && checked) { + if (m_SuppressBonjourWarning) { + m_pAutoConnectCheckBox->setChecked(false); + m_SuppressBonjourWarning = false; + return; + } + + int r = QMessageBox::warning( + this, tr("Synergy"), + tr("Auto connect feature requires Bonjour installed.\n\n" + "Do you want to install Bonjour?"), + QMessageBox::Yes | QMessageBox::No); + + if (r == QMessageBox::Yes) { + + } + else { + m_pAutoConnectCheckBox->setChecked(false); + return; + } + } + m_pLineEditHostname->setDisabled(checked); appConfig().setAutoConnect(checked); updateZeroconfService(); diff --git a/src/gui/src/MainWindow.h b/src/gui/src/MainWindow.h index 1221211f..20cd3739 100644 --- a/src/gui/src/MainWindow.h +++ b/src/gui/src/MainWindow.h @@ -167,6 +167,7 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase QMenu* m_pMenuWindow; QMenu* m_pMenuHelp; ZeroconfService* m_pZeroconfService; + bool m_SuppressBonjourWarning; private slots: void on_m_pAutoConnectCheckBox_toggled(bool checked);