From 033e5530c3549dbff348561c9f8e70fa0f933b56 Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Fri, 20 Feb 2026 14:17:21 -0500 Subject: [PATCH] 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 --- src/lib/common/Settings.h | 3 --- src/lib/gui/MainWindow.cpp | 2 +- src/lib/gui/Messages.cpp | 22 ++-------------------- translations/deskflow_es.ts | 12 ------------ translations/deskflow_it.ts | 12 ------------ translations/deskflow_ja.ts | 12 ------------ translations/deskflow_ko.ts | 12 ------------ translations/deskflow_ru.ts | 12 ------------ translations/deskflow_zh_CN.ts | 12 ------------ 9 files changed, 3 insertions(+), 96 deletions(-) diff --git a/src/lib/common/Settings.h b/src/lib/common/Settings.h index 6506a1ce1..037d8ab99 100644 --- a/src/lib/common/Settings.h +++ b/src/lib/common/Settings.h @@ -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 }; diff --git a/src/lib/gui/MainWindow.cpp b/src/lib/gui/MainWindow.cpp index 309cc049b..b4157338b 100644 --- a/src/lib/gui/MainWindow.cpp +++ b/src/lib/gui/MainWindow.cpp @@ -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; diff --git a/src/lib/gui/Messages.cpp b/src/lib/gui/Messages.cpp index ca396f3f3..8b5e26bc7 100644 --- a/src/lib/gui/Messages.cpp +++ b/src/lib/gui/Messages.cpp @@ -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("

Failed to connect to the server '%1'.

").arg(address); @@ -199,17 +200,6 @@ void showClientConnectError(QWidget *parent, deskflow::client::ErrorType error, "single instance of the client process is running.

" ) ); - } else if (error == HostnameError) { - message.append( - QObject::tr( // - "

Please try to connect to the server using the server IP address " - "instead of the hostname.

" - "

If that doesn't work, please check your TLS and " - "firewall settings.

" - ) - ); - } else if (error == GenericError) { - message.append(QObject::tr("

Please check your TLS and firewall settings.

")); } 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(); } diff --git a/translations/deskflow_es.ts b/translations/deskflow_es.ts index 4a8b1547c..f6c48e421 100644 --- a/translations/deskflow_es.ts +++ b/translations/deskflow_es.ts @@ -684,22 +684,10 @@ Nombres válidos: <p>A Client with your name is already connected to the server.</p>Please ensure that you're using a unique name and that only a single instance of the client process is running.</p> <p>Ya hay un cliente conectado al servidor con su nombre.</p>Asegúrese de utilizar un nombre único y de que solo se esté ejecutando una única instancia del proceso del cliente.</p> - - <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> - <p>Intente conectarse al servidor usando la dirección IP del servidor en lugar del nombre de host.</p><p>Si eso no funciona, verifique la configuración de TLS y firewall.</p> - - - <p>Please check your TLS and firewall settings.</p> - <p>Por favor revise su configuración de TLS y firewall.</p> - %1 Connection Error %1 Error de conexión - - Do not show this message again - No volver a mostrar este mensaje - %1 - New Client %1 - Nuevo cliente diff --git a/translations/deskflow_it.ts b/translations/deskflow_it.ts index 74021d22d..ba160a22b 100644 --- a/translations/deskflow_it.ts +++ b/translations/deskflow_it.ts @@ -684,22 +684,10 @@ Nomi validi: <p>A Client with your name is already connected to the server.</p>Please ensure that you're using a unique name and that only a single instance of the client process is running.</p> <p>Un client con il tuo nome è già connesso al server.</p>Assicurati di utilizzare un nome univoco e che sia in esecuzione una sola istanza del processo client.</p> - - <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> - <p>Prova a connetterti al server usando l'indirizzo IP del server invece del nome host.</p><p>Se non funziona, controlla le impostazioni TLS e del firewall.</p> - - - <p>Please check your TLS and firewall settings.</p> - <p>Controlla le impostazioni TLS e del firewall.</p> - %1 Connection Error Errore di connessione %1 - - Do not show this message again - Non mostrare più questo messaggio - %1 - New Client %1 - Nuovo Client diff --git a/translations/deskflow_ja.ts b/translations/deskflow_ja.ts index fb0e5f9e9..664d258aa 100644 --- a/translations/deskflow_ja.ts +++ b/translations/deskflow_ja.ts @@ -685,22 +685,10 @@ Valid names: <p>A Client with your name is already connected to the server.</p>Please ensure that you're using a unique name and that only a single instance of the client process is running.</p> <p>同じ名前のクライアントがサーバーに接続済です。</p><p>名前の重複がないことと、クライアントプロセスが多重起動していない事を確認してください。</p> - - <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> - <p>サーバーのホスト名ではなくIPアドレスで接続してみてください。</p><p>それでも接続できない場合は、TLSとファイアウォールの設定を確認してください。</p> - - - <p>Please check your TLS and firewall settings.</p> - <p>TLSとファイアウォールの設定を確認してください。</p> - %1 Connection Error %1 接続エラー - - Do not show this message again - このメッセージを再表示しない - %1 - New Client %1 - 新しいクライアント diff --git a/translations/deskflow_ko.ts b/translations/deskflow_ko.ts index 713568528..6812a8d21 100644 --- a/translations/deskflow_ko.ts +++ b/translations/deskflow_ko.ts @@ -683,22 +683,10 @@ Valid names: <p>A Client with your name is already connected to the server.</p>Please ensure that you're using a unique name and that only a single instance of the client process is running.</p> <p>같은 이름의 클라이언트가 이미 서버에 연결되어 있습니다.</p><p>고유한 이름을 사용하고, 클라이언트 프로세스가 하나만 실행 중인지 확인하세요.</p> - - <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> - <p>호스트 이름 대신 서버 IP 주소로 연결해 보세요.</p><p>문제가 계속되면 TLS 및 방화벽 설정을 확인하세요.</p> - - - <p>Please check your TLS and firewall settings.</p> - <p>TLS 및 방화벽 설정을 확인하세요.</p> - %1 Connection Error %1 연결 오류 - - Do not show this message again - 다시 표시하지 않기 - %1 - New Client %1 - 새 클라이언트 diff --git a/translations/deskflow_ru.ts b/translations/deskflow_ru.ts index 10fc94b87..4ae35d458 100644 --- a/translations/deskflow_ru.ts +++ b/translations/deskflow_ru.ts @@ -685,22 +685,10 @@ Valid names: <p>A Client with your name is already connected to the server.</p>Please ensure that you're using a unique name and that only a single instance of the client process is running.</p> <p>Клиент с таким именем уже подключен к серверу.</p>Убедитесь, что вы используете уникальное имя и запущен только один процесс клиента.</p> - - <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> - <p>Попробуйте подключиться к серверу по IP-адресу вместо имени хоста. </p><p>Если это не поможет, проверьте настройки TLS и брандмауэра.</p> - - - <p>Please check your TLS and firewall settings.</p> - <p>Пожалуйста, проверьте настройки TLS и брандмауэра.</p> - %1 Connection Error Ошибка соединения %1 - - Do not show this message again - Больше не показывать это сообщение - %1 - New Client %1 - Новый клиент diff --git a/translations/deskflow_zh_CN.ts b/translations/deskflow_zh_CN.ts index 825d536cb..bd8e8113c 100644 --- a/translations/deskflow_zh_CN.ts +++ b/translations/deskflow_zh_CN.ts @@ -685,22 +685,10 @@ Valid names: <p>A Client with your name is already connected to the server.</p>Please ensure that you're using a unique name and that only a single instance of the client process is running.</p> <p>一个同名的客户端已连接到服务器。</p>请确保您使用的名称唯一,且只有一个客户端进程实例在运行。</p> - - <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> - <p>请尝试使用服务器 IP 地址而不是主机名来连接服务器。</p><p>如果不起作用,请检查您的 TLS 和防火墙设置。</p> - - - <p>Please check your TLS and firewall settings.</p> - <p>请检查您的 TLS 和防火墙设置。</p> - %1 Connection Error %1 连接错误 - - Do not show this message again - 不再显示此消息 - %1 - New Client %1 - 新客户端