Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Plasma applet for NetworkManager
Commits
848e474e
Commit
848e474e
authored
Sep 24, 2020
by
Enrique Melendez
Committed by
Jan Grulich
Oct 12, 2020
Browse files
Add hints to the argument list; pass hints inside the vpnSetting argument to askUser
parent
a1db6d31
Changes
1
Hide whitespace changes
Inline
Side-by-side
kded/passworddialog.cpp
View file @
848e474e
...
...
@@ -40,7 +40,7 @@
using
namespace
NetworkManager
;
PasswordDialog
::
PasswordDialog
(
const
NetworkManager
::
ConnectionSettings
::
Ptr
&
connectionSettings
,
SecretAgent
::
GetSecretsFlags
flags
,
const
QString
&
setting_name
,
QWidget
*
parent
)
:
const
QString
&
setting_name
,
const
QStringList
&
hints
,
QWidget
*
parent
)
:
QDialog
(
parent
),
m_ui
(
nullptr
),
m_hasError
(
false
),
...
...
@@ -49,6 +49,7 @@ PasswordDialog::PasswordDialog(const NetworkManager::ConnectionSettings::Ptr &co
m_error
(
SecretAgent
::
NoSecrets
),
m_flags
(
flags
),
m_vpnWidget
(
nullptr
)
m_hints
(
hints
)
{
setWindowIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"dialog-password"
)));
...
...
@@ -135,6 +136,13 @@ void PasswordDialog::initializeUi()
this
,
QVariantList
(),
&
error
);
if
(
vpnUiPlugin
&&
error
.
isEmpty
())
{
const
QString
shortName
=
serviceType
.
section
(
'.'
,
-
1
);
NMStringMap
data
=
vpnSetting
->
data
();
// If we have hints, make the user have them through the widget
if
(
!
m_hints
.
isEmpty
()
&&
m_hints
.
size
()
==
2
)
{
data
.
insert
(
"hint"
,
m_hints
[
0
]);
data
.
insert
(
"hint-msg"
,
m_hints
[
1
]);
vpnSetting
->
setData
(
data
);
}
m_vpnWidget
=
vpnUiPlugin
->
askUser
(
vpnSetting
,
this
);
QVBoxLayout
*
layout
=
new
QVBoxLayout
();
layout
->
addWidget
(
m_vpnWidget
);
...
...
@@ -152,6 +160,13 @@ void PasswordDialog::initializeUi()
setFocusProxy
(
m_vpnWidget
);
m_vpnWidget
->
setFocus
(
Qt
::
OtherFocusReason
);
// Delete hins from vpnSetting
if
(
!
m_hints
.
isEmpty
())
{
data
.
remove
(
"hint"
);
data
.
remove
(
"hint-msg"
);
vpnSetting
->
setData
(
data
);
}
}
else
{
qCWarning
(
PLASMA_NM
)
<<
error
<<
", serviceType == "
<<
serviceType
;
m_hasError
=
true
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment