Commit 803b17ad authored by Jan Grulich's avatar Jan Grulich

Rename L2TP IPsec Settings dialog from Advanced to IPsec

Summary:
Calling the IPsec dialog Advanced is confusing, so rename it to IPsec.
Also in a subsequent patch there is also an Advanced group box in the IPsec dialog which would have added more confusion..

The following git file name renames occur in the vpn/l2tp folder and are in the patch file.
```
git mv l2tpadvancedwidget.cpp l2tpipsecwidget.cpp
git mv l2tpadvancedwidget.h l2tpipsecwidget.h
git mv l2tpadvanced.ui l2tpipsec.ui
```

Reviewers: jgrulich

Reviewed By: jgrulich

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D27763
parent 1ca6933e
......@@ -4,11 +4,11 @@ set(l2tp_SRCS
l2tp.cpp
l2tpwidget.cpp
l2tpauth.cpp
l2tpadvancedwidget.cpp
l2tpipsecwidget.cpp
l2tppppwidget.cpp
)
ki18n_wrap_ui(l2tp_SRCS l2tp.ui l2tpadvanced.ui l2tpauth.ui l2tpppp.ui)
ki18n_wrap_ui(l2tp_SRCS l2tp.ui l2tpipsec.ui l2tpauth.ui l2tpppp.ui)
add_library(plasmanetworkmanagement_l2tpui ${l2tp_SRCS})
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>L2tpAdvancedWidget</class>
<widget class="QWidget" name="L2tpAdvancedWidget">
<class>L2tpIpsecWidget</class>
<widget class="QWidget" name="L2tpIpsecWidget">
<property name="geometry">
<rect>
<x>0</x>
......@@ -270,7 +270,7 @@
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>L2tpAdvancedWidget</receiver>
<receiver>L2tpIpsecWidget</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
......@@ -286,7 +286,7 @@
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>L2tpAdvancedWidget</receiver>
<receiver>L2tpIpsecWidget</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
......
......@@ -18,16 +18,16 @@
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "l2tpadvancedwidget.h"
#include "ui_l2tpadvanced.h"
#include "l2tpipsecwidget.h"
#include "ui_l2tpipsec.h"
#include "nm-l2tp-service.h"
#include <KLocalizedString>
#include <KAcceleratorManager>
L2tpAdvancedWidget::L2tpAdvancedWidget(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent)
L2tpIpsecWidget::L2tpIpsecWidget(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent)
: QDialog(parent)
, m_ui(new Ui::L2tpAdvancedWidget)
, m_ui(new Ui::L2tpIpsecWidget)
{
m_ui->setupUi(this);
......@@ -38,12 +38,12 @@ L2tpAdvancedWidget::L2tpAdvancedWidget(const NetworkManager::VpnSetting::Ptr &se
loadConfig(setting);
}
L2tpAdvancedWidget::~L2tpAdvancedWidget()
L2tpIpsecWidget::~L2tpIpsecWidget()
{
delete m_ui;
}
void L2tpAdvancedWidget::loadConfig(const NetworkManager::VpnSetting::Ptr &setting)
void L2tpIpsecWidget::loadConfig(const NetworkManager::VpnSetting::Ptr &setting)
{
if (setting->data().value(NM_L2TP_KEY_IPSEC_ENABLE) == "yes") {
m_ui->cbEnableTunnelToHost->setChecked(true);
......@@ -61,7 +61,7 @@ void L2tpAdvancedWidget::loadConfig(const NetworkManager::VpnSetting::Ptr &setti
}
}
NMStringMap L2tpAdvancedWidget::setting() const
NMStringMap L2tpIpsecWidget::setting() const
{
NMStringMap result;
......
......@@ -18,8 +18,8 @@
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PLASMA_NM_L2TP_ADVANCED_WIDGET_H
#define PLASMA_NM_L2TP_ADVANCED_WIDGET_H
#ifndef PLASMA_NM_L2TP_IPSEC_WIDGET_H
#define PLASMA_NM_L2TP_IPSEC_WIDGET_H
#include <QDialog>
......@@ -27,21 +27,21 @@
namespace Ui
{
class L2tpAdvancedWidget;
class L2tpIpsecWidget;
}
class L2tpAdvancedWidget : public QDialog
class L2tpIpsecWidget : public QDialog
{
Q_OBJECT
public:
explicit L2tpAdvancedWidget(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent = nullptr);
~L2tpAdvancedWidget() override;
explicit L2tpIpsecWidget(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent = nullptr);
~L2tpIpsecWidget() override;
NMStringMap setting() const;
private:
void loadConfig(const NetworkManager::VpnSetting::Ptr &setting);
Ui::L2tpAdvancedWidget * m_ui;
Ui::L2tpIpsecWidget * m_ui;
};
#endif // PLASMA_NM_L2TP_ADVANCED_WIDGET_H
#endif // PLASMA_NM_L2TP_IPSEC_WIDGET_H
......@@ -19,7 +19,7 @@
*/
#include "l2tpwidget.h"
#include "l2tpadvancedwidget.h"
#include "l2tpipsecwidget.h"
#include "l2tppppwidget.h"
#include "ui_l2tp.h"
#include "nm-l2tp-service.h"
......@@ -40,7 +40,7 @@ L2tpWidget::L2tpWidget(const NetworkManager::VpnSetting::Ptr &setting, QWidget*
m_ui->password->setPasswordOptionsEnabled(true);
connect(m_ui->btnIPSecSettings, &QPushButton::clicked, this, &L2tpWidget::showAdvanced);
connect(m_ui->btnIPSecSettings, &QPushButton::clicked, this, &L2tpWidget::showIpsec);
connect(m_ui->btnPPPSettings, &QPushButton::clicked, this, &L2tpWidget::showPpp);
// Connect for setting check
......@@ -59,7 +59,7 @@ L2tpWidget::L2tpWidget(const NetworkManager::VpnSetting::Ptr &setting, QWidget*
L2tpWidget::~L2tpWidget()
{
m_tmpAdvancedSetting.clear();
m_tmpIpsecSetting.clear();
m_tmpPppSetting.clear();
delete m_ui;
}
......@@ -128,12 +128,12 @@ QVariantMap L2tpWidget::setting() const
NetworkManager::VpnSetting setting;
setting.setServiceType(QLatin1String(NM_DBUS_SERVICE_L2TP));
NMStringMap data;
if (!m_tmpAdvancedSetting.isNull()) {
data = m_tmpAdvancedSetting->data();
if (!m_tmpIpsecSetting.isNull()) {
data = m_tmpIpsecSetting->data();
} else {
// retrieve the settings if the dialog has not been opened
QScopedPointer<L2tpAdvancedWidget> adv(new L2tpAdvancedWidget(m_setting, nullptr));
data = adv->setting();
QScopedPointer<L2tpIpsecWidget> ipsec(new L2tpIpsecWidget(m_setting, nullptr));
data = ipsec->setting();
}
if (!m_tmpPppSetting.isNull()) {
......@@ -204,60 +204,60 @@ void L2tpWidget::userPasswordTypeChanged(int index)
m_ui->password->setEnabled(index == SettingWidget::EnumPasswordStorageType::Store);
}
void L2tpWidget::showAdvanced()
void L2tpWidget::showIpsec()
{
QPointer<L2tpAdvancedWidget> adv;
if (m_tmpAdvancedSetting.isNull()) {
adv = new L2tpAdvancedWidget(m_setting, this);
QPointer<L2tpIpsecWidget> ipsec;
if (m_tmpIpsecSetting.isNull()) {
ipsec = new L2tpIpsecWidget(m_setting, this);
} else {
adv = new L2tpAdvancedWidget(m_tmpAdvancedSetting, this);
ipsec = new L2tpIpsecWidget(m_tmpIpsecSetting, this);
}
connect(adv.data(), &L2tpAdvancedWidget::accepted,
[adv, this] () {
NMStringMap advData = adv->setting();
if (!advData.isEmpty()) {
if (m_tmpAdvancedSetting.isNull()) {
m_tmpAdvancedSetting = NetworkManager::VpnSetting::Ptr(new NetworkManager::VpnSetting);
connect(ipsec.data(), &L2tpIpsecWidget::accepted,
[ipsec, this] () {
NMStringMap ipsecData = ipsec->setting();
if (!ipsecData.isEmpty()) {
if (m_tmpIpsecSetting.isNull()) {
m_tmpIpsecSetting = NetworkManager::VpnSetting::Ptr(new NetworkManager::VpnSetting);
}
m_tmpAdvancedSetting->setData(advData);
m_tmpIpsecSetting->setData(ipsecData);
}
});
connect(adv.data(), &L2tpAdvancedWidget::finished,
[adv] () {
if (adv) {
adv->deleteLater();
connect(ipsec.data(), &L2tpIpsecWidget::finished,
[ipsec] () {
if (ipsec) {
ipsec->deleteLater();
}
});
adv->setModal(true);
adv->show();
ipsec->setModal(true);
ipsec->show();
}
void L2tpWidget::showPpp()
{
QPointer<L2tpPPPWidget> adv;
QPointer<L2tpPPPWidget> ipsec;
if (m_tmpPppSetting.isNull()) {
adv = new L2tpPPPWidget(m_setting, this);
ipsec = new L2tpPPPWidget(m_setting, this);
} else {
adv = new L2tpPPPWidget(m_tmpPppSetting, this);
ipsec = new L2tpPPPWidget(m_tmpPppSetting, this);
}
connect(adv.data(), &L2tpPPPWidget::accepted,
[adv, this] () {
NMStringMap advData = adv->setting();
if (!advData.isEmpty()) {
connect(ipsec.data(), &L2tpPPPWidget::accepted,
[ipsec, this] () {
NMStringMap ipsecData = ipsec->setting();
if (!ipsecData.isEmpty()) {
if (m_tmpPppSetting.isNull()) {
m_tmpPppSetting = NetworkManager::VpnSetting::Ptr(new NetworkManager::VpnSetting);
}
m_tmpPppSetting->setData(advData);
m_tmpPppSetting->setData(ipsecData);
}
});
connect(adv.data(), &L2tpPPPWidget::finished,
[adv] () {
if (adv) {
adv->deleteLater();
connect(ipsec.data(), &L2tpPPPWidget::finished,
[ipsec] () {
if (ipsec) {
ipsec->deleteLater();
}
});
adv->setModal(true);
adv->show();
ipsec->setModal(true);
ipsec->show();
}
bool L2tpWidget::isValid() const
......
......@@ -46,14 +46,14 @@ public:
private Q_SLOTS:
void userPasswordTypeChanged(int index);
void showAdvanced();
void showIpsec();
void showPpp();
void certStateChanged();
private:
Ui::L2tpWidget * m_ui;
NetworkManager::VpnSetting::Ptr m_setting;
NetworkManager::VpnSetting::Ptr m_tmpAdvancedSetting;
NetworkManager::VpnSetting::Ptr m_tmpIpsecSetting;
NetworkManager::VpnSetting::Ptr m_tmpPppSetting;
};
......
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