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
//
messages::NewClientPromptResult
ServerConnection::Deps::showNewClientPrompt(QWidget *parent, const QString &clientName, bool previouslyAccepted) const
messages::NewClientPromptResult ServerConnection::Deps::showNewClientPrompt(
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 messages::NewClientPromptResult
showNewClientPrompt(QWidget *parent, const QString &clientName, bool previouslyAccepted = false) const;
showNewClientPrompt(QWidget *parent, const QString &clientName, bool serverRequiresPeerAuth = false) const;
};
explicit ServerConnection(

View File

@ -205,12 +205,12 @@ void showClientConnectError(QWidget *parent, ClientError error, const QString &a
dialog.exec();
}
NewClientPromptResult showNewClientPrompt(QWidget *parent, const QString &clientName, bool tlsAcceptedClient)
NewClientPromptResult showNewClientPrompt(QWidget *parent, const QString &clientName, bool serverRequiresPeerAuth)
{
using enum NewClientPromptResult;
if (tlsAcceptedClient) {
// When peer checking is enabled you will be prompted to allow the connection before seeing this dialog.
if (serverRequiresPeerAuth) {
// 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
QMessageBox::information(
parent, QString("New Client"),

View File

@ -38,7 +38,8 @@ void showCloseReminder(QWidget *parent);
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);