refactor: use better name to describe for the tlsEnabled var in messages , and correct the name in virtual method
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@ -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(
|
||||
|
||||
@ -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"),
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user