#6301 Disable zeroconf for Enterprise builds

This commit is contained in:
Andrew Nelless 2018-06-07 16:23:35 +01:00 committed by Nick Bolton
parent b396b1092d
commit 458d8e4778
4 changed files with 39 additions and 7 deletions

View File

@ -9,10 +9,12 @@ set (CMAKE_INCLUDE_CURRENT_DIR ON)
file (GLOB LEGACY_GUI_SOURCE_FILES src/*.cpp src/*.h) file (GLOB LEGACY_GUI_SOURCE_FILES src/*.cpp src/*.h)
file (GLOB LEGACY_GUI_UI_FILES src/*.ui) file (GLOB LEGACY_GUI_UI_FILES src/*.ui)
file (GLOB LEGACY_ACTIVATION_FILES src/*Activation* src/*License*) file (GLOB LEGACY_ACTIVATION_FILES src/*Activation* src/*License*)
file (GLOB LEGACY_ZEROCONF_FILES src/Zeroconf*)
if (SYNERGY_ENTERPRISE) if (SYNERGY_ENTERPRISE)
list (REMOVE_ITEM LEGACY_GUI_SOURCE_FILES ${LEGACY_ACTIVATION_FILES}) list (REMOVE_ITEM LEGACY_GUI_SOURCE_FILES ${LEGACY_ACTIVATION_FILES})
list (REMOVE_ITEM LEGACY_GUI_UI_FILES ${LEGACY_ACTIVATION_FILES}) list (REMOVE_ITEM LEGACY_GUI_UI_FILES ${LEGACY_ACTIVATION_FILES})
list (REMOVE_ITEM LEGACY_GUI_SOURCE_FILES ${LEGACY_ZEROCONF_FILES})
endif () endif ()
if (WIN32) if (WIN32)
@ -29,6 +31,7 @@ add_executable (synergy WIN32
include_directories (./src) include_directories (./src)
target_link_libraries (synergy shared) target_link_libraries (synergy shared)
if (NOT SYNERGY_ENTERPRISE)
if (WIN32) if (WIN32)
include_directories ($ENV{BONJOUR_SDK_HOME}/Include) include_directories ($ENV{BONJOUR_SDK_HOME}/Include)
if (CMAKE_SIZEOF_VOID_P EQUAL 8) if (CMAKE_SIZEOF_VOID_P EQUAL 8)
@ -44,13 +47,16 @@ if (WIN32)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_link_libraries (synergy dns_sd) target_link_libraries (synergy dns_sd)
endif() endif()
endif()
qt5_use_modules (synergy Core Widgets Network) qt5_use_modules (synergy Core Widgets Network)
target_compile_definitions (synergy PRIVATE -DSYNERGY_VERSION_STAGE="${SYNERGY_VERSION_STAGE}") target_compile_definitions (synergy PRIVATE -DSYNERGY_VERSION_STAGE="${SYNERGY_VERSION_STAGE}")
target_compile_definitions (synergy PRIVATE -DSYNERGY_REVISION="${SYNERGY_REVISION}") target_compile_definitions (synergy PRIVATE -DSYNERGY_REVISION="${SYNERGY_REVISION}")
if (WIN32) if (WIN32)
if (NOT SYNERGY_ENTERPRISE)
target_link_libraries (synergy ${DNSSD_LIB}) target_link_libraries (synergy ${DNSSD_LIB})
endif ()
set_target_properties (synergy PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMT") set_target_properties (synergy PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMT")
endif() endif()

View File

@ -99,7 +99,9 @@ MainWindow::MainWindow (QSettings& settings, AppConfig& appConfig,
m_pMenuEdit(NULL), m_pMenuEdit(NULL),
m_pMenuWindow(NULL), m_pMenuWindow(NULL),
m_pMenuHelp(NULL), m_pMenuHelp(NULL),
#ifndef SYNERGY_ENTERPRISE
m_pZeroconfService(NULL), m_pZeroconfService(NULL),
#endif
m_pDataDownloader(NULL), m_pDataDownloader(NULL),
m_DownloadMessageBox(NULL), m_DownloadMessageBox(NULL),
m_pCancelButton(NULL), m_pCancelButton(NULL),
@ -183,6 +185,7 @@ MainWindow::MainWindow (QSettings& settings, AppConfig& appConfig,
#ifdef SYNERGY_ENTERPRISE #ifdef SYNERGY_ENTERPRISE
m_pActivate->setVisible(false); m_pActivate->setVisible(false);
m_pCheckBoxAutoConfig->setVisible(false);
#endif #endif
} }
@ -195,7 +198,9 @@ MainWindow::~MainWindow()
saveSettings(); saveSettings();
#ifndef SYNERGY_ENTERPRISE
delete m_pZeroconfService; delete m_pZeroconfService;
#endif
if (m_DownloadMessageBox != NULL) { if (m_DownloadMessageBox != NULL) {
delete m_DownloadMessageBox; delete m_DownloadMessageBox;
@ -218,9 +223,11 @@ void MainWindow::open()
m_VersionChecker.checkLatest(); m_VersionChecker.checkLatest();
#ifndef SYNERGY_ENTERPRISE
if (!appConfig().autoConfigPrompted()) { if (!appConfig().autoConfigPrompted()) {
promptAutoConfig(); promptAutoConfig();
} }
#endif
// only start if user has previously started. this stops the gui from // only start if user has previously started. this stops the gui from
// auto hiding before the user has configured synergy (which of course // auto hiding before the user has configured synergy (which of course
@ -729,6 +736,7 @@ bool MainWindow::clientArgs(QStringList& args, QString& app)
args << "--log" << appConfig().logFilenameCmd(); args << "--log" << appConfig().logFilenameCmd();
} }
#ifndef SYNERGY_ENTERPRISE
// check auto config first, if it is disabled or no server detected, // check auto config first, if it is disabled or no server detected,
// use line edit host name if it is not empty // use line edit host name if it is not empty
if (m_pCheckBoxAutoConfig->isChecked()) { if (m_pCheckBoxAutoConfig->isChecked()) {
@ -738,6 +746,7 @@ bool MainWindow::clientArgs(QStringList& args, QString& app)
return true; return true;
} }
} }
#endif
if (m_pLineEditHostname->text().isEmpty()) { if (m_pLineEditHostname->text().isEmpty()) {
show(); show();
@ -1051,6 +1060,7 @@ void MainWindow::changeEvent(QEvent* event)
} }
} }
#ifndef SYNERGY_ENTERPRISE
void MainWindow::updateZeroconfService() void MainWindow::updateZeroconfService()
{ {
QMutexLocker locker(&m_UpdateZeroconfMutex); QMutexLocker locker(&m_UpdateZeroconfMutex);
@ -1068,6 +1078,7 @@ void MainWindow::updateZeroconfService()
} }
} }
} }
#endif
void MainWindow::serverDetected(const QString name) void MainWindow::serverDetected(const QString name)
{ {
@ -1171,17 +1182,21 @@ MainWindow::licenseManager() const
void MainWindow::on_m_pGroupClient_toggled(bool on) void MainWindow::on_m_pGroupClient_toggled(bool on)
{ {
m_pGroupServer->setChecked(!on); m_pGroupServer->setChecked(!on);
#ifndef SYNERGY_ENTERPRISE
if (on) { if (on) {
updateZeroconfService(); updateZeroconfService();
} }
#endif
} }
void MainWindow::on_m_pGroupServer_toggled(bool on) void MainWindow::on_m_pGroupServer_toggled(bool on)
{ {
m_pGroupClient->setChecked(!on); m_pGroupClient->setChecked(!on);
#ifndef SYNERGY_ENTERPRISE
if (on) { if (on) {
updateZeroconfService(); updateZeroconfService();
} }
#endif
} }
bool MainWindow::on_m_pButtonBrowseConfigFile_clicked() bool MainWindow::on_m_pButtonBrowseConfigFile_clicked()
@ -1321,6 +1336,7 @@ bool MainWindow::isServiceRunning()
return false; return false;
} }
#ifndef SYNERGY_ENTERPRISE
bool MainWindow::isBonjourRunning() bool MainWindow::isBonjourRunning()
{ {
bool result = false; bool result = false;
@ -1493,7 +1509,6 @@ void MainWindow::bonjourInstallFinished()
m_pCheckBoxAutoConfig->setChecked(true); m_pCheckBoxAutoConfig->setChecked(true);
} }
#ifndef SYNERGY_ENTERPRISE
int MainWindow::raiseActivationDialog() int MainWindow::raiseActivationDialog()
{ {
if (m_ActivationDialogRunning) { if (m_ActivationDialogRunning) {

View File

@ -119,10 +119,10 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
void showConfigureServer(const QString& message); void showConfigureServer(const QString& message);
void showConfigureServer() { showConfigureServer(""); } void showConfigureServer() { showConfigureServer(""); }
void autoAddScreen(const QString name); void autoAddScreen(const QString name);
void updateZeroconfService();
void serverDetected(const QString name); void serverDetected(const QString name);
void updateLocalFingerprint(); void updateLocalFingerprint();
#ifndef SYNERGY_ENTERPRISE #ifndef SYNERGY_ENTERPRISE
void updateZeroconfService();
LicenseManager& licenseManager() const; LicenseManager& licenseManager() const;
int raiseActivationDialog(); int raiseActivationDialog();
#endif #endif
@ -155,7 +155,9 @@ public slots:
void logOutput(); void logOutput();
void logError(); void logError();
void updateFound(const QString& version); void updateFound(const QString& version);
#ifndef SYNERGY_ENTERPRISE
void bonjourInstallFinished(); void bonjourInstallFinished();
#endif
void saveSettings(); void saveSettings();
protected: protected:
@ -187,9 +189,12 @@ public slots:
#else #else
bool isServiceRunning(); bool isServiceRunning();
#endif #endif
#ifndef SYNERGY_ENTERPRISE
bool isBonjourRunning(); bool isBonjourRunning();
void downloadBonjour(); void downloadBonjour();
void promptAutoConfig(); void promptAutoConfig();
#endif
QString getProfileRootForArg(); QString getProfileRootForArg();
void checkConnected(const QString& line); void checkConnected(const QString& line);
#ifndef SYNERGY_ENTERPRISE #ifndef SYNERGY_ENTERPRISE
@ -221,7 +226,9 @@ public slots:
QMenu* m_pMenuEdit; QMenu* m_pMenuEdit;
QMenu* m_pMenuWindow; QMenu* m_pMenuWindow;
QMenu* m_pMenuHelp; QMenu* m_pMenuHelp;
#ifndef SYNERGY_ENTERPRISE
ZeroconfService* m_pZeroconfService; ZeroconfService* m_pZeroconfService;
#endif
DataDownloader* m_pDataDownloader; DataDownloader* m_pDataDownloader;
QMessageBox* m_DownloadMessageBox; QMessageBox* m_DownloadMessageBox;
QAbstractButton* m_pCancelButton; QAbstractButton* m_pCancelButton;
@ -238,10 +245,12 @@ public slots:
#endif #endif
private slots: private slots:
void on_m_pButtonApply_clicked();
#ifndef SYNERGY_ENTERPRISE
void on_m_pCheckBoxAutoConfig_toggled(bool checked); void on_m_pCheckBoxAutoConfig_toggled(bool checked);
void on_m_pComboServerList_currentIndexChanged(QString ); void on_m_pComboServerList_currentIndexChanged(QString );
void on_m_pButtonApply_clicked();
void installBonjour(); void installBonjour();
#endif
void on_windowShown(); void on_windowShown();
signals: signals:

View File

@ -1,11 +1,11 @@
/* /*
* synergy -- mouse and keyboard sharing utility * synergy -- mouse and keyboard sharing utility
* Copyright (C) 2012-2016 Symless Ltd. * Copyright (C) 2012-2016 Symless Ltd.
* *
* This package is free software; you can redistribute it and/or * This package is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* found in the file LICENSE that should have accompanied this file. * found in the file LICENSE that should have accompanied this file.
* *
* This package is distributed in the hope that it will be useful, * This package is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "SetupWizard.h" #include "SetupWizard.h"
#include "MainWindow.h" #include "MainWindow.h"
#include "WebClient.h" #include "WebClient.h"
@ -61,7 +61,7 @@ SetupWizard::~SetupWizard()
} }
bool SetupWizard::validateCurrentPage() bool SetupWizard::validateCurrentPage()
{ {
QMessageBox message; QMessageBox message;
message.setWindowTitle(tr("Setup Synergy")); message.setWindowTitle(tr("Setup Synergy"));
message.setIcon(QMessageBox::Information); message.setIcon(QMessageBox::Information);
@ -127,7 +127,9 @@ void SetupWizard::accept()
if (m_StartMain) if (m_StartMain)
{ {
#ifndef SYNERGY_ENTERPRISE
m_MainWindow.updateZeroconfService(); m_MainWindow.updateZeroconfService();
#endif
m_MainWindow.open(); m_MainWindow.open();
} }
} }