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 LogExpanded = QStringLiteral("gui/logExpanded");
inline static const auto SymbolicTrayIcon = QStringLiteral("gui/symbolicTrayIcon"); inline static const auto SymbolicTrayIcon = QStringLiteral("gui/symbolicTrayIcon");
inline static const auto WindowGeometry = QStringLiteral("gui/windowGeometry"); 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 ShownFirstConnectedMessage = QStringLiteral("gui/shownFirstConnectedMessage");
inline static const auto ShownServerFirstStartMessage = QStringLiteral("gui/shownServerFirstStartMessage"); inline static const auto ShownServerFirstStartMessage = QStringLiteral("gui/shownServerFirstStartMessage");
inline static const auto ShowVersionInTitle = QStringLiteral("gui/showVersionInTitle"); inline static const auto ShowVersionInTitle = QStringLiteral("gui/showVersionInTitle");
@ -230,7 +229,6 @@ private:
, Settings::Gui::LogExpanded , Settings::Gui::LogExpanded
, Settings::Gui::SymbolicTrayIcon , Settings::Gui::SymbolicTrayIcon
, Settings::Gui::WindowGeometry , Settings::Gui::WindowGeometry
, Settings::Gui::ShowGenericClientFailureDialog
, Settings::Gui::ShownFirstConnectedMessage , Settings::Gui::ShownFirstConnectedMessage
, Settings::Gui::ShownServerFirstStartMessage , Settings::Gui::ShownServerFirstStartMessage
, Settings::Gui::ShowVersionInTitle , Settings::Gui::ShowVersionInTitle
@ -266,7 +264,6 @@ private:
, Settings::Gui::CloseReminder , Settings::Gui::CloseReminder
, Settings::Gui::LogExpanded , Settings::Gui::LogExpanded
, Settings::Gui::SymbolicTrayIcon , Settings::Gui::SymbolicTrayIcon
, Settings::Gui::ShowGenericClientFailureDialog
, Settings::Security::TlsEnabled , Settings::Security::TlsEnabled
, Settings::Security::CheckPeers , 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) 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; return;
m_clientErrorVisible = true; 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) void showClientConnectError(QWidget *parent, deskflow::client::ErrorType error, const QString &address)
{ {
using enum deskflow::client::ErrorType; using enum deskflow::client::ErrorType;
if (error == NoError)
if (error == NoError || error == GenericError || error == HostnameError)
return; return;
auto message = QObject::tr("<p>Failed to connect to the server '%1'.</p>").arg(address); 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>" "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 { } else {
qFatal("unknown client error"); qFatal("unknown client error");
} }
@ -226,14 +216,6 @@ void showClientConnectError(QWidget *parent, deskflow::client::ErrorType error,
dialog.setText(message); dialog.setText(message);
dialog.setWindowModality(Qt::ApplicationModal); dialog.setWindowModality(Qt::ApplicationModal);
dialog.setIcon(QMessageBox::Information); 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.setDefaultButton(QMessageBox::Ok);
dialog.exec(); 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> <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> <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>
<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> <message>
<source>%1 Connection Error</source> <source>%1 Connection Error</source>
<translation type="unfinished">%1 Error de conexión</translation> <translation type="unfinished">%1 Error de conexión</translation>
</message> </message>
<message>
<source>Do not show this message again</source>
<translation type="unfinished">No volver a mostrar este mensaje</translation>
</message>
<message> <message>
<source>%1 - New Client</source> <source>%1 - New Client</source>
<translation type="unfinished">%1 - Nuevo cliente</translation> <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> <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> <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>
<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> <message>
<source>%1 Connection Error</source> <source>%1 Connection Error</source>
<translation>Errore di connessione %1</translation> <translation>Errore di connessione %1</translation>
</message> </message>
<message>
<source>Do not show this message again</source>
<translation>Non mostrare più questo messaggio</translation>
</message>
<message> <message>
<source>%1 - New Client</source> <source>%1 - New Client</source>
<translation>%1 - Nuovo Client</translation> <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> <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> <translation>&lt;p&gt;同じ名前のクライアントがサーバーに接続済です。&lt;/p&gt;&lt;p&gt;名前の重複がないことと、クライアントプロセスが多重起動していない事を確認してください。&lt;/p&gt;</translation>
</message> </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> <message>
<source>%1 Connection Error</source> <source>%1 Connection Error</source>
<translation>%1 接続エラー</translation> <translation>%1 接続エラー</translation>
</message> </message>
<message>
<source>Do not show this message again</source>
<translation>このメッセージを再表示しない</translation>
</message>
<message> <message>
<source>%1 - New Client</source> <source>%1 - New Client</source>
<translation>%1 - 新しいクライアント</translation> <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> <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> <translation>&lt;p&gt;같은 이름의 클라이언트가 이미 서버에 연결되어 있습니다.&lt;/p&gt;&lt;p&gt;고유한 이름을 사용하고, 클라이언트 프로세스가 하나만 실행 중인지 확인하세요.&lt;/p&gt;</translation>
</message> </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> <message>
<source>%1 Connection Error</source> <source>%1 Connection Error</source>
<translation>%1 연결 오류</translation> <translation>%1 연결 오류</translation>
</message> </message>
<message>
<source>Do not show this message again</source>
<translation>다시 표시하지 않기</translation>
</message>
<message> <message>
<source>%1 - New Client</source> <source>%1 - New Client</source>
<translation>%1 - 새 클라이언트</translation> <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> <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> <translation>&lt;p&gt;Клиент с таким именем уже подключен к серверу.&lt;/p&gt;Убедитесь, что вы используете уникальное имя и запущен только один процесс клиента.&lt;/p&gt;</translation>
</message> </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> <message>
<source>%1 Connection Error</source> <source>%1 Connection Error</source>
<translation>Ошибка соединения %1</translation> <translation>Ошибка соединения %1</translation>
</message> </message>
<message>
<source>Do not show this message again</source>
<translation>Больше не показывать это сообщение</translation>
</message>
<message> <message>
<source>%1 - New Client</source> <source>%1 - New Client</source>
<translation>%1 - Новый клиент</translation> <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> <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> <translation type="unfinished">&lt;p&gt;一个同名的客户端已连接到服务器。&lt;/p&gt;请确保您使用的名称唯一,且只有一个客户端进程实例在运行。&lt;/p&gt;</translation>
</message> </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> <message>
<source>%1 Connection Error</source> <source>%1 Connection Error</source>
<translation>%1 连接错误</translation> <translation>%1 连接错误</translation>
</message> </message>
<message>
<source>Do not show this message again</source>
<translation>不再显示此消息</translation>
</message>
<message> <message>
<source>%1 - New Client</source> <source>%1 - New Client</source>
<translation>%1 - 新客户端</translation> <translation>%1 - 新客户端</translation>