SYNERGY-826 Add a new option SYNERGY_AUTOCONFIG (#6949)

* SYNERGY-826 Add a new option SYNERGY_AUTOCONFIG

* Update ChangeLog

* Update Version.cmake

* SYNERGY-826 Return stage back
This commit is contained in:
SerhiiGadzhilov 2021-02-15 14:44:46 +03:00 committed by GitHub
parent 03f5344b93
commit 05ce7f37bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 36 additions and 18 deletions

View file

@ -35,6 +35,12 @@ else()
option (SYNERGY_ENTERPRISE "Build Enterprise" OFF)
endif()
if (DEFINED ENV{SYNERGY_AUTOCONFIG})
option (SYNERGY_AUTOCONFIG "Build with Autoconfig" ON)
else()
option (SYNERGY_AUTOCONFIG "Build without Autoconfig" OFF)
endif()
set (CMAKE_CXX_STANDARD 14)
set (CMAKE_CXX_EXTENSIONS OFF)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
@ -254,7 +260,7 @@ if (UNIX)
list (APPEND libs Xi)
endif()
if (NOT SYNERGY_ENTERPRISE AND SYNERGY_BUILD_LEGACY_GUI)
if (NOT SYNERGY_ENTERPRISE AND SYNERGY_BUILD_LEGACY_GUI AND SYNERGY_AUTOCONFIG)
set (DnsSdlib "dns_sd.h")
set (CMAKE_EXTRA_INCLUDE_FILES "${CMAKE_EXTRA_INCLUDE_FILES};${DnsSdlib}")
check_include_files ("${DnsSdlib}" HAVE_DNS_SD)

View file

@ -28,6 +28,7 @@ Enhancements:
- #6937 Modern C++ compiler for centOS7
- #6938 Remove auto config message from the main window
- #6941 Add Raspberry Pi Builds
- #6949 Add a new option SYNERGY_AUTOCONFIG to exclude autoconfig from the standard version
v1.13.0-stable
===========

View file

@ -77,3 +77,7 @@ endif()
if (SYNERGY_ENTERPRISE)
add_definitions (-DSYNERGY_ENTERPRISE=1)
endif()
if (SYNERGY_AUTOCONFIG)
add_definitions (-DSYNERGY_AUTOCONFIG=1)
endif()

View file

@ -38,6 +38,10 @@ if (SYNERGY_ENTERPRISE)
list (REMOVE_ITEM LEGACY_GUI_SOURCE_FILES ${LEGACY_ZEROCONF_FILES})
endif ()
if (NOT SYNERGY_AUTOCONFIG)
list (REMOVE_ITEM LEGACY_GUI_SOURCE_FILES ${LEGACY_ZEROCONF_FILES})
endif ()
if (WIN32)
set (LEGACY_GUI_RC_FILES res/win/Synergy.rc)
endif()
@ -54,7 +58,7 @@ add_executable (synergy WIN32
include_directories (./src)
target_link_libraries (synergy shared)
if (NOT SYNERGY_ENTERPRISE)
if (NOT SYNERGY_ENTERPRISE AND SYNERGY_AUTOCONFIG)
if (WIN32)
include_directories ($ENV{BONJOUR_SDK_HOME}/Include)
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
@ -80,7 +84,7 @@ target_compile_definitions (synergy PRIVATE -DSYNERGY_VERSION_STAGE="${SYNERGY_V
target_compile_definitions (synergy PRIVATE -DSYNERGY_REVISION="${SYNERGY_REVISION}")
if (WIN32)
if (NOT SYNERGY_ENTERPRISE)
if (NOT SYNERGY_ENTERPRISE AND SYNERGY_AUTOCONFIG)
target_link_libraries (synergy ${DNSSD_LIB})
endif ()
set_target_properties (synergy PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMT")
@ -121,4 +125,4 @@ if (WIN32)
COMMAND Qt5::windeployqt "$<TARGET_FILE_DIR:synergy>/$<TARGET_FILE_NAME:synergy>"
)
endif()
endif()
endif()

View file

@ -187,7 +187,7 @@ const QString &AppConfig::language() const { return m_Language; }
bool AppConfig::startedBefore() const { return m_StartedBefore; }
bool AppConfig::autoConfig() const {
#ifndef SYNERGY_ENTERPRISE
#if !defined(SYNERGY_ENTERPRISE) && defined(SYNERGY_AUTOCONFIG)
return m_AutoConfig;
#else
// always disable auto config for enterprise edition.

View file

@ -122,7 +122,7 @@ MainWindow::MainWindow (AppConfig& appConfig,
m_ExpectedRunningState(kStopped),
m_SecureSocket(false)
{
#ifndef SYNERGY_ENTERPRISE
#if !defined(SYNERGY_ENTERPRISE) && defined(SYNERGY_AUTOCONFIG)
m_pZeroconf = new Zeroconf(this);
#endif
@ -202,7 +202,7 @@ MainWindow::MainWindow (AppConfig& appConfig,
m_pActivate->setVisible(false);
#endif
#ifndef SYNERGY_ENTERPRISE
#if !defined(SYNERGY_ENTERPRISE) && defined(SYNERGY_AUTOCONFIG)
updateZeroconfService();
addZeroconfServer(m_AppConfig->autoConfigServer());
@ -218,7 +218,7 @@ MainWindow::~MainWindow()
stopDesktop();
}
#ifndef SYNERGY_ENTERPRISE
#if !defined(SYNERGY_ENTERPRISE) && defined(SYNERGY_AUTOCONFIG)
delete m_pZeroconf;
#endif
}
@ -346,7 +346,7 @@ void MainWindow::saveSettings()
}
void MainWindow::zeroConfToggled() {
#ifndef SYNERGY_ENTERPRISE
#if !defined(SYNERGY_ENTERPRISE) && defined(SYNERGY_AUTOCONFIG)
updateZeroconfService();
addZeroconfServer(m_AppConfig->autoConfigServer());
@ -754,7 +754,7 @@ bool MainWindow::clientArgs(QStringList& args, QString& app)
args << "--log" << appConfig().logFilenameCmd();
}
#ifndef SYNERGY_ENTERPRISE
#if !defined(SYNERGY_ENTERPRISE) && defined(SYNERGY_AUTOCONFIG)
// check auto config first, if it is disabled or no server detected,
// use line edit host name if it is not empty
if (appConfig().autoConfig()) {
@ -775,7 +775,7 @@ bool MainWindow::clientArgs(QStringList& args, QString& app)
if (m_pLineEditHostname->text().isEmpty())
{
#ifndef SYNERGY_ENTERPRISE
#if !defined(SYNERGY_ENTERPRISE) && defined(SYNERGY_AUTOCONFIG)
//check if autoconfig mode is enabled
if (!appConfig().autoConfig())
{
@ -786,7 +786,7 @@ bool MainWindow::clientArgs(QStringList& args, QString& app)
tr("Please fill in a hostname for the synergy client to connect to."));
return false;
#ifndef SYNERGY_ENTERPRISE
#if !defined(SYNERGY_ENTERPRISE) && defined(SYNERGY_AUTOCONFIG)
}
else
{
@ -1223,7 +1223,7 @@ void MainWindow::on_m_pActionHelp_triggered()
void MainWindow::updateZeroconfService()
{
#ifndef SYNERGY_ENTERPRISE
#if !defined(SYNERGY_ENTERPRISE) && defined(SYNERGY_AUTOCONFIG)
// reset the server list in case one has gone away.
// it'll be re-added after the zeroconf service restarts.

View file

@ -177,17 +177,20 @@ void SettingsDialog::loadFromConfig() {
m_pCheckBoxEnableCrypto->setEnabled(true);
m_pLabelProUpgrade->hide();
m_pCheckBoxAutoConfig->hide();
m_pLabelInstallBonjour->hide();
#else
m_pCheckBoxEnableCrypto->setEnabled(m_appConfig.isCryptoAvailable());
m_pLabelProUpgrade->setVisible(!m_appConfig.isCryptoAvailable());
m_pCheckBoxAutoConfig->setChecked(appConfig().autoConfig());
#endif
#if !defined(SYNERGY_ENTERPRISE) && defined(SYNERGY_AUTOCONFIG)
m_pCheckBoxAutoConfig->setChecked(appConfig().autoConfig());
#else
m_pCheckBoxAutoConfig->hide();
m_pLabelInstallBonjour->hide();
#endif
adjustSize();
}