summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/ppp/edit.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings/ppp/edit.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/ppp/edit.cpp52
1 files changed, 4 insertions, 48 deletions
diff --git a/noncore/settings/networksettings/ppp/edit.cpp b/noncore/settings/networksettings/ppp/edit.cpp
index 45d6e4f..b880978 100644
--- a/noncore/settings/networksettings/ppp/edit.cpp
+++ b/noncore/settings/networksettings/ppp/edit.cpp
@@ -31,25 +31,26 @@
31#include <qregexp.h> 31#include <qregexp.h>
32#include <qapplication.h> 32#include <qapplication.h>
33#include <qbuttongroup.h> 33#include <qbuttongroup.h>
34#include <qvgroupbox.h> 34#include <qvgroupbox.h>
35#include <qhbox.h> 35#include <qhbox.h>
36#include <qdialog.h> 36#include <qdialog.h>
37#include <qpe/resource.h>
37 38
38#include "edit.h" 39#include "edit.h"
39#include "pppdata.h" 40#include "pppdata.h"
40#include "iplined.h" 41#include "iplined.h"
41#include "auth.h" 42#include "auth.h"
42 43
43DialWidget::DialWidget( PPPData *pd, QWidget *parent, bool isnewaccount 44DialWidget::DialWidget( PPPData *pd, QWidget *parent, bool isnewaccount
44 , const char *name ) 45 , const char *name )
45 : QWidget(parent, name), _pppdata(pd) 46 : QWidget(parent, name), _pppdata(pd)
46{ 47{
47 const int GRIDROWS = 6; 48 const int GRIDROWS = 6;
48 49
49 QGridLayout *tl = new QGridLayout(this, GRIDROWS, 2, 0 );//, KDialog::spacingHint()); 50 QGridLayout *tl = new QGridLayout(this, GRIDROWS, 2, 0 );
50 51
51 connect_label = new QLabel(tr("Connection name:"), this); 52 connect_label = new QLabel(tr("Connection name:"), this);
52 tl->addWidget(connect_label, 0, 0); 53 tl->addWidget(connect_label, 0, 0);
53 54
54 connectname_l = new QLineEdit(this); 55 connectname_l = new QLineEdit(this);
55// connectname_l->setMaxLength(ACCNAME_SIZE); 56// connectname_l->setMaxLength(ACCNAME_SIZE);
@@ -72,17 +73,15 @@ DialWidget::DialWidget( PPPData *pd, QWidget *parent, bool isnewaccount
72 QVBoxLayout *lpn1 = new QVBoxLayout; 73 QVBoxLayout *lpn1 = new QVBoxLayout;
73 lpn->addLayout(lpn1); 74 lpn->addLayout(lpn1);
74 add = new QPushButton(tr("&Add..."), this); 75 add = new QPushButton(tr("&Add..."), this);
75 del = new QPushButton(tr("&Remove"), this); 76 del = new QPushButton(tr("&Remove"), this);
76 77
77 up = new QPushButton(this); 78 up = new QPushButton(this);
78//FIXME: QPixmap pm = BarIcon("up"); 79 up->setPixmap( Resource::loadPixmap("inline/up") );
79// up->setPixmap(pm);
80 down = new QPushButton(this); 80 down = new QPushButton(this);
81//FIXME: pm = BarIcon("down"); 81 down->setPixmap( Resource::loadPixmap("inline/down") );
82// down->setPixmap(pm);
83 lpn1->addWidget(add); 82 lpn1->addWidget(add);
84 lpn1->addWidget(del); 83 lpn1->addWidget(del);
85 lpn1->addStretch(1); 84 lpn1->addStretch(1);
86 lpn1->addWidget(up); 85 lpn1->addWidget(up);
87 lpn1->addWidget(down); 86 lpn1->addWidget(down);
88 connect(add, SIGNAL(clicked()), 87 connect(add, SIGNAL(clicked()),
@@ -105,48 +104,12 @@ DialWidget::DialWidget( PPPData *pd, QWidget *parent, bool isnewaccount
105 "When a number is busy or fails, <i>kppp</i> will \n" 104 "When a number is busy or fails, <i>kppp</i> will \n"
106 "try the next number and so on"); 105 "try the next number and so on");
107 106
108 QWhatsThis::add(number_label,tmp); 107 QWhatsThis::add(number_label,tmp);
109 QWhatsThis::add(numbers,tmp); 108 QWhatsThis::add(numbers,tmp);
110 109
111 auth_l = new QLabel(tr("Authentication:"), this);
112 tl->addWidget(auth_l, 3, 0);
113
114 auth = new QComboBox(this);
115 auth->insertItem(tr("Script-based"));
116 auth->insertItem(tr("PAP"));
117 auth->insertItem(tr("Terminal-based"));
118 auth->insertItem(tr("CHAP"));
119 auth->insertItem(tr("PAP/CHAP"));
120 tl->addWidget(auth, 3, 1);
121 tmp = tr("<p>Specifies the method used to identify yourself to\n"
122 "the PPP server. Most universities still use\n"
123 "<b>Terminal</b>- or <b>Script</b>-based authentication,\n"
124 "while most ISP use <b>PAP</b> and/or <b>CHAP</b>. If\n"
125 "unsure, contact your ISP.\n"
126 "\n"
127 "If you can choose between PAP and CHAP,\n"
128 "choose CHAP, because it's much safer. If you don't know\n"
129 "whether PAP or CHAP is right, choose PAP/CHAP.");
130
131 QWhatsThis::add(auth_l,tmp);
132 QWhatsThis::add(auth,tmp);
133
134 store_password = new QCheckBox(tr("Store password"), this);
135 store_password->setChecked(true);
136 tl->addMultiCellWidget(store_password, 4, 4, 0, 1, AlignRight);
137 QWhatsThis::add(store_password,
138 tr("<p>When this is turned on, your ISP password\n"
139 "will be saved in <i>kppp</i>'s config file, so\n"
140 "you do not need to type it in every time.\n"
141 "\n"
142 "<b><font color=\"red\">Warning:</font> your password will be stored as\n"
143 "plain text in the config file, which is\n"
144 "readable only to you. Make sure nobody\n"
145 "gains access to this file!"));
146
147 pppdargs = new QPushButton(tr("Customize pppd Arguments..."), this); 110 pppdargs = new QPushButton(tr("Customize pppd Arguments..."), this);
148 connect(pppdargs, SIGNAL(clicked()), SLOT(pppdargsbutton())); 111 connect(pppdargs, SIGNAL(clicked()), SLOT(pppdargsbutton()));
149 tl->addMultiCellWidget(pppdargs, 5, 5, 0, 1, AlignCenter); 112 tl->addMultiCellWidget(pppdargs, 5, 5, 0, 1, AlignCenter);
150 113
151 // Set defaults if editing an existing connection 114 // Set defaults if editing an existing connection
152 if(!isnewaccount) { 115 if(!isnewaccount) {
@@ -165,17 +128,12 @@ DialWidget::DialWidget( PPPData *pd, QWidget *parent, bool isnewaccount
165 tmp += n[idx]; 128 tmp += n[idx];
166 idx++; 129 idx++;
167 } 130 }
168 if(tmp.length() > 0) 131 if(tmp.length() > 0)
169 numbers->insertItem(tmp); 132 numbers->insertItem(tmp);
170 133
171 auth->setCurrentItem(_pppdata->authMethod());
172 store_password->setChecked(_pppdata->storePassword());
173 } else {
174 // select PAP/CHAP as default
175 auth->setCurrentItem(AUTH_PAPCHAP);
176 } 134 }
177 135
178 numbersChanged(); 136 numbersChanged();
179 tl->activate(); 137 tl->activate();
180} 138}
181 139
@@ -192,14 +150,12 @@ bool DialWidget::save() {
192 if(i != 0) 150 if(i != 0)
193 number += ":"; 151 number += ":";
194 number += numbers->text(i); 152 number += numbers->text(i);
195 } 153 }
196 154
197 _pppdata->setPhonenumber(number); 155 _pppdata->setPhonenumber(number);
198 _pppdata->setAuthMethod(auth->currentItem());
199 _pppdata->setStorePassword(store_password->isChecked());
200 return true; 156 return true;
201 } 157 }
202} 158}
203 159
204 160
205void DialWidget::numbersChanged() { 161void DialWidget::numbersChanged() {