From 2713b95af7e21322d4d7674335e5cc0cd8e48a3b Mon Sep 17 00:00:00 2001 From: Jnewbon <48688400+Jnewbon@users.noreply.github.com> Date: Fri, 5 Apr 2019 18:37:59 +0100 Subject: [PATCH] Fixed Hostname dialog box opening unnecessarily (#6468) #6392 Added check for autoconfig mode --- src/gui/src/MainWindow.cpp | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp index 751d2ee1..3813f1e4 100644 --- a/src/gui/src/MainWindow.cpp +++ b/src/gui/src/MainWindow.cpp @@ -763,14 +763,27 @@ bool MainWindow::clientArgs(QStringList& args, QString& app) } #endif - if (m_pLineEditHostname->text().isEmpty()) { - show(); - QMessageBox::warning( - this, tr("Hostname is empty"), - tr("Please fill in a hostname for the synergy client to connect to.")); - return false; - } + if (m_pLineEditHostname->text().isEmpty()) + { +#ifndef SYNERGY_ENTERPRISE + //check if autoconfig mode is enabled + if (!appConfig().autoConfig()) + { +#endif + show(); + QMessageBox::warning( + this, tr("Hostname is empty"), + tr("Please fill in a hostname for the synergy client to connect to.")); + return false; +#ifndef SYNERGY_ENTERPRISE + } + else + { + return false; + } +#endif + } args << m_pLineEditHostname->text() + ":" + QString::number(appConfig().port()); return true; }