Lines 43-53
Link Here
|
43 |
#include "newwidget.h" |
43 |
#include "newwidget.h" |
44 |
#include "iplined.h" |
44 |
#include "iplined.h" |
45 |
#include "auth.h" |
45 |
#include "auth.h" |
|
|
46 |
#include "cbtype.h" |
46 |
|
47 |
|
47 |
DialWidget::DialWidget( QWidget *parent, bool isnewaccount, const char *name ) |
48 |
DialWidget::DialWidget( QWidget *parent, bool isnewaccount, const char *name ) |
48 |
: QWidget(parent, name) |
49 |
: QWidget(parent, name) |
49 |
{ |
50 |
{ |
50 |
const int GRIDROWS = 6; |
51 |
const int GRIDROWS = 8; |
51 |
|
52 |
|
52 |
QGridLayout *tl = new QGridLayout(parent, GRIDROWS, 2, 0, KDialog::spacingHint()); |
53 |
QGridLayout *tl = new QGridLayout(parent, GRIDROWS, 2, 0, KDialog::spacingHint()); |
53 |
|
54 |
|
Lines 150-159
Link Here
|
150 |
"plain text in the config file, which is\n" |
151 |
"plain text in the config file, which is\n" |
151 |
"readable only to you. Make sure nobody\n" |
152 |
"readable only to you. Make sure nobody\n" |
152 |
"gains access to this file!")); |
153 |
"gains access to this file!")); |
153 |
|
154 |
|
|
|
155 |
cbtype_l = new QLabel(i18n("&Callback type:"), parent); |
156 |
tl->addWidget(cbtype_l, 5, 0); |
157 |
|
158 |
cbtype = new QComboBox(parent); |
159 |
cbtype_l->setBuddy(cbtype); |
160 |
cbtype->insertItem(i18n("None")); |
161 |
cbtype->insertItem(i18n("Administrator-defined")); |
162 |
cbtype->insertItem(i18n("User-defined")); |
163 |
connect(cbtype, SIGNAL(highlighted(int)), |
164 |
this, SLOT(cbtypeChanged(int))); |
165 |
tl->addWidget(cbtype, 5, 1); |
166 |
tmp = i18n("Callback type"); |
167 |
|
168 |
QWhatsThis::add(cbtype_l,tmp); |
169 |
QWhatsThis::add(cbtype,tmp); |
170 |
|
171 |
cbphone_l = new QLabel(i18n("Call&back number:"), parent); |
172 |
tl->addWidget(cbphone_l, 6, 0); |
173 |
|
174 |
cbphone = new QLineEdit(parent); |
175 |
cbphone_l->setBuddy(cbphone); |
176 |
cbphone->setMaxLength(14); |
177 |
tl->addWidget(cbphone, 6, 1); |
178 |
tmp = i18n("Callback phone number"); |
179 |
|
180 |
QWhatsThis::add(cbphone_l,tmp); |
181 |
QWhatsThis::add(cbphone,tmp); |
182 |
|
154 |
pppdargs = new QPushButton(i18n("Customize &pppd Arguments..."), parent); |
183 |
pppdargs = new QPushButton(i18n("Customize &pppd Arguments..."), parent); |
155 |
connect(pppdargs, SIGNAL(clicked()), SLOT(pppdargsbutton())); |
184 |
connect(pppdargs, SIGNAL(clicked()), SLOT(pppdargsbutton())); |
156 |
tl->addMultiCellWidget(pppdargs, 5, 5, 0, 1, AlignCenter); |
185 |
tl->addMultiCellWidget(pppdargs, 7, 7, 0, 1, AlignCenter); |
157 |
|
186 |
|
158 |
// Set defaults if editing an existing connection |
187 |
// Set defaults if editing an existing connection |
159 |
if(!isnewaccount) { |
188 |
if(!isnewaccount) { |
Lines 177-187
Link Here
|
177 |
|
206 |
|
178 |
auth->setCurrentItem(gpppdata.authMethod()); |
207 |
auth->setCurrentItem(gpppdata.authMethod()); |
179 |
store_password->setChecked(gpppdata.storePassword()); |
208 |
store_password->setChecked(gpppdata.storePassword()); |
|
|
209 |
cbtype->setCurrentItem(gpppdata.callbackType()); |
210 |
cbphone->setText(gpppdata.callbackPhone()); |
180 |
} else { |
211 |
} else { |
181 |
// select PAP/CHAP as default |
212 |
// select PAP/CHAP as default |
182 |
auth->setCurrentItem(AUTH_PAPCHAP); |
213 |
auth->setCurrentItem(AUTH_PAPCHAP); |
|
|
214 |
// select NONE as default |
215 |
cbtype->setCurrentItem(CBTYPE_NONE); |
183 |
} |
216 |
} |
184 |
|
217 |
|
|
|
218 |
emit cbtypeChanged(cbtype->currentItem()); |
185 |
numbersChanged(); |
219 |
numbersChanged(); |
186 |
tl->activate(); |
220 |
tl->activate(); |
187 |
} |
221 |
} |
Lines 205-210
Link Here
|
205 |
gpppdata.setPhonenumber(number); |
239 |
gpppdata.setPhonenumber(number); |
206 |
gpppdata.setAuthMethod(auth->currentItem()); |
240 |
gpppdata.setAuthMethod(auth->currentItem()); |
207 |
gpppdata.setStorePassword(store_password->isChecked()); |
241 |
gpppdata.setStorePassword(store_password->isChecked()); |
|
|
242 |
gpppdata.setCallbackType(cbtype->currentItem()); |
243 |
gpppdata.setCallbackPhone(cbphone->text()); |
208 |
return true; |
244 |
return true; |
209 |
} |
245 |
} |
210 |
} |
246 |
} |
Lines 218-223
Link Here
|
218 |
down->setEnabled(sel != -1 && sel != (int)numbers->count()-1); |
254 |
down->setEnabled(sel != -1 && sel != (int)numbers->count()-1); |
219 |
} |
255 |
} |
220 |
|
256 |
|
|
|
257 |
void DialWidget::cbtypeChanged(int value) { |
258 |
cbphone_l->setEnabled(value == CBTYPE_USER); |
259 |
cbphone->setEnabled(value == CBTYPE_USER); |
260 |
} |
221 |
|
261 |
|
222 |
void DialWidget::selectionChanged(int) { |
262 |
void DialWidget::selectionChanged(int) { |
223 |
numbersChanged(); |
263 |
numbersChanged(); |