Commit f07630fb authored by Lamarque Souza's avatar Lamarque Souza
Browse files

Show user and group names in vpnc authentication dialog. This dialog is

used when NM asks for secrets.

CCBUG: 286856
(cherry picked from commit d9f94d62)
parent 459c16a4
......@@ -60,14 +60,25 @@ void VpncAuthWidget::readSecrets()
QStringMap data = d->setting->data();
QStringMap secrets = d->setting->vpnSecrets();
if (!((Knm::Setting::secretsTypes)data[NM_VPNC_KEY_XAUTH_PASSWORD"-flags"].toInt()).testFlag(Knm::Setting::NotRequired)) {
// username
QString user = data.value(NM_VPNC_KEY_XAUTH_USER);
if (!user.isEmpty()) {
d->ui.leUserName->setText(user);
}
// group name
QString group = data.value(NM_VPNC_KEY_ID);
if (!group.isEmpty()) {
d->ui.leGroupName->setText(group);
}
if (!((Knm::Setting::secretsTypes)data.value(NM_VPNC_KEY_XAUTH_PASSWORD"-flags").toInt()).testFlag(Knm::Setting::NotRequired)) {
d->ui.leUserPassword->setText(secrets.value(QLatin1String(NM_VPNC_KEY_XAUTH_PASSWORD)));
} else {
d->ui.userLabel->setVisible(false);
d->ui.leUserPassword->setVisible(false);
}
if (!((Knm::Setting::secretsTypes)d->setting->data().value(NM_VPNC_KEY_SECRET"-flags").toInt()).testFlag(Knm::Setting::NotRequired)) {
if (!((Knm::Setting::secretsTypes)data.value(NM_VPNC_KEY_SECRET"-flags").toInt()).testFlag(Knm::Setting::NotRequired)) {
d->ui.leGroupPassword->setText(secrets.value(QLatin1String(NM_VPNC_KEY_SECRET)));
} else {
d->ui.groupLabel->setVisible(false);
......
......@@ -17,7 +17,7 @@
<property name="margin">
<number>0</number>
</property>
<item row="0" column="0">
<item row="1" column="0">
<widget class="QLabel" name="userLabel">
<property name="text">
<string>User &amp;Password:</string>
......@@ -30,7 +30,7 @@
</property>
</widget>
</item>
<item row="1" column="0">
<item row="3" column="0">
<widget class="QLabel" name="groupLabel">
<property name="text">
<string>&amp;Group Password:</string>
......@@ -43,14 +43,14 @@
</property>
</widget>
</item>
<item row="0" column="2">
<item row="1" column="2">
<widget class="KLineEdit" name="leUserPassword">
<property name="passwordMode">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="1">
<item row="5" column="1">
<spacer name="spacer1">
<property name="orientation">
<enum>Qt::Vertical</enum>
......@@ -66,14 +66,14 @@
</property>
</spacer>
</item>
<item row="1" column="2">
<item row="3" column="2">
<widget class="KLineEdit" name="leGroupPassword">
<property name="passwordMode">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="2">
<item row="4" column="2">
<widget class="QCheckBox" name="cbShowPasswords">
<property name="text">
<string>&amp;Show passwords</string>
......@@ -83,6 +83,43 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>&amp;Username:</string>
</property>
<property name="buddy">
<cstring>leUserName</cstring>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="KLineEdit" name="leUserName">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelGroup">
<property name="text">
<string>Group name:</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
<property name="buddy">
<cstring>leGroupName</cstring>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="KLineEdit" name="leGroupName">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
......@@ -95,4 +132,5 @@
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
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