Commit 3d98e717 authored by Enrique Melendez's avatar Enrique Melendez Committed by Jan Grulich
Browse files

Add capabilities to the constructor and hints to the call to PasswordDialog

parent 848e474e
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
#include <KWallet> #include <KWallet>
SecretAgent::SecretAgent(QObject* parent) SecretAgent::SecretAgent(QObject* parent)
: NetworkManager::SecretAgent("org.kde.plasma.networkmanagement", parent) : NetworkManager::SecretAgent("org.kde.plasma.networkmanagement", NetworkManager::SecretAgent::Capability::VpnHints, parent)
, m_openWalletFailed(false) , m_openWalletFailed(false)
, m_wallet(nullptr) , m_wallet(nullptr)
, m_dialog(nullptr) , m_dialog(nullptr)
...@@ -95,6 +95,7 @@ NMVariantMapMap SecretAgent::GetSecrets(const NMVariantMapMap &connection, const ...@@ -95,6 +95,7 @@ NMVariantMapMap SecretAgent::GetSecrets(const NMVariantMapMap &connection, const
m_calls << request; m_calls << request;
processNext(); processNext();
return NMVariantMapMap(); return NMVariantMapMap();
} }
...@@ -433,7 +434,7 @@ bool SecretAgent::processGetSecrets(SecretsRequest &request) const ...@@ -433,7 +434,7 @@ bool SecretAgent::processGetSecrets(SecretsRequest &request) const
return true; return true;
} else if (requestNew || (allowInteraction && !setting->needSecrets(requestNew).isEmpty()) || (allowInteraction && userRequested) || (isVpn && allowInteraction)) { } else if (requestNew || (allowInteraction && !setting->needSecrets(requestNew).isEmpty()) || (allowInteraction && userRequested) || (isVpn && allowInteraction)) {
m_dialog = new PasswordDialog(connectionSettings, request.flags, request.setting_name); m_dialog = new PasswordDialog(connectionSettings, request.flags, request.setting_name, request.hints);
connect(m_dialog, &PasswordDialog::accepted, this, &SecretAgent::dialogAccepted); connect(m_dialog, &PasswordDialog::accepted, this, &SecretAgent::dialogAccepted);
connect(m_dialog, &PasswordDialog::rejected, this, &SecretAgent::dialogRejected); connect(m_dialog, &PasswordDialog::rejected, this, &SecretAgent::dialogRejected);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment