refactor: remove the generic connection and hostname failures dialog

this dialog has been the cause of alot of confusion,
it will almost always show up incorrectly at least once when connecting a new client
if you accept the client side dialog before adding the screen to the server
fixes: #9497
This commit is contained in:
sithlord48
2026-02-20 14:17:21 -05:00
committed by Nick Bolton
parent 727d6ff166
commit 033e5530c3
9 changed files with 3 additions and 96 deletions

View File

@ -77,7 +77,6 @@ public:
inline static const auto LogExpanded = QStringLiteral("gui/logExpanded");
inline static const auto SymbolicTrayIcon = QStringLiteral("gui/symbolicTrayIcon");
inline static const auto WindowGeometry = QStringLiteral("gui/windowGeometry");
inline static const auto ShowGenericClientFailureDialog = QStringLiteral("gui/showGenericClientFailureDialog");
inline static const auto ShownFirstConnectedMessage = QStringLiteral("gui/shownFirstConnectedMessage");
inline static const auto ShownServerFirstStartMessage = QStringLiteral("gui/shownServerFirstStartMessage");
inline static const auto ShowVersionInTitle = QStringLiteral("gui/showVersionInTitle");
@ -230,7 +229,6 @@ private:
, Settings::Gui::LogExpanded
, Settings::Gui::SymbolicTrayIcon
, Settings::Gui::WindowGeometry
, Settings::Gui::ShowGenericClientFailureDialog
, Settings::Gui::ShownFirstConnectedMessage
, Settings::Gui::ShownServerFirstStartMessage
, Settings::Gui::ShowVersionInTitle
@ -266,7 +264,6 @@ private:
, Settings::Gui::CloseReminder
, Settings::Gui::LogExpanded
, Settings::Gui::SymbolicTrayIcon
, Settings::Gui::ShowGenericClientFailureDialog
, Settings::Security::TlsEnabled
, Settings::Security::CheckPeers
};

View File

@ -1263,7 +1263,7 @@ void MainWindow::remoteHostChanged(const QString &newRemoteHost)
void MainWindow::showClientError(deskflow::client::ErrorType error, const QString &address)
{
if (!Settings::value(Settings::Gui::ShowGenericClientFailureDialog).toBool() || !isVisible() || m_clientErrorVisible)
if (!isVisible() || m_clientErrorVisible)
return;
m_clientErrorVisible = true;

View File

@ -186,7 +186,8 @@ void showFirstConnectedMessage(QWidget *parent, bool closeToTray, bool enableSer
void showClientConnectError(QWidget *parent, deskflow::client::ErrorType error, const QString &address)
{
using enum deskflow::client::ErrorType;
if (error == NoError)
if (error == NoError || error == GenericError || error == HostnameError)
return;
auto message = QObject::tr("<p>Failed to connect to the server '%1'.</p>").arg(address);
@ -199,17 +200,6 @@ void showClientConnectError(QWidget *parent, deskflow::client::ErrorType error,
"single instance of the client process is running.</p>"
)
);
} else if (error == HostnameError) {
message.append(
QObject::tr( //
"<p>Please try to connect to the server using the server IP address "
"instead of the hostname. </p>"
"<p>If that doesn't work, please check your TLS and "
"firewall settings.</p>"
)
);
} else if (error == GenericError) {
message.append(QObject::tr("<p>Please check your TLS and firewall settings.</p>"));
} else {
qFatal("unknown client error");
}
@ -226,14 +216,6 @@ void showClientConnectError(QWidget *parent, deskflow::client::ErrorType error,
dialog.setText(message);
dialog.setWindowModality(Qt::ApplicationModal);
dialog.setIcon(QMessageBox::Information);
auto cbNoShowAgain = new QCheckBox(QObject::tr("Do not show this message again"));
QObject::connect(cbNoShowAgain, &QCheckBox::toggled, [](bool enabled) {
Settings::setValue(Settings::Gui::ShowGenericClientFailureDialog, !enabled);
});
dialog.setCheckBox(cbNoShowAgain);
dialog.setDefaultButton(QMessageBox::Ok);
dialog.exec();
}

View File

@ -684,22 +684,10 @@ Nombres válidos:
<source>&lt;p&gt;A Client with your name is already connected to the server.&lt;/p&gt;Please ensure that you&apos;re using a unique name and that only a single instance of the client process is running.&lt;/p&gt;</source>
<translation type="unfinished">&lt;p&gt;Ya hay un cliente conectado al servidor con su nombre.&lt;/p&gt;Asegúrese de utilizar un nombre único y de que solo se esté ejecutando una única instancia del proceso del cliente.&lt;/p&gt;</translation>
</message>
<message>
<source>&lt;p&gt;Please try to connect to the server using the server IP address instead of the hostname. &lt;/p&gt;&lt;p&gt;If that doesn&apos;t work, please check your TLS and firewall settings.&lt;/p&gt;</source>
<translation type="unfinished">&lt;p&gt;Intente conectarse al servidor usando la dirección IP del servidor en lugar del nombre de host.&lt;/p&gt;&lt;p&gt;Si eso no funciona, verifique la configuración de TLS y firewall.&lt;/p&gt;</translation>
</message>
<message>
<source>&lt;p&gt;Please check your TLS and firewall settings.&lt;/p&gt;</source>
<translation type="unfinished">&lt;p&gt;Por favor revise su configuración de TLS y firewall.&lt;/p&gt;</translation>
</message>
<message>
<source>%1 Connection Error</source>
<translation type="unfinished">%1 Error de conexión</translation>
</message>
<message>
<source>Do not show this message again</source>
<translation type="unfinished">No volver a mostrar este mensaje</translation>
</message>
<message>
<source>%1 - New Client</source>
<translation type="unfinished">%1 - Nuevo cliente</translation>

View File

@ -684,22 +684,10 @@ Nomi validi:
<source>&lt;p&gt;A Client with your name is already connected to the server.&lt;/p&gt;Please ensure that you&apos;re using a unique name and that only a single instance of the client process is running.&lt;/p&gt;</source>
<translation>&lt;p&gt;Un client con il tuo nome è già connesso al server.&lt;/p&gt;Assicurati di utilizzare un nome univoco e che sia in esecuzione una sola istanza del processo client.&lt;/p&gt;</translation>
</message>
<message>
<source>&lt;p&gt;Please try to connect to the server using the server IP address instead of the hostname. &lt;/p&gt;&lt;p&gt;If that doesn&apos;t work, please check your TLS and firewall settings.&lt;/p&gt;</source>
<translation>&lt;p&gt;Prova a connetterti al server usando l&apos;indirizzo IP del server invece del nome host.&lt;/p&gt;&lt;p&gt;Se non funziona, controlla le impostazioni TLS e del firewall.&lt;/p&gt;</translation>
</message>
<message>
<source>&lt;p&gt;Please check your TLS and firewall settings.&lt;/p&gt;</source>
<translation>&lt;p&gt;Controlla le impostazioni TLS e del firewall.&lt;/p&gt;</translation>
</message>
<message>
<source>%1 Connection Error</source>
<translation>Errore di connessione %1</translation>
</message>
<message>
<source>Do not show this message again</source>
<translation>Non mostrare più questo messaggio</translation>
</message>
<message>
<source>%1 - New Client</source>
<translation>%1 - Nuovo Client</translation>

View File

@ -685,22 +685,10 @@ Valid names:
<source>&lt;p&gt;A Client with your name is already connected to the server.&lt;/p&gt;Please ensure that you&apos;re using a unique name and that only a single instance of the client process is running.&lt;/p&gt;</source>
<translation>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;</translation>
</message>
<message>
<source>&lt;p&gt;Please try to connect to the server using the server IP address instead of the hostname. &lt;/p&gt;&lt;p&gt;If that doesn&apos;t work, please check your TLS and firewall settings.&lt;/p&gt;</source>
<translation>&lt;p&gt;IPアドレスで接続してみてください&lt;/p&gt;&lt;p&gt;TLS&lt;/p&gt;</translation>
</message>
<message>
<source>&lt;p&gt;Please check your TLS and firewall settings.&lt;/p&gt;</source>
<translation>&lt;p&gt;TLSとファイアウォールの設定を確認してください&lt;/p&gt;</translation>
</message>
<message>
<source>%1 Connection Error</source>
<translation>%1 </translation>
</message>
<message>
<source>Do not show this message again</source>
<translation></translation>
</message>
<message>
<source>%1 - New Client</source>
<translation>%1 - </translation>

View File

@ -683,22 +683,10 @@ Valid names:
<source>&lt;p&gt;A Client with your name is already connected to the server.&lt;/p&gt;Please ensure that you&apos;re using a unique name and that only a single instance of the client process is running.&lt;/p&gt;</source>
<translation>&lt;p&gt; .&lt;/p&gt;&lt;p&gt; , .&lt;/p&gt;</translation>
</message>
<message>
<source>&lt;p&gt;Please try to connect to the server using the server IP address instead of the hostname. &lt;/p&gt;&lt;p&gt;If that doesn&apos;t work, please check your TLS and firewall settings.&lt;/p&gt;</source>
<translation>&lt;p&gt; IP .&lt;/p&gt;&lt;p&gt; TLS .&lt;/p&gt;</translation>
</message>
<message>
<source>&lt;p&gt;Please check your TLS and firewall settings.&lt;/p&gt;</source>
<translation>&lt;p&gt;TLS .&lt;/p&gt;</translation>
</message>
<message>
<source>%1 Connection Error</source>
<translation>%1 </translation>
</message>
<message>
<source>Do not show this message again</source>
<translation> </translation>
</message>
<message>
<source>%1 - New Client</source>
<translation>%1 - </translation>

View File

@ -685,22 +685,10 @@ Valid names:
<source>&lt;p&gt;A Client with your name is already connected to the server.&lt;/p&gt;Please ensure that you&apos;re using a unique name and that only a single instance of the client process is running.&lt;/p&gt;</source>
<translation>&lt;p&gt;Клиент с таким именем уже подключен к серверу.&lt;/p&gt;Убедитесь, что вы используете уникальное имя и запущен только один процесс клиента.&lt;/p&gt;</translation>
</message>
<message>
<source>&lt;p&gt;Please try to connect to the server using the server IP address instead of the hostname. &lt;/p&gt;&lt;p&gt;If that doesn&apos;t work, please check your TLS and firewall settings.&lt;/p&gt;</source>
<translation>&lt;p&gt;Попробуйте подключиться к серверу по IP-адресу вместо имени хоста. &lt;/p&gt;&lt;p&gt;Если это не поможет, проверьте настройки TLS и брандмауэра.&lt;/p&gt;</translation>
</message>
<message>
<source>&lt;p&gt;Please check your TLS and firewall settings.&lt;/p&gt;</source>
<translation>&lt;p&gt;Пожалуйста, проверьте настройки TLS и брандмауэра.&lt;/p&gt;</translation>
</message>
<message>
<source>%1 Connection Error</source>
<translation>Ошибка соединения %1</translation>
</message>
<message>
<source>Do not show this message again</source>
<translation>Больше не показывать это сообщение</translation>
</message>
<message>
<source>%1 - New Client</source>
<translation>%1 - Новый клиент</translation>

View File

@ -685,22 +685,10 @@ Valid names:
<source>&lt;p&gt;A Client with your name is already connected to the server.&lt;/p&gt;Please ensure that you&apos;re using a unique name and that only a single instance of the client process is running.&lt;/p&gt;</source>
<translation type="unfinished">&lt;p&gt;&lt;/p&gt;使&lt;/p&gt;</translation>
</message>
<message>
<source>&lt;p&gt;Please try to connect to the server using the server IP address instead of the hostname. &lt;/p&gt;&lt;p&gt;If that doesn&apos;t work, please check your TLS and firewall settings.&lt;/p&gt;</source>
<translation>&lt;p&gt;使 IP &lt;/p&gt;&lt;p&gt; TLS &lt;/p&gt;</translation>
</message>
<message>
<source>&lt;p&gt;Please check your TLS and firewall settings.&lt;/p&gt;</source>
<translation>&lt;p&gt; TLS &lt;/p&gt;</translation>
</message>
<message>
<source>%1 Connection Error</source>
<translation>%1 </translation>
</message>
<message>
<source>Do not show this message again</source>
<translation></translation>
</message>
<message>
<source>%1 - New Client</source>
<translation>%1 - </translation>