refactor: use better name to describe for the tlsEnabled var in messages , and correct the name in virtual method

This commit is contained in:
sithlord48 2025-02-17 14:16:20 -05:00 committed by Nick Bolton
parent ad79ba907d
commit 83c190c385
4 changed files with 10 additions and 8 deletions

View file

@ -19,10 +19,11 @@ namespace deskflow::gui {
// ServerConnection::Deps // ServerConnection::Deps
// //
messages::NewClientPromptResult messages::NewClientPromptResult ServerConnection::Deps::showNewClientPrompt(
ServerConnection::Deps::showNewClientPrompt(QWidget *parent, const QString &clientName, bool previouslyAccepted) const QWidget *parent, const QString &clientName, bool serverRequiresPeerAuth
) const
{ {
return messages::showNewClientPrompt(parent, clientName, previouslyAccepted); return messages::showNewClientPrompt(parent, clientName, serverRequiresPeerAuth);
} }
// //

View file

@ -26,7 +26,7 @@ public:
{ {
virtual ~Deps() = default; virtual ~Deps() = default;
virtual messages::NewClientPromptResult virtual messages::NewClientPromptResult
showNewClientPrompt(QWidget *parent, const QString &clientName, bool previouslyAccepted = false) const; showNewClientPrompt(QWidget *parent, const QString &clientName, bool serverRequiresPeerAuth = false) const;
}; };
explicit ServerConnection( explicit ServerConnection(

View file

@ -205,12 +205,12 @@ void showClientConnectError(QWidget *parent, ClientError error, const QString &a
dialog.exec(); dialog.exec();
} }
NewClientPromptResult showNewClientPrompt(QWidget *parent, const QString &clientName, bool tlsAcceptedClient) NewClientPromptResult showNewClientPrompt(QWidget *parent, const QString &clientName, bool serverRequiresPeerAuth)
{ {
using enum NewClientPromptResult; using enum NewClientPromptResult;
if (tlsAcceptedClient) { if (serverRequiresPeerAuth) {
// When peer checking is enabled you will be prompted to allow the connection before seeing this dialog. // When peer auth is enabled you will be prompted to allow the connection before seeing this dialog.
// This is why we do not show a dialog with an option to ignore the new client // This is why we do not show a dialog with an option to ignore the new client
QMessageBox::information( QMessageBox::information(
parent, QString("New Client"), parent, QString("New Client"),

View file

@ -38,7 +38,8 @@ void showCloseReminder(QWidget *parent);
void showClientConnectError(QWidget *parent, ClientError error, const QString &address); void showClientConnectError(QWidget *parent, ClientError error, const QString &address);
NewClientPromptResult showNewClientPrompt(QWidget *parent, const QString &clientName, bool tlsAcceptedClient = false); NewClientPromptResult
showNewClientPrompt(QWidget *parent, const QString &clientName, bool serverRequiresPeerAuth = false);
bool showClearSettings(QWidget *parent); bool showClearSettings(QWidget *parent);