Commit 0355bee0 authored by Jan Grulich's avatar Jan Grulich

Openconnect: Add option to select protocol

parent 480a9e2b
......@@ -26,7 +26,7 @@
<property name="verticalSpacing">
<number>6</number>
</property>
<item row="0" column="0">
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Gateway:</string>
......@@ -36,10 +36,10 @@
</property>
</widget>
</item>
<item row="0" column="1">
<item row="1" column="1">
<widget class="QLineEdit" name="leGateway"/>
</item>
<item row="1" column="0">
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>CA Certificate:</string>
......@@ -49,14 +49,14 @@
</property>
</widget>
</item>
<item row="1" column="1">
<item row="2" column="1">
<widget class="KUrlRequester" name="leCaCertificate">
<property name="filter">
<string>*.pem *.crt *.key</string>
</property>
</widget>
</item>
<item row="2" column="0">
<item row="3" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Proxy:</string>
......@@ -66,10 +66,10 @@
</property>
</widget>
</item>
<item row="2" column="1">
<item row="3" column="1">
<widget class="QLineEdit" name="leProxy"/>
</item>
<item row="4" column="0">
<item row="5" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>CSD Wrapper Script:</string>
......@@ -79,16 +79,43 @@
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<item row="4" column="0" colspan="2">
<widget class="QCheckBox" name="chkAllowTrojan">
<property name="text">
<string>Allow Cisco Secure Desktop trojan</string>
</property>
</widget>
</item>
<item row="4" column="1">
<item row="5" column="1">
<widget class="KUrlRequester" name="leCsdWrapperScript"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>VPN Protocol:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="cmbProtocol">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>Cisco AnyConnect</string>
</property>
</item>
<item>
<property name="text">
<string>Juniper/Pulse Network Connect</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
......
......@@ -69,6 +69,7 @@ void OpenconnectSettingWidget::loadConfig(const NetworkManager::Setting::Ptr &se
// General settings
const NMStringMap dataMap = d->setting->data();
d->ui.cmbProtocol->setCurrentIndex(dataMap[NM_OPENCONNECT_KEY_PROTOCOL] != QLatin1String("anyconnect"));
d->ui.leGateway->setText(dataMap[NM_OPENCONNECT_KEY_GATEWAY]);
d->ui.leCaCertificate->setUrl(QUrl::fromLocalFile(dataMap[NM_OPENCONNECT_KEY_CACERT]));
d->ui.leProxy->setText(dataMap[NM_OPENCONNECT_KEY_PROXY]);
......@@ -88,6 +89,7 @@ QVariantMap OpenconnectSettingWidget::setting() const
NMStringMap data;
data.insert(NM_OPENCONNECT_KEY_PROTOCOL, d->ui.cmbProtocol->currentIndex() ? QLatin1String("nc") : QLatin1String("anyconnect"));
data.insert(QLatin1String(NM_OPENCONNECT_KEY_GATEWAY), d->ui.leGateway->text());
if (d->ui.leCaCertificate->url().isValid()) {
data.insert(QLatin1String(NM_OPENCONNECT_KEY_CACERT), d->ui.leCaCertificate->url().toLocalFile());
......@@ -114,11 +116,6 @@ QVariantMap OpenconnectSettingWidget::setting() const
}
}
// Restore configured protocol if any, either juniper or anyconnect
if (d->setting->data().contains(NM_OPENCONNECT_KEY_PROTOCOL)) {
data.insert(NM_OPENCONNECT_KEY_PROTOCOL, d->setting->data().value(NM_OPENCONNECT_KEY_PROTOCOL));
}
/* These are different for every login session, and should not be stored */
data.insert(QLatin1String(NM_OPENCONNECT_KEY_COOKIE"-flags"), QString::number(NetworkManager::Setting::NotSaved));
data.insert(QLatin1String(NM_OPENCONNECT_KEY_GWCERT"-flags"), QString::number(NetworkManager::Setting::NotSaved));
......
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