From 5bd65b54264097aa065d7b7ceaa1f4edd81f1e8b Mon Sep 17 00:00:00 2001 From: Xinyu Hou Date: Wed, 12 Nov 2014 14:21:54 +0000 Subject: [PATCH] Added download Bonjour code --- src/gui/src/MainWindow.cpp | 11 ++++++++++- src/gui/src/MainWindow.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp index de6ff520..8d152f4e 100644 --- a/src/gui/src/MainWindow.cpp +++ b/src/gui/src/MainWindow.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #if defined(Q_OS_MAC) #include @@ -48,6 +49,7 @@ #if defined(Q_OS_WIN) static const char synergyConfigName[] = "synergy.sgc"; static const QString synergyConfigFilter(QObject::tr("Synergy Configurations (*.sgc);;All files (*.*)")); +static const char BonjourUrl[] = "http://synergy-project.org/bonjour/BonjourPSSetup.exe"; #else static const char synergyConfigName[] = "synergy.conf"; static const QString synergyConfigFilter(QObject::tr("Synergy Configurations (*.conf);;All files (*.*)")); @@ -907,7 +909,7 @@ void MainWindow::on_m_pAutoConnectCheckBox_toggled(bool checked) QMessageBox::Yes | QMessageBox::No); if (r == QMessageBox::Yes) { - + downloadBonjour(); } else { m_pAutoConnectCheckBox->setChecked(false); @@ -969,3 +971,10 @@ bool MainWindow::isBonjourRunning() return result; } + +void MainWindow::downloadBonjour() +{ +#if defined(Q_OS_WIN) + QDesktopServices::openUrl(QUrl(BonjourUrl)); +#endif +} diff --git a/src/gui/src/MainWindow.h b/src/gui/src/MainWindow.h index 20cd3739..7e51267e 100644 --- a/src/gui/src/MainWindow.h +++ b/src/gui/src/MainWindow.h @@ -148,6 +148,7 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase void retranslateMenuBar(); bool isServiceRunning(QString name); bool isBonjourRunning(); + void downloadBonjour(); private: QSettings& m_Settings;