Changeset View
Changeset View
Standalone View
Standalone View
vpn/l2tp/l2tpipsecwidget.h
- This file was moved from vpn/l2tp/l2tpadvancedwidget.h.
1 | /* | 1 | /* | ||
---|---|---|---|---|---|
2 | Copyright 2013 Jan Grulich <jgrulich@redhat.com> | 2 | Copyright 2013 Jan Grulich <jgrulich@redhat.com> | ||
3 | Copyright 2020 Douglas Kosovic <doug@uq.edu.au> | ||||
3 | 4 | | |||
4 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or | ||
5 | modify it under the terms of the GNU Lesser General Public | 6 | modify it under the terms of the GNU Lesser General Public | ||
6 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either | ||
7 | version 2.1 of the License, or (at your option) version 3, or any | 8 | version 2.1 of the License, or (at your option) version 3, or any | ||
8 | later version accepted by the membership of KDE e.V. (or its | 9 | later version accepted by the membership of KDE e.V. (or its | ||
9 | successor approved by the membership of KDE e.V.), which shall | 10 | successor approved by the membership of KDE e.V.), which shall | ||
10 | act as a proxy defined in Section 6 of version 3 of the license. | 11 | act as a proxy defined in Section 6 of version 3 of the license. | ||
11 | 12 | | |||
12 | This library is distributed in the hope that it will be useful, | 13 | This library is distributed in the hope that it will be useful, | ||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | Lesser General Public License for more details. | 16 | Lesser General Public License for more details. | ||
16 | 17 | | |||
17 | You should have received a copy of the GNU Lesser General Public | 18 | You should have received a copy of the GNU Lesser General Public | ||
18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | 19 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | 20 | */ | ||
20 | 21 | | |||
21 | #ifndef PLASMA_NM_L2TP_ADVANCED_WIDGET_H | 22 | #ifndef PLASMA_NM_L2TP_IPSEC_WIDGET_H | ||
22 | #define PLASMA_NM_L2TP_ADVANCED_WIDGET_H | 23 | #define PLASMA_NM_L2TP_IPSEC_WIDGET_H | ||
23 | 24 | | |||
24 | #include <QDialog> | 25 | #include <QDialog> | ||
25 | 26 | | |||
26 | #include <NetworkManagerQt/VpnSetting> | 27 | #include <NetworkManagerQt/VpnSetting> | ||
27 | 28 | | |||
28 | namespace Ui | 29 | namespace Ui | ||
29 | { | 30 | { | ||
30 | class L2tpAdvancedWidget; | 31 | class L2tpIpsecWidget; | ||
31 | } | 32 | } | ||
32 | 33 | | |||
33 | class L2tpAdvancedWidget : public QDialog | 34 | class L2tpIpsecWidget : public QDialog | ||
34 | { | 35 | { | ||
35 | Q_OBJECT | 36 | Q_OBJECT | ||
37 | | ||||
38 | enum AuthType {PSK = 0, TLS}; | ||||
39 | enum IpsecDaemonType {NoIpsecDaemon, Libreswan, Strongswan, Openswan, UnknownIpsecDaemon}; | ||||
40 | | ||||
36 | public: | 41 | public: | ||
37 | explicit L2tpAdvancedWidget(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent = nullptr); | 42 | explicit L2tpIpsecWidget(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent = nullptr); | ||
38 | ~L2tpAdvancedWidget() override; | 43 | ~L2tpIpsecWidget() override; | ||
39 | 44 | | |||
40 | NMStringMap setting() const; | 45 | NMStringMap setting() const; | ||
46 | NMStringMap secrets() const; | ||||
47 | | ||||
48 | static bool hasIpsecDaemon(); | ||||
49 | | ||||
50 | private Q_SLOTS: | ||||
51 | void updateStartDirUrl(const QUrl &); | ||||
52 | void setDefaultIkelifetime(bool isChecked); | ||||
53 | void setDefaultSalifetime(bool isChecked); | ||||
54 | void resizeStackedWidget(int currentIndex); | ||||
41 | 55 | | |||
42 | private: | 56 | private: | ||
43 | void loadConfig(const NetworkManager::VpnSetting::Ptr &setting); | 57 | void loadConfig(const NetworkManager::VpnSetting::Ptr &setting); | ||
44 | Ui::L2tpAdvancedWidget * m_ui; | 58 | Ui::L2tpIpsecWidget * m_ui; | ||
59 | static IpsecDaemonType m_ipsecDaemonType; | ||||
45 | }; | 60 | }; | ||
46 | 61 | | |||
47 | #endif // PLASMA_NM_L2TP_ADVANCED_WIDGET_H | 62 | #endif // PLASMA_NM_L2TP_IPSEC_WIDGET_H |