Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
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
Options
Browse Files
Download
Email Patches
Plain Diff
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
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
kded/passworddialog.cpp
kded/passworddialog.cpp
+16
-1
No files found.
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
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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