2
Copyright 2013 Lukas Tinkl <ltinkl@redhat.com>
4
This library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Lesser General Public
6
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
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
act as a proxy defined in Section 6 of version 3 of the license.
12
This library is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
Lesser General Public License for more details.
17
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/>.
21
#include "pppwidget.h"
24
#include <NetworkManagerQt/PppSetting>
26
PPPWidget::PPPWidget(const NetworkManager::Setting::Ptr &setting, QWidget* parent, Qt::WindowFlags f):
27
SettingWidget(setting, parent, f),
28
m_ui(new Ui::PPPWidget)
32
KAcceleratorManager::manage(this);
38
PPPWidget::~PPPWidget()
43
void PPPWidget::loadConfig(const NetworkManager::Setting::Ptr &setting)
45
NetworkManager::PppSetting::Ptr pppSetting = setting.staticCast<NetworkManager::PppSetting>();
47
m_ui->eap->setChecked(!pppSetting->refuseEap());
48
m_ui->pap->setChecked(!pppSetting->refusePap());
49
m_ui->chap->setChecked(!pppSetting->refuseChap());
50
m_ui->mschap->setChecked(!pppSetting->refuseMschap());
51
m_ui->mschapv2->setChecked(!pppSetting->refuseMschapv2());
53
m_ui->mppe->setChecked(pppSetting->requireMppe());
54
m_ui->mppe128->setChecked(pppSetting->requireMppe128());
55
m_ui->mppeStateful->setChecked(pppSetting->mppeStateful());
57
m_ui->bsdComp->setChecked(!pppSetting->noBsdComp());
58
m_ui->deflateComp->setChecked(!pppSetting->noDeflate());
59
m_ui->tcpComp->setChecked(!pppSetting->noVjComp());
61
if (pppSetting->lcpEchoInterval() > 0) {
62
m_ui->senddEcho->setChecked(true);
64
m_ui->senddEcho->setChecked(false);
68
QVariantMap PPPWidget::setting(bool agentOwned) const
72
NetworkManager::PppSetting pppSetting;
74
pppSetting.setRefuseEap(!m_ui->eap->isChecked());
75
pppSetting.setRefusePap(!m_ui->pap->isChecked());
76
pppSetting.setRefuseChap(!m_ui->chap->isChecked());
77
pppSetting.setRefuseMschap(!m_ui->mschap->isChecked());
78
pppSetting.setRefuseMschapv2(!m_ui->mschapv2->isChecked());
80
pppSetting.setRequireMppe(m_ui->mppe->isChecked());
81
pppSetting.setRequireMppe128(m_ui->mppe128->isChecked());
82
pppSetting.setMppeStateful(m_ui->mppeStateful->isChecked());
84
pppSetting.setNoBsdComp(!m_ui->bsdComp->isChecked());
85
pppSetting.setNoDeflate(!m_ui->deflateComp->isChecked());
86
pppSetting.setNoVjComp(!m_ui->tcpComp->isChecked());
88
if (m_ui->senddEcho->isChecked()) {
89
pppSetting.setLcpEchoFailure(5);
90
pppSetting.setLcpEchoInterval(30);
93
return pppSetting.toMap();