Added download Bonjour code
This commit is contained in:
parent
330121ce55
commit
5bd65b5426
|
@ -35,6 +35,7 @@
|
||||||
#include <QMenuBar>
|
#include <QMenuBar>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
#include <QDesktopServices>
|
||||||
|
|
||||||
#if defined(Q_OS_MAC)
|
#if defined(Q_OS_MAC)
|
||||||
#include <ApplicationServices/ApplicationServices.h>
|
#include <ApplicationServices/ApplicationServices.h>
|
||||||
|
@ -48,6 +49,7 @@
|
||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
static const char synergyConfigName[] = "synergy.sgc";
|
static const char synergyConfigName[] = "synergy.sgc";
|
||||||
static const QString synergyConfigFilter(QObject::tr("Synergy Configurations (*.sgc);;All files (*.*)"));
|
static const QString synergyConfigFilter(QObject::tr("Synergy Configurations (*.sgc);;All files (*.*)"));
|
||||||
|
static const char BonjourUrl[] = "http://synergy-project.org/bonjour/BonjourPSSetup.exe";
|
||||||
#else
|
#else
|
||||||
static const char synergyConfigName[] = "synergy.conf";
|
static const char synergyConfigName[] = "synergy.conf";
|
||||||
static const QString synergyConfigFilter(QObject::tr("Synergy Configurations (*.conf);;All files (*.*)"));
|
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);
|
QMessageBox::Yes | QMessageBox::No);
|
||||||
|
|
||||||
if (r == QMessageBox::Yes) {
|
if (r == QMessageBox::Yes) {
|
||||||
|
downloadBonjour();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_pAutoConnectCheckBox->setChecked(false);
|
m_pAutoConnectCheckBox->setChecked(false);
|
||||||
|
@ -969,3 +971,10 @@ bool MainWindow::isBonjourRunning()
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::downloadBonjour()
|
||||||
|
{
|
||||||
|
#if defined(Q_OS_WIN)
|
||||||
|
QDesktopServices::openUrl(QUrl(BonjourUrl));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
|
@ -148,6 +148,7 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
|
||||||
void retranslateMenuBar();
|
void retranslateMenuBar();
|
||||||
bool isServiceRunning(QString name);
|
bool isServiceRunning(QString name);
|
||||||
bool isBonjourRunning();
|
bool isBonjourRunning();
|
||||||
|
void downloadBonjour();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QSettings& m_Settings;
|
QSettings& m_Settings;
|
||||||
|
|
Loading…
Reference in New Issue