summaryrefslogtreecommitdiff
path: root/noncore
authortille <tille>2003-05-24 16:12:02 (UTC)
committer tille <tille>2003-05-24 16:12:02 (UTC)
commitcc1aa3e178dff65854913bd5667579fc33ce707d (patch) (unidiff)
treed37d7fd8fb3b9832c0825b015af862f2cc62f473 /noncore
parent5667ded1d4583cfb79b2ddfd7aaae0e58ed6d552 (diff)
downloadopie-cc1aa3e178dff65854913bd5667579fc33ce707d.zip
opie-cc1aa3e178dff65854913bd5667579fc33ce707d.tar.gz
opie-cc1aa3e178dff65854913bd5667579fc33ce707d.tar.bz2
saves config (still in the kppp way)
Diffstat (limited to 'noncore') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings/ppp/accounts.cpp104
-rw-r--r--noncore/settings/networksettings/ppp/connect.cpp180
-rw-r--r--noncore/settings/networksettings/ppp/conwindow.cpp26
-rw-r--r--noncore/settings/networksettings/ppp/debug.cpp2
-rw-r--r--noncore/settings/networksettings/ppp/edit.cpp232
-rw-r--r--noncore/settings/networksettings/ppp/general.cpp42
-rw-r--r--noncore/settings/networksettings/ppp/kpppwidget.cpp150
-rw-r--r--noncore/settings/networksettings/ppp/modem.cpp30
-rw-r--r--noncore/settings/networksettings/ppp/modemcmds.cpp111
-rw-r--r--noncore/settings/networksettings/ppp/newwidget.cpp17
-rw-r--r--noncore/settings/networksettings/ppp/newwidget.h19
-rw-r--r--noncore/settings/networksettings/ppp/ppp.pro4
-rw-r--r--noncore/settings/networksettings/ppp/pppconfig.cpp4
-rw-r--r--noncore/settings/networksettings/ppp/pppdargs.cpp10
-rw-r--r--noncore/settings/networksettings/ppp/pppdata.cpp211
-rw-r--r--noncore/settings/networksettings/ppp/pppdata.h56
-rw-r--r--noncore/settings/networksettings/ppp/pppmodule.cpp3
17 files changed, 587 insertions, 614 deletions
diff --git a/noncore/settings/networksettings/ppp/accounts.cpp b/noncore/settings/networksettings/ppp/accounts.cpp
index d902517..19db9ef 100644
--- a/noncore/settings/networksettings/ppp/accounts.cpp
+++ b/noncore/settings/networksettings/ppp/accounts.cpp
@@ -53,7 +53,7 @@ void parseargs(char* buf, char** args);
53AccountWidget::AccountWidget( QWidget *parent, const char *name ) 53AccountWidget::AccountWidget( QWidget *parent, const char *name )
54 : QWidget( parent, name ) 54 : QWidget( parent, name )
55{ 55{
56 int min = 0; 56// int min = 0;
57 QVBoxLayout *l1 = new QVBoxLayout(this, 10, 10); 57 QVBoxLayout *l1 = new QVBoxLayout(this, 10, 10);
58 58
59 // add a hbox 59 // add a hbox
@@ -61,7 +61,7 @@ AccountWidget::AccountWidget( QWidget *parent, const char *name )
61// l1->addLayout(l11); 61// l1->addLayout(l11);
62 62
63 accountlist_l = new QListBox(this); 63 accountlist_l = new QListBox(this);
64 accountlist_l->setMinimumSize(160, 128); 64// accountlist_l->setMinimumSize(160, 128);
65 connect(accountlist_l, SIGNAL(highlighted(int)), 65 connect(accountlist_l, SIGNAL(highlighted(int)),
66 this, SLOT(slotListBoxSelect(int))); 66 this, SLOT(slotListBoxSelect(int)));
67 connect(accountlist_l, SIGNAL(selected(int)), 67 connect(accountlist_l, SIGNAL(selected(int)),
@@ -74,9 +74,9 @@ AccountWidget::AccountWidget( QWidget *parent, const char *name )
74 connect(edit_b, SIGNAL(clicked()), SLOT(editaccount())); 74 connect(edit_b, SIGNAL(clicked()), SLOT(editaccount()));
75 QWhatsThis::add(edit_b, i18n("Allows you to modify the selected account")); 75 QWhatsThis::add(edit_b, i18n("Allows you to modify the selected account"));
76 76
77 min = edit_b->sizeHint().width(); 77// min = edit_b->sizeHint().width();
78 min = QMAX(70,min); 78// min = QMAX(70,min);
79 edit_b->setMinimumWidth(min); 79// edit_b->setMinimumWidth(min);
80 80
81 l1->addWidget(edit_b); 81 l1->addWidget(edit_b);
82 82
@@ -165,10 +165,10 @@ AccountWidget::AccountWidget( QWidget *parent, const char *name )
165// l122->addStretch(1); 165// l122->addStretch(1);
166 166
167 //load up account list from gppdata to the list box 167 //load up account list from gppdata to the list box
168 if(gpppdata.count() > 0) { 168 if(PPPData::data()->count() > 0) {
169 for(int i=0; i <= gpppdata.count()-1; i++) { 169 for(int i=0; i <= PPPData::data()->count()-1; i++) {
170 gpppdata.setAccountbyIndex(i); 170 PPPData::data()->setAccountbyIndex(i);
171 accountlist_l->insertItem(gpppdata.accname()); 171 accountlist_l->insertItem(PPPData::data()->accname());
172 } 172 }
173 } 173 }
174 174
@@ -184,8 +184,8 @@ void AccountWidget::slotListBoxSelect(int idx) {
184 edit_b->setEnabled((bool)(idx != -1)); 184 edit_b->setEnabled((bool)(idx != -1));
185 copy_b->setEnabled((bool)(idx != -1)); 185 copy_b->setEnabled((bool)(idx != -1));
186 if(idx!=-1) { 186 if(idx!=-1) {
187 QString account = gpppdata.accname(); 187 QString account = PPPData::data()->accname();
188 gpppdata.setAccountbyIndex(accountlist_l->currentItem()); 188 PPPData::data()->setAccountbyIndex(accountlist_l->currentItem());
189// reset->setEnabled(TRUE); 189// reset->setEnabled(TRUE);
190// costlabel->setEnabled(TRUE); 190// costlabel->setEnabled(TRUE);
191// costedit->setEnabled(TRUE); 191// costedit->setEnabled(TRUE);
@@ -193,9 +193,9 @@ void AccountWidget::slotListBoxSelect(int idx) {
193 193
194// vollabel->setEnabled(TRUE); 194// vollabel->setEnabled(TRUE);
195// voledit->setEnabled(TRUE); 195// voledit->setEnabled(TRUE);
196 int bytes = gpppdata.totalBytes(); 196// int bytes = PPPData::data()->totalBytes();
197// voledit->setText(prettyPrintVolume(bytes)); 197// voledit->setText(prettyPrintVolume(bytes));
198 gpppdata.setAccount(account); 198 PPPData::data()->setAccount(account);
199 } else{ 199 } else{
200 // reset->setEnabled(FALSE); 200 // reset->setEnabled(FALSE);
201// costlabel->setEnabled(FALSE); 201// costlabel->setEnabled(FALSE);
@@ -240,14 +240,14 @@ void AccountWidget::slotListBoxSelect(int idx) {
240 240
241 241
242void AccountWidget::editaccount() { 242void AccountWidget::editaccount() {
243 gpppdata.setAccount(accountlist_l->text(accountlist_l->currentItem())); 243 PPPData::data()->setAccount(accountlist_l->text(accountlist_l->currentItem()));
244 244
245 int result = doTab(); 245 int result = doTab();
246 246
247 if(result == QDialog::Accepted) { 247 if(result == QDialog::Accepted) {
248 accountlist_l->changeItem(gpppdata.accname(),accountlist_l->currentItem()); 248 accountlist_l->changeItem(PPPData::data()->accname(),accountlist_l->currentItem());
249// emit resetaccounts(); 249// emit resetaccounts();
250 gpppdata.save(); 250 PPPData::data()->save();
251 } 251 }
252} 252}
253 253
@@ -271,15 +271,15 @@ void AccountWidget::newaccount() {
271// switch(query) { 271// switch(query) {
272// case QMessageBox::Yes: 272// case QMessageBox::Yes:
273// { 273// {
274// if (gpppdata.newaccount() == -1) 274// if (PPPData::data()->newaccount() == -1)
275 // return; 275 // return;
276// // ProviderDB pdb(this); 276// // ProviderDB pdb(this);
277// // result = pdb.exec(); 277// // result = pdb.exec();
278// break; 278// break;
279// } 279// }
280// case QMessageBox::No: 280// case QMessageBox::No:
281 if (gpppdata.newaccount() == -1){ 281 if (PPPData::data()->newaccount() == -1){
282 qDebug("gpppdata.newaccount() == -1"); 282 qDebug("PPPData::data()->newaccount() == -1");
283 return; 283 return;
284 } 284 }
285 result = doTab(); 285 result = doTab();
@@ -289,13 +289,13 @@ void AccountWidget::newaccount() {
289// } 289// }
290 290
291 if(result == QDialog::Accepted) { 291 if(result == QDialog::Accepted) {
292 accountlist_l->insertItem(gpppdata.accname()); 292 accountlist_l->insertItem(PPPData::data()->accname());
293 accountlist_l->setSelected(accountlist_l->findItem(gpppdata.accname()), 293 accountlist_l->setSelected(accountlist_l->findItem(PPPData::data()->accname()),
294 true); 294 true);
295// emit resetaccounts(); 295// emit resetaccounts();
296 gpppdata.save(); 296 PPPData::data()->save();
297 } else 297 } else
298 gpppdata.deleteAccount(); 298 PPPData::data()->deleteAccount();
299} 299}
300 300
301 301
@@ -310,11 +310,11 @@ void AccountWidget::copyaccount() {
310 return; 310 return;
311 } 311 }
312 312
313 gpppdata.copyaccount(accountlist_l->currentItem()); 313 PPPData::data()->copyaccount(accountlist_l->currentItem());
314 314
315 accountlist_l->insertItem(gpppdata.accname()); 315 accountlist_l->insertItem(PPPData::data()->accname());
316// emit resetaccounts(); 316// emit resetaccounts();
317 gpppdata.save(); 317 PPPData::data()->save();
318} 318}
319 319
320 320
@@ -326,11 +326,11 @@ void AccountWidget::deleteaccount() {
326 if(QMessageBox::warning(this, s, i18n("Confirm")) != QMessageBox::Yes) 326 if(QMessageBox::warning(this, s, i18n("Confirm")) != QMessageBox::Yes)
327 return; 327 return;
328 328
329 if(gpppdata.deleteAccount(accountlist_l->text(accountlist_l->currentItem()))) 329 if(PPPData::data()->deleteAccount(accountlist_l->text(accountlist_l->currentItem())))
330 accountlist_l->removeItem(accountlist_l->currentItem()); 330 accountlist_l->removeItem(accountlist_l->currentItem());
331 331
332 emit resetaccounts(); 332 emit resetaccounts();
333 gpppdata.save(); 333 PPPData::data()->save();
334 334
335 slotListBoxSelect(accountlist_l->currentItem()); 335 slotListBoxSelect(accountlist_l->currentItem());
336 336
@@ -338,41 +338,45 @@ void AccountWidget::deleteaccount() {
338 338
339 339
340int AccountWidget::doTab(){ 340int AccountWidget::doTab(){
341 QDialog *dlg = new QDialog( this ); 341 QDialog *dlg = new QDialog( this, "newAccount", true );
342 tabWindow = new QTabWidget( dlg ); 342 QVBoxLayout *layout = new QVBoxLayout( dlg );
343 // tabWindow = new KDialogBase( KDialogBase::Tabbed, QString::null, 343 layout->setSpacing( 0 );
344// KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, 344 layout->setMargin( 1 );
345// 0, 0, true); 345
346// KWin::setIcons(tabWindow->winId(), kapp->icon(), kapp->miniIcon()); 346 tabWindow = new QTabWidget( dlg, "tabWindow" );
347 layout->addWidget( tabWindow );
348
347 bool isnewaccount; 349 bool isnewaccount;
348 350
349 if(gpppdata.accname().isEmpty()) { 351 if(PPPData::data()->accname().isEmpty()) {
350 tabWindow->setCaption(i18n("New Account")); 352 dlg->setCaption(i18n("New Account"));
351 isnewaccount = true; 353 isnewaccount = true;
352 } else { 354 } else {
353 QString tit = i18n("Edit Account: "); 355 QString tit = i18n("Edit Account: ");
354 tit += gpppdata.accname(); 356 tit += PPPData::data()->accname();
355 tabWindow->setCaption(tit); 357 dlg->setCaption(tit);
356 isnewaccount = false; 358 isnewaccount = false;
357 } 359 }
358 360
359 dial_w = new DialWidget( tabWindow ); 361 dial_w = new DialWidget( tabWindow, isnewaccount, "Dial Setup");
360 tabWindow->addTab( dial_w, i18n("Dial") );//, i18n("Dial Setup")), isnewaccount); 362 tabWindow->addTab( dial_w, i18n("Dial") );
361 ip_w = new IPWidget( tabWindow ); 363 ip_w = new IPWidget( tabWindow, isnewaccount, i18n("IP Setup"));
362 tabWindow->addTab( ip_w, i18n("IP") );//, i18n("IP Setup")), isnewaccount); 364 tabWindow->addTab( ip_w, i18n("IP") );
363 gateway_w = new GatewayWidget( tabWindow ); 365 gateway_w = new GatewayWidget( tabWindow, isnewaccount, i18n("Gateway Setup"));
364 tabWindow->addTab( gateway_w, i18n("Gateway") );//, i18n("Gateway Setup")), isnewaccount); 366 tabWindow->addTab( gateway_w, i18n("Gateway") );
365 dns_w = new DNSWidget( tabWindow ); 367 dns_w = new DNSWidget( tabWindow, isnewaccount, i18n("DNS Servers") );
366 tabWindow->addTab( dns_w, i18n("DNS") );//, i18n("DNS Servers")), isnewaccount); 368 tabWindow->addTab( dns_w, i18n("DNS") );
367 script_w = new ScriptWidget( tabWindow ); 369 script_w = new ScriptWidget( tabWindow, isnewaccount, i18n("Edit Login Script"));
368 tabWindow->addTab( script_w, i18n("Login Script") ); //, i18n("Edit Login Script")), isnewaccount); 370 tabWindow->addTab( script_w, i18n("Login Script") );
369 ExecWidget *exec_w = new ExecWidget( tabWindow ); 371 ExecWidget *exec_w = new ExecWidget( tabWindow, isnewaccount, i18n("Execute Programs"));
370 tabWindow->addTab( exec_w, i18n("Execute") );//, i18n("Execute Programs")), isnewaccount); 372 tabWindow->addTab( exec_w, i18n("Execute") );
371// acct = new AccountingSelector( tabWindow, isnewaccount ); 373// acct = new AccountingSelector( tabWindow, isnewaccount );
372// tabWindow->addTab( acct, i18n("Accounting")); 374// tabWindow->addTab( acct, i18n("Accounting"));
373 375
374 int result = 0; 376 int result = 0;
375 bool ok = false; 377 bool ok = false;
378 qDebug("AccountWidget::doTab dlg->showMinimized");
379 dlg->showMinimized();
376 while (!ok){ 380 while (!ok){
377 381
378 result = dlg->exec(); 382 result = dlg->exec();
diff --git a/noncore/settings/networksettings/ppp/connect.cpp b/noncore/settings/networksettings/ppp/connect.cpp
index b7e229e..a3eda9d 100644
--- a/noncore/settings/networksettings/ppp/connect.cpp
+++ b/noncore/settings/networksettings/ppp/connect.cpp
@@ -179,7 +179,7 @@ void ConnectWidget::preinit() {
179 179
180 180
181void ConnectWidget::init() { 181void ConnectWidget::init() {
182 gpppdata.setpppdError(0); 182 PPPData::data()->setpppdError(0);
183 inittimer->stop(); 183 inittimer->stop();
184 vmain = 0; 184 vmain = 0;
185 substate = -1; 185 substate = -1;
@@ -196,24 +196,24 @@ void ConnectWidget::init() {
196 196
197 p_kppp->con_speed = ""; 197 p_kppp->con_speed = "";
198 198
199// p_kppp->setQuitOnDisconnect (p_kppp->quitOnDisconnect() || gpppdata.quit_on_disconnect()); 199// p_kppp->setQuitOnDisconnect (p_kppp->quitOnDisconnect() || PPPData::data()->quit_on_disconnect());
200 200
201 comlist = &gpppdata.scriptType(); 201 comlist = &PPPData::data()->scriptType();
202 arglist = &gpppdata.script(); 202 arglist = &PPPData::data()->script();
203 203
204 QString tit = i18n("Connecting to: %1").arg(gpppdata.accname()); 204 QString tit = i18n("Connecting to: %1").arg(PPPData::data()->accname());
205 setCaption(tit); 205 setCaption(tit);
206 206
207 qApp->processEvents(); 207 qApp->processEvents();
208 208
209 // run the "before-connect" command 209 // run the "before-connect" command
210 if (!gpppdata.command_before_connect().isEmpty()) { 210 if (!PPPData::data()->command_before_connect().isEmpty()) {
211 messg->setText(i18n("Running pre-startup command...")); 211 messg->setText(i18n("Running pre-startup command..."));
212 emit debugMessage(i18n("Running pre-startup command...")); 212 emit debugMessage(i18n("Running pre-startup command..."));
213 213
214 qApp->processEvents(); 214 qApp->processEvents();
215 QApplication::flushX(); 215 QApplication::flushX();
216 pid_t id = execute_command(gpppdata.command_before_connect()); 216 pid_t id = execute_command(PPPData::data()->command_before_connect());
217// int i, status; 217// int i, status;
218 218
219// do { 219// do {
@@ -250,7 +250,7 @@ void ConnectWidget::init() {
250 Modem::modem->notify(this, SLOT(readChar(unsigned char))); 250 Modem::modem->notify(this, SLOT(readChar(unsigned char)));
251 251
252 // if we are stuck anywhere we will time out 252 // if we are stuck anywhere we will time out
253 timeout_timer->start(gpppdata.modemTimeout()*1000); 253 timeout_timer->start(PPPData::data()->modemTimeout()*1000);
254 254
255 // this timer will run the script etc. 255 // this timer will run the script etc.
256 main_timer_ID = startTimer(10); 256 main_timer_ID = startTimer(10);
@@ -284,18 +284,18 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
284 substate = 0; 284 substate = 0;
285 } 285 }
286 286
287 QString initStr = gpppdata.modemInitStr(substate); 287 QString initStr = PPPData::data()->modemInitStr(substate);
288 if (!initStr.isEmpty()) { 288 if (!initStr.isEmpty()) {
289 // send a carriage return and then wait a bit so that the modem will 289 // send a carriage return and then wait a bit so that the modem will
290 // let us issue commands. 290 // let us issue commands.
291 if(gpppdata.modemPreInitDelay() > 0) { 291 if(PPPData::data()->modemPreInitDelay() > 0) {
292 usleep(gpppdata.modemPreInitDelay() * 5000); 292 usleep(PPPData::data()->modemPreInitDelay() * 5000);
293 writeline(""); 293 writeline("");
294 usleep(gpppdata.modemPreInitDelay() * 5000); 294 usleep(PPPData::data()->modemPreInitDelay() * 5000);
295 } 295 }
296 setExpect(gpppdata.modemInitResp()); 296 setExpect(PPPData::data()->modemInitResp());
297 writeline(initStr); 297 writeline(initStr);
298 usleep(gpppdata.modemInitDelay() * 10000); // 0.01 - 3.0 sec 298 usleep(PPPData::data()->modemInitDelay() * 10000); // 0.01 - 3.0 sec
299 } 299 }
300 300
301 substate++; 301 substate++;
@@ -306,7 +306,7 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
306 * Speed Dragon). Even better would be to detect this when doing 306 * Speed Dragon). Even better would be to detect this when doing
307 * a "Modem Query" 307 * a "Modem Query"
308 */ 308 */
309 if (MODEM_TONEDURATION != gpppdata.modemToneDuration()) 309 if (MODEM_TONEDURATION != PPPData::data()->modemToneDuration())
310 vmain = 5; 310 vmain = 5;
311 else 311 else
312 vmain = 3; 312 vmain = 3;
@@ -316,11 +316,11 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
316 316
317 if (vmain == 5) { 317 if (vmain == 5) {
318 if(!expecting) { 318 if(!expecting) {
319 QString sToneDuration = "ATS11=" + QString::number(gpppdata.modemToneDuration()); 319 QString sToneDuration = "ATS11=" + QString::number(PPPData::data()->modemToneDuration());
320 QString msg = i18n("Setting ") + sToneDuration; 320 QString msg = i18n("Setting ") + sToneDuration;
321 messg->setText(msg); 321 messg->setText(msg);
322 emit debugMessage(msg); 322 emit debugMessage(msg);
323 setExpect(gpppdata.modemInitResp()); 323 setExpect(PPPData::data()->modemInitResp());
324 writeline(sToneDuration); 324 writeline(sToneDuration);
325 } 325 }
326 vmain = 3; 326 vmain = 3;
@@ -336,18 +336,18 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
336 } 336 }
337 substate = -1; 337 substate = -1;
338 // skip setting the volume if command is empty 338 // skip setting the volume if command is empty
339 if(gpppdata.volumeInitString().isEmpty()) { 339 if(PPPData::data()->volumeInitString().isEmpty()) {
340 vmain = 4; 340 vmain = 4;
341 return; 341 return;
342 } 342 }
343 messg->setText(i18n("Setting speaker volume...")); 343 messg->setText(i18n("Setting speaker volume..."));
344 emit debugMessage(i18n("Setting speaker volume...")); 344 emit debugMessage(i18n("Setting speaker volume..."));
345 345
346 setExpect(gpppdata.modemInitResp()); 346 setExpect(PPPData::data()->modemInitResp());
347 QString vol("AT"); 347 QString vol("AT");
348 vol += gpppdata.volumeInitString(); 348 vol += PPPData::data()->volumeInitString();
349 writeline(vol); 349 writeline(vol);
350 usleep(gpppdata.modemInitDelay() * 10000); // 0.01 - 3.0 sec 350 usleep(PPPData::data()->modemInitDelay() * 10000); // 0.01 - 3.0 sec
351 vmain = 4; 351 vmain = 4;
352 return; 352 return;
353 } 353 }
@@ -355,12 +355,12 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
355 355
356 if(vmain == 4) { 356 if(vmain == 4) {
357 if(!expecting) { 357 if(!expecting) {
358 if(!gpppdata.waitForDialTone()) { 358 if(!PPPData::data()->waitForDialTone()) {
359 QString msg = i18n("Turning off dial tone waiting..."); 359 QString msg = i18n("Turning off dial tone waiting...");
360 messg->setText(msg); 360 messg->setText(msg);
361 emit debugMessage(msg); 361 emit debugMessage(msg);
362 setExpect(gpppdata.modemInitResp()); 362 setExpect(PPPData::data()->modemInitResp());
363 writeline(gpppdata.modemNoDialToneDetectionStr()); 363 writeline(PPPData::data()->modemNoDialToneDetectionStr());
364 } 364 }
365 vmain = 1; 365 vmain = 1;
366 return; 366 return;
@@ -372,23 +372,23 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
372 if(!expecting) { 372 if(!expecting) {
373 373
374 timeout_timer->stop(); 374 timeout_timer->stop();
375 timeout_timer->start(gpppdata.modemTimeout()*1000); 375 timeout_timer->start(PPPData::data()->modemTimeout()*1000);
376 376
377 QStringList &plist = gpppdata.phonenumbers(); 377 QStringList &plist = PPPData::data()->phonenumbers();
378 QString bmarg= gpppdata.dialPrefix(); 378 QString bmarg= PPPData::data()->dialPrefix();
379 bmarg += *plist.at(dialnumber); 379 bmarg += *plist.at(dialnumber);
380 QString bm = i18n("Dialing %1").arg(bmarg); 380 QString bm = i18n("Dialing %1").arg(bmarg);
381 messg->setText(bm); 381 messg->setText(bm);
382 emit debugMessage(bm); 382 emit debugMessage(bm);
383 383
384 QString pn = gpppdata.modemDialStr(); 384 QString pn = PPPData::data()->modemDialStr();
385 pn += gpppdata.dialPrefix(); 385 pn += PPPData::data()->dialPrefix();
386 pn += *plist.at(dialnumber); 386 pn += *plist.at(dialnumber);
387 if(++dialnumber >= plist.count()) 387 if(++dialnumber >= plist.count())
388 dialnumber = 0; 388 dialnumber = 0;
389 writeline(pn); 389 writeline(pn);
390 390
391 setExpect(gpppdata.modemConnectResp()); 391 setExpect(PPPData::data()->modemConnectResp());
392 vmain = 100; 392 vmain = 100;
393 return; 393 return;
394 } 394 }
@@ -398,28 +398,28 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
398 // if NO CARRIER or NO DIALTONE 398 // if NO CARRIER or NO DIALTONE
399 if(vmain == 100) { 399 if(vmain == 100) {
400 if(!expecting) { 400 if(!expecting) {
401 myreadbuffer = gpppdata.modemConnectResp(); 401 myreadbuffer = PPPData::data()->modemConnectResp();
402 setExpect("\n"); 402 setExpect("\n");
403 vmain = 101; 403 vmain = 101;
404 return; 404 return;
405 } 405 }
406 406
407 if(readbuffer.contains(gpppdata.modemBusyResp())) { 407 if(readbuffer.contains(PPPData::data()->modemBusyResp())) {
408 timeout_timer->stop(); 408 timeout_timer->stop();
409 timeout_timer->start(gpppdata.modemTimeout()*1000); 409 timeout_timer->start(PPPData::data()->modemTimeout()*1000);
410 410
411 messg->setText(i18n("Line busy. Hanging up...")); 411 messg->setText(i18n("Line busy. Hanging up..."));
412 emit debugPutChar('\n'); 412 emit debugPutChar('\n');
413 Modem::modem->hangup(); 413 Modem::modem->hangup();
414 414
415 if(gpppdata.busyWait() > 0) { 415 if(PPPData::data()->busyWait() > 0) {
416 QString bm = i18n("Line busy. Waiting: %1 seconds").arg(gpppdata.busyWait()); 416 QString bm = i18n("Line busy. Waiting: %1 seconds").arg(PPPData::data()->busyWait());
417 messg->setText(bm); 417 messg->setText(bm);
418 emit debugMessage(bm); 418 emit debugMessage(bm);
419 419
420 pausing = true; 420 pausing = true;
421 421
422 pausetimer->start(gpppdata.busyWait()*1000, true); 422 pausetimer->start(PPPData::data()->busyWait()*1000, true);
423 timeout_timer->stop(); 423 timeout_timer->stop();
424 } 424 }
425 425
@@ -429,7 +429,7 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
429 return; 429 return;
430 } 430 }
431 431
432 if(readbuffer.contains(gpppdata.modemNoDialtoneResp())) { 432 if(readbuffer.contains(PPPData::data()->modemNoDialtoneResp())) {
433 timeout_timer->stop(); 433 timeout_timer->stop();
434 434
435 messg->setText(i18n("No Dialtone")); 435 messg->setText(i18n("No Dialtone"));
@@ -438,7 +438,7 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
438 return; 438 return;
439 } 439 }
440 440
441 if(readbuffer.contains(gpppdata.modemNoCarrierResp())) { 441 if(readbuffer.contains(PPPData::data()->modemNoCarrierResp())) {
442 timeout_timer->stop(); 442 timeout_timer->stop();
443 443
444 messg->setText(i18n("No Carrier")); 444 messg->setText(i18n("No Carrier"));
@@ -457,7 +457,7 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
457// p_kppp->con_win->startClock(); 457// p_kppp->con_win->startClock();
458 458
459 vmain = 2; 459 vmain = 2;
460 scriptTimeout=gpppdata.modemTimeout()*1000; 460 scriptTimeout=PPPData::data()->modemTimeout()*1000;
461 return; 461 return;
462 } 462 }
463 } 463 }
@@ -494,10 +494,10 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
494 emit debugMessage(bm); 494 emit debugMessage(bm);
495 495
496 if (scriptArgument.lower() == "password") { 496 if (scriptArgument.lower() == "password") {
497 gpppdata.setPassword(scanvar); 497 PPPData::data()->setPassword(scanvar);
498 p_kppp->setPW_Edit(scanvar); 498 p_kppp->setPW_Edit(scanvar);
499 if(gpppdata.storePassword()) 499 if(PPPData::data()->storePassword())
500 gpppdata.setStoredPassword(scanvar); 500 PPPData::data()->setStoredPassword(scanvar);
501 firstrunPW = true; 501 firstrunPW = true;
502 } 502 }
503 503
@@ -513,8 +513,8 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
513 QString arg = scriptArgument; 513 QString arg = scriptArgument;
514 QRegExp re1("%USERNAME%"); 514 QRegExp re1("%USERNAME%");
515 QRegExp re2("%PASSWORD%"); 515 QRegExp re2("%PASSWORD%");
516 arg = arg.replace(re1, gpppdata.storedUsername()); 516 arg = arg.replace(re1, PPPData::data()->storedUsername());
517 arg = arg.replace(re2, gpppdata.storedPassword()); 517 arg = arg.replace(re2, PPPData::data()->storedPassword());
518 518
519 if (scriptCommand == "Send") 519 if (scriptCommand == "Send")
520 bm = bm.arg(scriptArgument); 520 bm = bm.arg(scriptArgument);
@@ -578,8 +578,8 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
578 messg->setText(i18n("Hangup")); 578 messg->setText(i18n("Hangup"));
579 emit debugMessage(i18n("Hangup")); 579 emit debugMessage(i18n("Hangup"));
580 580
581 writeline(gpppdata.modemHangupStr()); 581 writeline(PPPData::data()->modemHangupStr());
582 setExpect(gpppdata.modemHangupResp()); 582 setExpect(PPPData::data()->modemHangupResp());
583 583
584 scriptindex++; 584 scriptindex++;
585 return; 585 return;
@@ -592,7 +592,7 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
592 messg->setText(i18n("Answer")); 592 messg->setText(i18n("Answer"));
593 emit debugMessage(i18n("Answer")); 593 emit debugMessage(i18n("Answer"));
594 594
595 setExpect(gpppdata.modemRingResp()); 595 setExpect(PPPData::data()->modemRingResp());
596 vmain = 150; 596 vmain = 150;
597 return; 597 return;
598 } 598 }
@@ -602,7 +602,7 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
602 messg->setText(bm); 602 messg->setText(bm);
603 emit debugMessage(bm); 603 emit debugMessage(bm);
604 604
605 QString idstring = gpppdata.storedUsername(); 605 QString idstring = PPPData::data()->storedUsername();
606 606
607 if(!idstring.isEmpty() && firstrunID) { 607 if(!idstring.isEmpty() && firstrunID) {
608 // the user entered an Id on the main kppp dialog 608 // the user entered an Id on the main kppp dialog
@@ -638,7 +638,7 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
638 messg->setText(bm); 638 messg->setText(bm);
639 emit debugMessage(bm); 639 emit debugMessage(bm);
640 640
641 QString pwstring = gpppdata.password(); 641 QString pwstring = PPPData::data()->password();
642 642
643 if(!pwstring.isEmpty() && firstrunPW) { 643 if(!pwstring.isEmpty() && firstrunPW) {
644 // the user entered a password on the main kppp dialog 644 // the user entered a password on the main kppp dialog
@@ -785,8 +785,8 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
785 785
786 if(vmain == 150) { 786 if(vmain == 150) {
787 if(!expecting) { 787 if(!expecting) {
788 writeline(gpppdata.modemAnswerStr()); 788 writeline(PPPData::data()->modemAnswerStr());
789 setExpect(gpppdata.modemAnswerResp()); 789 setExpect(PPPData::data()->modemAnswerResp());
790 790
791 vmain = 2; 791 vmain = 2;
792 scriptindex++; 792 scriptindex++;
@@ -814,7 +814,7 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
814 // stop reading of data 814 // stop reading of data
815 Modem::modem->stop(); 815 Modem::modem->stop();
816 816
817 if(gpppdata.authMethod() == AUTH_TERMINAL) { 817 if(PPPData::data()->authMethod() == AUTH_TERMINAL) {
818 // if (termwindow) { 818 // if (termwindow) {
819 // delete termwindow; 819 // delete termwindow;
820 // termwindow = 0L; 820 // termwindow = 0L;
@@ -835,8 +835,8 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
835 835
836 killTimer( main_timer_ID ); 836 killTimer( main_timer_ID );
837 837
838 if_timeout_timer->start(gpppdata.pppdTimeout()*1000); 838 if_timeout_timer->start(PPPData::data()->pppdTimeout()*1000);
839 qDebug( "started if timeout timer with %i", gpppdata.pppdTimeout()*1000); 839 qDebug( "started if timeout timer with %i", PPPData::data()->pppdTimeout()*1000);
840 840
841 // find out PPP interface and notify the stats module 841 // find out PPP interface and notify the stats module
842// stats->setUnit(pppInterfaceNumber()); 842// stats->setUnit(pppInterfaceNumber());
@@ -849,7 +849,7 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
849 qDebug("execppp() returned with return-code %i", result ); 849 qDebug("execppp() returned with return-code %i", result );
850 850
851 if(result) { 851 if(result) {
852 if(!gpppdata.autoDNS()) 852 if(!PPPData::data()->autoDNS())
853 adddns(); 853 adddns();
854 854
855 // O.K we are done here, let's change over to the if_waiting loop 855 // O.K we are done here, let's change over to the if_waiting loop
@@ -1063,7 +1063,7 @@ void ConnectWidget::if_waiting_timed_out() {
1063 if_timeout_timer->stop(); 1063 if_timeout_timer->stop();
1064 qDebug("if_waiting_timed_out()"); 1064 qDebug("if_waiting_timed_out()");
1065 1065
1066 gpppdata.setpppdError(E_IF_TIMEOUT); 1066 PPPData::data()->setpppdError(E_IF_TIMEOUT);
1067 1067
1068 // let's kill the stuck pppd 1068 // let's kill the stuck pppd
1069 Modem::modem->killPPPDaemon(); 1069 Modem::modem->killPPPDaemon();
@@ -1088,7 +1088,7 @@ void ConnectWidget::if_waiting_slot() {
1088 1088
1089// if(!stats->ifIsUp()) { 1089// if(!stats->ifIsUp()) {
1090 1090
1091// if(gpppdata.pppdError() != 0) { 1091// if(PPPData::data()->pppdError() != 0) {
1092// // we are here if pppd died immediately after starting it. 1092// // we are here if pppd died immediately after starting it.
1093// pppdDied(); 1093// pppdDied();
1094// // error message handled in main.cpp: sigPPPDDied() 1094// // error message handled in main.cpp: sigPPPDDied()
@@ -1105,7 +1105,7 @@ void ConnectWidget::if_waiting_slot() {
1105 if_timer->stop(); 1105 if_timer->stop();
1106 usleep(200000); 1106 usleep(200000);
1107 1107
1108 if(gpppdata.autoDNS()) 1108 if(PPPData::data()->autoDNS())
1109 addpeerdns(); 1109 addpeerdns();
1110 1110
1111 // Close the debugging window. If we are connected, we 1111 // Close the debugging window. If we are connected, we
@@ -1114,12 +1114,12 @@ void ConnectWidget::if_waiting_slot() {
1114// p_kppp->statdlg->take_stats(); // start taking ppp statistics 1114// p_kppp->statdlg->take_stats(); // start taking ppp statistics
1115 auto_hostname(); 1115 auto_hostname();
1116 1116
1117 if(!gpppdata.command_on_connect().isEmpty()) { 1117 if(!PPPData::data()->command_on_connect().isEmpty()) {
1118 messg->setText(i18n("Running startup command...")); 1118 messg->setText(i18n("Running startup command..."));
1119 1119
1120 // make sure that we don't get any async errors 1120 // make sure that we don't get any async errors
1121 qApp->flushX(); 1121 qApp->flushX();
1122 execute_command(gpppdata.command_on_connect()); 1122 execute_command(PPPData::data()->command_on_connect());
1123 messg->setText(i18n("Done")); 1123 messg->setText(i18n("Done"));
1124 } 1124 }
1125 1125
@@ -1141,7 +1141,7 @@ void ConnectWidget::if_waiting_slot() {
1141// else 1141// else
1142// p_kppp->con_win->accounting(false); 1142// p_kppp->con_win->accounting(false);
1143 1143
1144 if (gpppdata.get_dock_into_panel()) { 1144 if (PPPData::data()->get_dock_into_panel()) {
1145// DockWidget::dock_widget->show(); 1145// DockWidget::dock_widget->show();
1146// DockWidget::dock_widget->take_stats(); 1146// DockWidget::dock_widget->take_stats();
1147// this->hide(); 1147// this->hide();
@@ -1149,7 +1149,7 @@ void ConnectWidget::if_waiting_slot() {
1149 else { 1149 else {
1150// p_kppp->con_win->show(); 1150// p_kppp->con_win->show();
1151 1151
1152 if(gpppdata.get_iconify_on_connect()) { 1152 if(PPPData::data()->get_iconify_on_connect()) {
1153 // p_kppp->con_win->showMinimized(); 1153 // p_kppp->con_win->showMinimized();
1154 } 1154 }
1155 } 1155 }
@@ -1168,17 +1168,17 @@ bool ConnectWidget::execppp() {
1168 // we'll simply leave this argument away. pppd will then use the default tty 1168 // we'll simply leave this argument away. pppd will then use the default tty
1169 // which is the serial port we connected stdin/stdout to in opener.cpp. 1169 // which is the serial port we connected stdin/stdout to in opener.cpp.
1170 // command += " "; 1170 // command += " ";
1171 // command += gpppdata.modemDevice(); 1171 // command += PPPData::data()->modemDevice();
1172 1172
1173 command += " " + gpppdata.speed(); 1173 command += " " + PPPData::data()->speed();
1174 1174
1175 command += " -detach"; 1175 command += " -detach";
1176 1176
1177 if(gpppdata.ipaddr() != "0.0.0.0" || 1177 if(PPPData::data()->ipaddr() != "0.0.0.0" ||
1178 gpppdata.gateway() != "0.0.0.0") { 1178 PPPData::data()->gateway() != "0.0.0.0") {
1179 if(gpppdata.ipaddr() != "0.0.0.0") { 1179 if(PPPData::data()->ipaddr() != "0.0.0.0") {
1180 command += " "; 1180 command += " ";
1181 command += gpppdata.ipaddr(); 1181 command += PPPData::data()->ipaddr();
1182 command += ":"; 1182 command += ":";
1183 } 1183 }
1184 else { 1184 else {
@@ -1186,27 +1186,27 @@ bool ConnectWidget::execppp() {
1186 command += ":"; 1186 command += ":";
1187 } 1187 }
1188 1188
1189 if(gpppdata.gateway() != "0.0.0.0") 1189 if(PPPData::data()->gateway() != "0.0.0.0")
1190 command += gpppdata.gateway(); 1190 command += PPPData::data()->gateway();
1191 } 1191 }
1192 1192
1193 if(gpppdata.subnetmask() != "0.0.0.0") 1193 if(PPPData::data()->subnetmask() != "0.0.0.0")
1194 command += " netmask " + gpppdata.subnetmask(); 1194 command += " netmask " + PPPData::data()->subnetmask();
1195 1195
1196 if(gpppdata.flowcontrol() != "None") { 1196 if(PPPData::data()->flowcontrol() != "None") {
1197 if(gpppdata.flowcontrol() == "CRTSCTS") 1197 if(PPPData::data()->flowcontrol() == "CRTSCTS")
1198 command += " crtscts"; 1198 command += " crtscts";
1199 else 1199 else
1200 command += " xonxoff"; 1200 command += " xonxoff";
1201 } 1201 }
1202 1202
1203 if(gpppdata.defaultroute()) 1203 if(PPPData::data()->defaultroute())
1204 command += " defaultroute"; 1204 command += " defaultroute";
1205 1205
1206 if(gpppdata.autoDNS()) 1206 if(PPPData::data()->autoDNS())
1207 command += " usepeerdns"; 1207 command += " usepeerdns";
1208 1208
1209 QStringList &arglist = gpppdata.pppdArgument(); 1209 QStringList &arglist = PPPData::data()->pppdArgument();
1210 for ( QStringList::Iterator it = arglist.begin(); 1210 for ( QStringList::Iterator it = arglist.begin();
1211 it != arglist.end(); 1211 it != arglist.end();
1212 ++it ) 1212 ++it )
@@ -1215,25 +1215,25 @@ bool ConnectWidget::execppp() {
1215 } 1215 }
1216 1216
1217 // PAP settings 1217 // PAP settings
1218 if(gpppdata.authMethod() == AUTH_PAP) { 1218 if(PPPData::data()->authMethod() == AUTH_PAP) {
1219 command += " -chap user "; 1219 command += " -chap user ";
1220 command = command + "\"" + gpppdata.storedUsername() + "\""; 1220 command = command + "\"" + PPPData::data()->storedUsername() + "\"";
1221 } 1221 }
1222 1222
1223 // CHAP settings 1223 // CHAP settings
1224 if(gpppdata.authMethod() == AUTH_CHAP) { 1224 if(PPPData::data()->authMethod() == AUTH_CHAP) {
1225 command += " -pap user "; 1225 command += " -pap user ";
1226 command = command + "\"" + gpppdata.storedUsername() + "\""; 1226 command = command + "\"" + PPPData::data()->storedUsername() + "\"";
1227 } 1227 }
1228 1228
1229 // PAP/CHAP settings 1229 // PAP/CHAP settings
1230 if(gpppdata.authMethod() == AUTH_PAPCHAP) { 1230 if(PPPData::data()->authMethod() == AUTH_PAPCHAP) {
1231 command += " user "; 1231 command += " user ";
1232 command = command + "\"" + gpppdata.storedUsername() + "\""; 1232 command = command + "\"" + PPPData::data()->storedUsername() + "\"";
1233 } 1233 }
1234 1234
1235 // check for debug 1235 // check for debug
1236 if(gpppdata.getPPPDebug()) 1236 if(PPPData::data()->getPPPDebug())
1237 command += " debug"; 1237 command += " debug";
1238 1238
1239 if (command.length() > MAX_CMDLEN) { 1239 if (command.length() > MAX_CMDLEN) {
@@ -1277,8 +1277,8 @@ void auto_hostname() {
1277 tmp_str[sizeof(tmp_str)-1]=0; // panic 1277 tmp_str[sizeof(tmp_str)-1]=0; // panic
1278 old_hostname=tmp_str; // copy to QString 1278 old_hostname=tmp_str; // copy to QString
1279 1279
1280 // if (!p_kppp->stats->local_ip_address.isEmpty() && gpppdata.autoname()) { 1280 // if (!p_kppp->stats->local_ip_address.isEmpty() && PPPData::data()->autoname()) {
1281 if ( gpppdata.autoname()) { 1281 if ( PPPData::data()->autoname()) {
1282// local_ip.s_addr=inet_addr(p_kppp->stats->local_ip_address.ascii()); 1282// local_ip.s_addr=inet_addr(p_kppp->stats->local_ip_address.ascii());
1283 hostname_entry=gethostbyaddr((const char *)&local_ip,sizeof(in_addr),AF_INET); 1283 hostname_entry=gethostbyaddr((const char *)&local_ip,sizeof(in_addr),AF_INET);
1284 1284
@@ -1332,7 +1332,7 @@ void add_domain(const QString &domain) {
1332 if((resolv[j].contains("domain") || 1332 if((resolv[j].contains("domain") ||
1333 ( resolv[j].contains("nameserver") 1333 ( resolv[j].contains("nameserver")
1334 && !resolv[j].contains("#kppp temp entry") 1334 && !resolv[j].contains("#kppp temp entry")
1335 && gpppdata.exDNSDisabled())) 1335 && PPPData::data()->exDNSDisabled()))
1336 && !resolv[j].contains("#entry disabled by kppp")) { 1336 && !resolv[j].contains("#entry disabled by kppp")) {
1337 QCString tmp = "# " + resolv[j].local8Bit() + 1337 QCString tmp = "# " + resolv[j].local8Bit() +
1338 " \t#entry disabled by kppp\n"; 1338 " \t#entry disabled by kppp\n";
@@ -1355,7 +1355,7 @@ void adddns()
1355 int fd; 1355 int fd;
1356 1356
1357 if ((fd = Modem::modem->openResolv(O_WRONLY|O_APPEND)) >= 0) { 1357 if ((fd = Modem::modem->openResolv(O_WRONLY|O_APPEND)) >= 0) {
1358 QStringList &dnslist = gpppdata.dns(); 1358 QStringList &dnslist = PPPData::data()->dns();
1359 for ( QStringList::Iterator it = dnslist.begin(); 1359 for ( QStringList::Iterator it = dnslist.begin();
1360 it != dnslist.end(); 1360 it != dnslist.end();
1361 ++it ) 1361 ++it )
@@ -1366,7 +1366,7 @@ void adddns()
1366 } 1366 }
1367 close(fd); 1367 close(fd);
1368 } 1368 }
1369 add_domain(gpppdata.domain()); 1369 add_domain(PPPData::data()->domain());
1370} 1370}
1371 1371
1372void addpeerdns() { 1372void addpeerdns() {
@@ -1387,7 +1387,7 @@ void addpeerdns() {
1387 fprintf(stderr, "failed to read from /etc/ppp/resolv.conf\n"); 1387 fprintf(stderr, "failed to read from /etc/ppp/resolv.conf\n");
1388 close(fd); 1388 close(fd);
1389 } 1389 }
1390 add_domain(gpppdata.domain()); 1390 add_domain(PPPData::data()->domain());
1391} 1391}
1392 1392
1393// remove the dns entries from the /etc/resolv.conf file 1393// remove the dns entries from the /etc/resolv.conf file
diff --git a/noncore/settings/networksettings/ppp/conwindow.cpp b/noncore/settings/networksettings/ppp/conwindow.cpp
index d6b3fbe..ad89005 100644
--- a/noncore/settings/networksettings/ppp/conwindow.cpp
+++ b/noncore/settings/networksettings/ppp/conwindow.cpp
@@ -75,9 +75,9 @@ ConWindow::ConWindow(QWidget *parent, const char *name, QDialog *mainwidget )
75 connect(clocktimer, SIGNAL(timeout()), SLOT(timeclick())); 75 connect(clocktimer, SIGNAL(timeout()), SLOT(timeclick()));
76 76
77 // read window position from config file 77 // read window position from config file
78 int p_x, p_y; 78// int p_x, p_y;
79 gpppdata.winPosConWin(p_x, p_y); 79// PPPData::data()->winPosConWin(p_x, p_y);
80 setGeometry(p_x, p_y, 320, 110); 80// setGeometry(p_x, p_y, 320, 110);
81} 81}
82 82
83ConWindow::~ConWindow() { 83ConWindow::~ConWindow() {
@@ -88,7 +88,7 @@ ConWindow::~ConWindow() {
88bool ConWindow::event(QEvent *e) { 88bool ConWindow::event(QEvent *e) {
89 if (e->type() == QEvent::Hide) 89 if (e->type() == QEvent::Hide)
90 { 90 {
91 gpppdata.setWinPosConWin(x(), y()); 91// PPPData::data()->setWinPosConWin(x(), y());
92 return true; 92 return true;
93 } 93 }
94 else 94 else
@@ -118,7 +118,7 @@ QString ConWindow::prettyPrintVolume(unsigned int n) {
118void ConWindow::accounting(bool on) { 118void ConWindow::accounting(bool on) {
119 // cache accounting settings 119 // cache accounting settings
120 accountingEnabled = on; 120 accountingEnabled = on;
121 volumeAccountingEnabled = gpppdata.VolAcctEnabled(); 121 volumeAccountingEnabled = PPPData::data()->VolAcctEnabled();
122 122
123 // delete old layout 123 // delete old layout
124 if(tl1 != 0) 124 if(tl1 != 0)
@@ -133,7 +133,7 @@ void ConWindow::accounting(bool on) {
133 QGridLayout *l1; 133 QGridLayout *l1;
134 134
135 int vol_lines = 0; 135 int vol_lines = 0;
136 if(gpppdata.VolAcctEnabled()) 136 if(PPPData::data()->VolAcctEnabled())
137 vol_lines = 1; 137 vol_lines = 1;
138 138
139 if(accountingEnabled) 139 if(accountingEnabled)
@@ -239,9 +239,9 @@ void ConWindow::startClock() {
239 hours = 0; 239 hours = 0;
240 QString title ; 240 QString title ;
241 241
242 title = gpppdata.accname(); 242 title = PPPData::data()->accname();
243 243
244 if(gpppdata.get_show_clock_on_caption()){ 244 if(PPPData::data()->get_show_clock_on_caption()){
245 title += " 00:00" ; 245 title += " 00:00" ;
246 } 246 }
247 this->setCaption(title); 247 this->setCaption(title);
@@ -265,7 +265,7 @@ void ConWindow::timeclick() {
265 QString tooltip = i18n("Connection: %1\n" 265 QString tooltip = i18n("Connection: %1\n"
266 "Connected at: %2\n" 266 "Connected at: %2\n"
267 "Time connected: %3") 267 "Time connected: %3")
268 .arg(gpppdata.accname()).arg(info2->text()) 268 .arg(PPPData::data()->accname()).arg(info2->text())
269 .arg(time_string2); 269 .arg(time_string2);
270 270
271 if(accountingEnabled) 271 if(accountingEnabled)
@@ -275,7 +275,7 @@ void ConWindow::timeclick() {
275 if(volumeAccountingEnabled) { 275 if(volumeAccountingEnabled) {
276 276
277 volinfo->setEnabled(TRUE); 277 volinfo->setEnabled(TRUE);
278 int bytes = gpppdata.totalBytes(); 278 int bytes = PPPData::data()->totalBytes();
279 volinfo->setText(prettyPrintVolume(bytes)); 279 volinfo->setText(prettyPrintVolume(bytes));
280 } 280 }
281 281
@@ -305,14 +305,14 @@ void ConWindow::timeclick() {
305 else 305 else
306 time_string2.sprintf("%02d:%02d:%02d",hours,minutes,seconds); 306 time_string2.sprintf("%02d:%02d:%02d",hours,minutes,seconds);
307 307
308 caption_string = gpppdata.accname(); 308 caption_string = PPPData::data()->accname();
309 caption_string += " "; 309 caption_string += " ";
310 caption_string += time_string; 310 caption_string += time_string;
311 311
312 312
313 timelabel2->setText(time_string2); 313 timelabel2->setText(time_string2);
314 314
315 if(gpppdata.get_show_clock_on_caption() && (seconds == 1)){ 315 if(PPPData::data()->get_show_clock_on_caption() && (seconds == 1)){
316 // we update the Caption only once per minute not every second 316 // we update the Caption only once per minute not every second
317 // otherwise I get a flickering icon 317 // otherwise I get a flickering icon
318 this->setCaption(caption_string); 318 this->setCaption(caption_string);
@@ -328,7 +328,7 @@ void ConWindow::closeEvent( QCloseEvent *e ){
328 // if we lost it we could only kill the program by hand to get on with life. 328 // if we lost it we could only kill the program by hand to get on with life.
329 e->ignore(); 329 e->ignore();
330 330
331 if(gpppdata.get_dock_into_panel()) 331 if(PPPData::data()->get_dock_into_panel())
332 dock(); 332 dock();
333} 333}
334 334
diff --git a/noncore/settings/networksettings/ppp/debug.cpp b/noncore/settings/networksettings/ppp/debug.cpp
index 8652931..447ccf2 100644
--- a/noncore/settings/networksettings/ppp/debug.cpp
+++ b/noncore/settings/networksettings/ppp/debug.cpp
@@ -133,7 +133,7 @@ void DebugWidget::toggleVisibility() {
133 show(); 133 show();
134 134
135 bool showlog = isVisible(); 135 bool showlog = isVisible();
136 gpppdata.set_show_log_window(showlog); 136 PPPData::data()->set_show_log_window(showlog);
137} 137}
138 138
139 139
diff --git a/noncore/settings/networksettings/ppp/edit.cpp b/noncore/settings/networksettings/ppp/edit.cpp
index 961047b..6132b80 100644
--- a/noncore/settings/networksettings/ppp/edit.cpp
+++ b/noncore/settings/networksettings/ppp/edit.cpp
@@ -41,7 +41,7 @@
41 41
42#include "edit.h" 42#include "edit.h"
43#include "pppdata.h" 43#include "pppdata.h"
44#include "newwidget.h" 44//#include "newwidget.h"
45#include "iplined.h" 45#include "iplined.h"
46#include "auth.h" 46#include "auth.h"
47 47
@@ -50,13 +50,13 @@ DialWidget::DialWidget( QWidget *parent, bool isnewaccount, const char *name )
50{ 50{
51 const int GRIDROWS = 6; 51 const int GRIDROWS = 6;
52 52
53 QGridLayout *tl = new QGridLayout(parent, GRIDROWS, 2, 0 );//, KDialog::spacingHint()); 53 QGridLayout *tl = new QGridLayout(this, GRIDROWS, 2, 0 );//, KDialog::spacingHint());
54 54
55 connect_label = new QLabel(i18n("Connection name:"), parent); 55 connect_label = new QLabel(i18n("Connection name:"), this);
56 tl->addWidget(connect_label, 0, 0); 56 tl->addWidget(connect_label, 0, 0);
57 57
58 connectname_l = new QLineEdit(parent); 58 connectname_l = new QLineEdit(this);
59 connectname_l->setMaxLength(ACCNAME_SIZE); 59// connectname_l->setMaxLength(ACCNAME_SIZE);
60 tl->addWidget(connectname_l, 0, 1); 60 tl->addWidget(connectname_l, 0, 1);
61 QString tmp = i18n("Type in a unique name for this connection"); 61 QString tmp = i18n("Type in a unique name for this connection");
62 62
@@ -64,24 +64,24 @@ DialWidget::DialWidget( QWidget *parent, bool isnewaccount, const char *name )
64 QWhatsThis::add(connectname_l,tmp); 64 QWhatsThis::add(connectname_l,tmp);
65 65
66 66
67 number_label = new QLabel(i18n("Phone number:"), parent); 67 number_label = new QLabel(i18n("Phone number:"), this);
68 number_label->setAlignment(AlignTop|AlignLeft); 68 number_label->setAlignment(AlignTop|AlignLeft);
69 tl->addWidget(number_label, 1, 0); 69 tl->addWidget(number_label, 1, 0);
70 70
71 QHBoxLayout *lpn = new QHBoxLayout(5); 71 QHBoxLayout *lpn = new QHBoxLayout(5);
72 tl->addLayout(lpn, 1, 1); 72 tl->addLayout(lpn, 1, 1);
73 numbers = new QListBox(parent); 73 numbers = new QListBox(this);
74 numbers->setMinimumSize(120, 70); 74 numbers->setMinimumSize(120, 70);
75 lpn->addWidget(numbers); 75 lpn->addWidget(numbers);
76 QVBoxLayout *lpn1 = new QVBoxLayout; 76 QVBoxLayout *lpn1 = new QVBoxLayout;
77 lpn->addLayout(lpn1); 77 lpn->addLayout(lpn1);
78 add = new QPushButton(i18n("&Add..."), parent); 78 add = new QPushButton(i18n("&Add..."), this);
79 del = new QPushButton(i18n("&Remove"), parent); 79 del = new QPushButton(i18n("&Remove"), this);
80 80
81 up = new QPushButton(parent); 81 up = new QPushButton(this);
82//FIXME: QPixmap pm = BarIcon("up"); 82//FIXME: QPixmap pm = BarIcon("up");
83// up->setPixmap(pm); 83// up->setPixmap(pm);
84 down = new QPushButton(parent); 84 down = new QPushButton(this);
85//FIXME: pm = BarIcon("down"); 85//FIXME: pm = BarIcon("down");
86// down->setPixmap(pm); 86// down->setPixmap(pm);
87 lpn1->addWidget(add); 87 lpn1->addWidget(add);
@@ -112,10 +112,10 @@ DialWidget::DialWidget( QWidget *parent, bool isnewaccount, const char *name )
112 QWhatsThis::add(number_label,tmp); 112 QWhatsThis::add(number_label,tmp);
113 QWhatsThis::add(numbers,tmp); 113 QWhatsThis::add(numbers,tmp);
114 114
115 auth_l = new QLabel(i18n("Authentication:"), parent); 115 auth_l = new QLabel(i18n("Authentication:"), this);
116 tl->addWidget(auth_l, 3, 0); 116 tl->addWidget(auth_l, 3, 0);
117 117
118 auth = new QComboBox(parent); 118 auth = new QComboBox(this);
119 auth->insertItem(i18n("Script-based")); 119 auth->insertItem(i18n("Script-based"));
120 auth->insertItem(i18n("PAP")); 120 auth->insertItem(i18n("PAP"));
121 auth->insertItem(i18n("Terminal-based")); 121 auth->insertItem(i18n("Terminal-based"));
@@ -135,7 +135,7 @@ DialWidget::DialWidget( QWidget *parent, bool isnewaccount, const char *name )
135 QWhatsThis::add(auth_l,tmp); 135 QWhatsThis::add(auth_l,tmp);
136 QWhatsThis::add(auth,tmp); 136 QWhatsThis::add(auth,tmp);
137 137
138 store_password = new QCheckBox(i18n("Store password"), parent); 138 store_password = new QCheckBox(i18n("Store password"), this);
139 store_password->setChecked(true); 139 store_password->setChecked(true);
140 tl->addMultiCellWidget(store_password, 4, 4, 0, 1, AlignRight); 140 tl->addMultiCellWidget(store_password, 4, 4, 0, 1, AlignRight);
141 QWhatsThis::add(store_password, 141 QWhatsThis::add(store_password,
@@ -148,16 +148,16 @@ DialWidget::DialWidget( QWidget *parent, bool isnewaccount, const char *name )
148 "readable only to you. Make sure nobody\n" 148 "readable only to you. Make sure nobody\n"
149 "gains access to this file!")); 149 "gains access to this file!"));
150 150
151 pppdargs = new QPushButton(i18n("Customize pppd Arguments..."), parent); 151 pppdargs = new QPushButton(i18n("Customize pppd Arguments..."), this);
152 connect(pppdargs, SIGNAL(clicked()), SLOT(pppdargsbutton())); 152 connect(pppdargs, SIGNAL(clicked()), SLOT(pppdargsbutton()));
153 tl->addMultiCellWidget(pppdargs, 5, 5, 0, 1, AlignCenter); 153 tl->addMultiCellWidget(pppdargs, 5, 5, 0, 1, AlignCenter);
154 154
155 // Set defaults if editing an existing connection 155 // Set defaults if editing an existing connection
156 if(!isnewaccount) { 156 if(!isnewaccount) {
157 connectname_l->setText(gpppdata.accname()); 157 connectname_l->setText(PPPData::data()->accname());
158 158
159 // insert the phone numbers into the listbox 159 // insert the phone numbers into the listbox
160 QString n = gpppdata.phonenumber(); 160 QString n = PPPData::data()->phonenumber();
161 QString tmp = ""; 161 QString tmp = "";
162 uint idx = 0; 162 uint idx = 0;
163 while(idx != n.length()) { 163 while(idx != n.length()) {
@@ -172,8 +172,8 @@ DialWidget::DialWidget( QWidget *parent, bool isnewaccount, const char *name )
172 if(tmp.length() > 0) 172 if(tmp.length() > 0)
173 numbers->insertItem(tmp); 173 numbers->insertItem(tmp);
174 174
175 auth->setCurrentItem(gpppdata.authMethod()); 175 auth->setCurrentItem(PPPData::data()->authMethod());
176 store_password->setChecked(gpppdata.storePassword()); 176 store_password->setChecked(PPPData::data()->storePassword());
177 } else { 177 } else {
178 // select PAP/CHAP as default 178 // select PAP/CHAP as default
179 auth->setCurrentItem(AUTH_PAPCHAP); 179 auth->setCurrentItem(AUTH_PAPCHAP);
@@ -187,10 +187,10 @@ DialWidget::DialWidget( QWidget *parent, bool isnewaccount, const char *name )
187bool DialWidget::save() { 187bool DialWidget::save() {
188 //first check to make sure that the account name is unique! 188 //first check to make sure that the account name is unique!
189 if(connectname_l->text().isEmpty() || 189 if(connectname_l->text().isEmpty() ||
190 !gpppdata.isUniqueAccname(connectname_l->text())) { 190 !PPPData::data()->isUniqueAccname(connectname_l->text())) {
191 return false; 191 return false;
192 } else { 192 } else {
193 gpppdata.setAccname(connectname_l->text()); 193 PPPData::data()->setAccname(connectname_l->text());
194 194
195 QString number = ""; 195 QString number = "";
196 for(uint i = 0; i < numbers->count(); i++) { 196 for(uint i = 0; i < numbers->count(); i++) {
@@ -199,9 +199,9 @@ bool DialWidget::save() {
199 number += numbers->text(i); 199 number += numbers->text(i);
200 } 200 }
201 201
202 gpppdata.setPhonenumber(number); 202 PPPData::data()->setPhonenumber(number);
203 gpppdata.setAuthMethod(auth->currentItem()); 203 PPPData::data()->setAuthMethod(auth->currentItem());
204 gpppdata.setStorePassword(store_password->isChecked()); 204 PPPData::data()->setStorePassword(store_password->isChecked());
205 return true; 205 return true;
206 } 206 }
207} 207}
@@ -275,7 +275,7 @@ void DialWidget::pppdargsbutton() {
275ExecWidget::ExecWidget(QWidget *parent, bool isnewaccount, const char *name) : 275ExecWidget::ExecWidget(QWidget *parent, bool isnewaccount, const char *name) :
276 QWidget(parent, name) 276 QWidget(parent, name)
277{ 277{
278 QVBoxLayout *tl = new QVBoxLayout(parent, 0 );//, KDialog::spacingHint()); 278 QVBoxLayout *tl = new QVBoxLayout(this, 0 );//, KDialog::spacingHint());
279 279
280 QLabel *l = new QLabel(\ 280 QLabel *l = new QLabel(\
281i18n("Here you can select commands to run at certain stages of the\n" 281i18n("Here you can select commands to run at certain stages of the\n"
@@ -283,8 +283,8 @@ i18n("Here you can select commands to run at certain stages of the\n"
283 "you cannot run any commands here requiring root permissions\n" 283 "you cannot run any commands here requiring root permissions\n"
284 "(unless, of course, you are root).\n\n" 284 "(unless, of course, you are root).\n\n"
285 "Be sure to supply the whole path to the program otherwise\n" 285 "Be sure to supply the whole path to the program otherwise\n"
286 "kppp might be unable to find it."), parent); 286 "kppp might be unable to find it."), this);
287 l->setMinimumHeight(l->sizeHint().height()); 287// l->setMinimumHeight(l->sizeHint().height());
288 tl->addWidget(l); 288 tl->addWidget(l);
289 tl->addStretch(1); 289 tl->addStretch(1);
290 290
@@ -293,11 +293,11 @@ i18n("Here you can select commands to run at certain stages of the\n"
293 l1->setColStretch(0, 0); 293 l1->setColStretch(0, 0);
294 l1->setColStretch(1, 1); 294 l1->setColStretch(1, 1);
295 295
296 before_connect_l = new QLabel(i18n("Before connect:"), parent); 296 before_connect_l = new QLabel(i18n("Before connect:"), this);
297 before_connect_l->setAlignment(AlignVCenter); 297 before_connect_l->setAlignment(AlignVCenter);
298 l1->addWidget(before_connect_l, 0, 0); 298 l1->addWidget(before_connect_l, 0, 0);
299 before_connect = new QLineEdit(parent); 299 before_connect = new QLineEdit(this);
300 before_connect->setMaxLength(COMMAND_SIZE); 300// before_connect->setMaxLength(COMMAND_SIZE);
301 l1->addWidget(before_connect, 0, 1); 301 l1->addWidget(before_connect, 0, 1);
302 QString tmp = i18n("Allows you to run a program <b>before</b> a connection\n" 302 QString tmp = i18n("Allows you to run a program <b>before</b> a connection\n"
303 "is established. It is called immediately before\n" 303 "is established. It is called immediately before\n"
@@ -308,11 +308,11 @@ i18n("Here you can select commands to run at certain stages of the\n"
308 QWhatsThis::add(before_connect_l,tmp); 308 QWhatsThis::add(before_connect_l,tmp);
309 QWhatsThis::add(before_connect,tmp); 309 QWhatsThis::add(before_connect,tmp);
310 310
311 command_label = new QLabel(i18n("Upon connect:"), parent); 311 command_label = new QLabel(i18n("Upon connect:"), this);
312 command_label->setAlignment(AlignVCenter); 312 command_label->setAlignment(AlignVCenter);
313 l1->addWidget(command_label, 1, 0); 313 l1->addWidget(command_label, 1, 0);
314 command = new QLineEdit(parent); 314 command = new QLineEdit(this);
315 command->setMaxLength(COMMAND_SIZE); 315// command->setMaxLength(COMMAND_SIZE);
316 l1->addWidget(command, 1, 1); 316 l1->addWidget(command, 1, 1);
317 tmp = i18n("Allows you to run a program <b>after</b> a connection\n" 317 tmp = i18n("Allows you to run a program <b>after</b> a connection\n"
318 "is established. When your program is called, all\n" 318 "is established. When your program is called, all\n"
@@ -324,11 +324,11 @@ i18n("Here you can select commands to run at certain stages of the\n"
324 QWhatsThis::add(command,tmp); 324 QWhatsThis::add(command,tmp);
325 325
326 predisconnect_label = new QLabel(i18n("Before disconnect:"), 326 predisconnect_label = new QLabel(i18n("Before disconnect:"),
327 parent); 327 this);
328 predisconnect_label->setAlignment(AlignVCenter); 328 predisconnect_label->setAlignment(AlignVCenter);
329 l1->addWidget(predisconnect_label, 2, 0); 329 l1->addWidget(predisconnect_label, 2, 0);
330 predisconnect = new QLineEdit(parent); 330 predisconnect = new QLineEdit(this);
331 predisconnect->setMaxLength(COMMAND_SIZE); 331// predisconnect->setMaxLength(COMMAND_SIZE);
332 l1->addWidget(predisconnect, 2, 1); 332 l1->addWidget(predisconnect, 2, 1);
333 tmp = i18n("Allows you to run a program <b>before</b> a connection\n" 333 tmp = i18n("Allows you to run a program <b>before</b> a connection\n"
334 "is closed. The connection will stay open until\n" 334 "is closed. The connection will stay open until\n"
@@ -338,12 +338,12 @@ i18n("Here you can select commands to run at certain stages of the\n"
338 QWhatsThis::add(predisconnect,tmp); 338 QWhatsThis::add(predisconnect,tmp);
339 339
340 discommand_label = new QLabel(i18n("Upon disconnect:"), 340 discommand_label = new QLabel(i18n("Upon disconnect:"),
341 parent); 341 this);
342 discommand_label->setAlignment(AlignVCenter); 342 discommand_label->setAlignment(AlignVCenter);
343 l1->addWidget(discommand_label, 3, 0); 343 l1->addWidget(discommand_label, 3, 0);
344 344
345 discommand = new QLineEdit(parent); 345 discommand = new QLineEdit(this);
346 discommand->setMaxLength(COMMAND_SIZE); 346// discommand->setMaxLength(COMMAND_SIZE);
347 l1->addWidget(discommand, 3, 1); 347 l1->addWidget(discommand, 3, 1);
348 tmp = i18n("Allows you to run a program <b>after</b> a connection\n" 348 tmp = i18n("Allows you to run a program <b>after</b> a connection\n"
349 "has been closed."); 349 "has been closed.");
@@ -360,19 +360,19 @@ i18n("Here you can select commands to run at certain stages of the\n"
360 360
361 // Set defaults if editing an existing connection 361 // Set defaults if editing an existing connection
362 if(!isnewaccount) { 362 if(!isnewaccount) {
363 before_connect->setText(gpppdata.command_before_connect()); 363 before_connect->setText(PPPData::data()->command_before_connect());
364 command->setText(gpppdata.command_on_connect()); 364 command->setText(PPPData::data()->command_on_connect());
365 discommand->setText(gpppdata.command_on_disconnect()); 365 discommand->setText(PPPData::data()->command_on_disconnect());
366 predisconnect->setText(gpppdata.command_before_disconnect()); 366 predisconnect->setText(PPPData::data()->command_before_disconnect());
367 } 367 }
368} 368}
369 369
370 370
371bool ExecWidget::save() { 371bool ExecWidget::save() {
372 gpppdata.setCommand_before_connect(before_connect->text()); 372 PPPData::data()->setCommand_before_connect(before_connect->text());
373 gpppdata.setCommand_on_connect(command->text()); 373 PPPData::data()->setCommand_on_connect(command->text());
374 gpppdata.setCommand_before_disconnect(predisconnect->text()); 374 PPPData::data()->setCommand_before_disconnect(predisconnect->text());
375 gpppdata.setCommand_on_disconnect(discommand->text()); 375 PPPData::data()->setCommand_on_disconnect(discommand->text());
376 return true; 376 return true;
377} 377}
378 378
@@ -386,13 +386,13 @@ bool ExecWidget::save() {
386IPWidget::IPWidget( QWidget *parent, bool isnewaccount, const char *name ) 386IPWidget::IPWidget( QWidget *parent, bool isnewaccount, const char *name )
387 : QWidget(parent, name) 387 : QWidget(parent, name)
388{ 388{
389 QVBoxLayout *topLayout = new QVBoxLayout(parent); 389 QVBoxLayout *topLayout = new QVBoxLayout(this);
390 topLayout->setSpacing( 3 );//KDialog::spacingHint()); 390 topLayout->setSpacing( 3 );//KDialog::spacingHint());
391 391
392 box = new QVGroupBox(i18n("Configuration"), parent); 392 box = new QVGroupBox(i18n("Configuration"), this);
393// box->setInsideSpacing( 1 );//KDialog::spacingHint()); 393// box->setInsideSpacing( 1 );//KDialog::spacingHint());
394 394
395 rb = new QButtonGroup(parent); 395 rb = new QButtonGroup(this);
396 rb->hide(); 396 rb->hide();
397 connect(rb, SIGNAL(clicked(int)), 397 connect(rb, SIGNAL(clicked(int)),
398 SLOT(hitIPSelect(int))); 398 SLOT(hitIPSelect(int)));
@@ -448,8 +448,8 @@ IPWidget::IPWidget( QWidget *parent, bool isnewaccount, const char *name )
448 QWhatsThis::add(sub_label,tmp); 448 QWhatsThis::add(sub_label,tmp);
449 QWhatsThis::add(subnetmask_l,tmp); 449 QWhatsThis::add(subnetmask_l,tmp);
450 450
451 autoname = new QCheckBox(i18n("Auto-configure hostname from this IP"), parent); 451 autoname = new QCheckBox(i18n("Auto-configure hostname from this IP"), this);
452 autoname->setChecked(gpppdata.autoname()); 452 autoname->setChecked(PPPData::data()->autoname());
453 connect(autoname,SIGNAL(toggled(bool)), 453 connect(autoname,SIGNAL(toggled(bool)),
454 this,SLOT(autoname_t(bool))); 454 this,SLOT(autoname_t(bool)));
455 455
@@ -469,15 +469,15 @@ IPWidget::IPWidget( QWidget *parent, bool isnewaccount, const char *name )
469 469
470 //load info from gpppdata 470 //load info from gpppdata
471 if(!isnewaccount) { 471 if(!isnewaccount) {
472 if(gpppdata.ipaddr() == "0.0.0.0" && 472 if(PPPData::data()->ipaddr() == "0.0.0.0" &&
473 gpppdata.subnetmask() == "0.0.0.0") { 473 PPPData::data()->subnetmask() == "0.0.0.0") {
474 dynamicadd_rb->setChecked(true); 474 dynamicadd_rb->setChecked(true);
475 hitIPSelect(0); 475 hitIPSelect(0);
476 autoname->setChecked(gpppdata.autoname()); 476 autoname->setChecked(PPPData::data()->autoname());
477 } 477 }
478 else { 478 else {
479 ipaddress_l->setText(gpppdata.ipaddr()); 479 ipaddress_l->setText(PPPData::data()->ipaddr());
480 subnetmask_l->setText(gpppdata.subnetmask()); 480 subnetmask_l->setText(PPPData::data()->subnetmask());
481 staticadd_rb->setChecked(true); 481 staticadd_rb->setChecked(true);
482 autoname->setChecked(false); 482 autoname->setChecked(false);
483 } 483 }
@@ -510,13 +510,13 @@ void IPWidget::autoname_t(bool on) {
510 510
511void IPWidget::save() { 511void IPWidget::save() {
512 if(dynamicadd_rb->isChecked()) { 512 if(dynamicadd_rb->isChecked()) {
513 gpppdata.setIpaddr("0.0.0.0"); 513 PPPData::data()->setIpaddr("0.0.0.0");
514 gpppdata.setSubnetmask("0.0.0.0"); 514 PPPData::data()->setSubnetmask("0.0.0.0");
515 } else { 515 } else {
516 gpppdata.setIpaddr(ipaddress_l->text()); 516 PPPData::data()->setIpaddr(ipaddress_l->text());
517 gpppdata.setSubnetmask(subnetmask_l->text()); 517 PPPData::data()->setSubnetmask(subnetmask_l->text());
518 } 518 }
519 gpppdata.setAutoname(autoname->isChecked()); 519 PPPData::data()->setAutoname(autoname->isChecked());
520} 520}
521 521
522 522
@@ -540,14 +540,14 @@ void IPWidget::hitIPSelect( int i ) {
540DNSWidget::DNSWidget( QWidget *parent, bool isnewaccount, const char *name ) 540DNSWidget::DNSWidget( QWidget *parent, bool isnewaccount, const char *name )
541 : QWidget(parent, name) 541 : QWidget(parent, name)
542{ 542{
543 // box = new QGroupBox(parent); 543 // box = new QGroupBox(this);
544 QGridLayout *tl = new QGridLayout(parent, 7, 2, 0 );//, KDialog::spacingHint()); 544 QGridLayout *tl = new QGridLayout(this, 7, 2, 0 );//, KDialog::spacingHint());
545 545
546 dnsdomain_label = new QLabel(i18n("Domain name:"), parent); 546 dnsdomain_label = new QLabel(i18n("Domain name:"), this);
547 tl->addWidget(dnsdomain_label, 0, 0); 547 tl->addWidget(dnsdomain_label, 0, 0);
548 548
549 dnsdomain = new QLineEdit(parent); 549 dnsdomain = new QLineEdit(this);
550 dnsdomain->setMaxLength(DOMAIN_SIZE); 550// dnsdomain->setMaxLength(DOMAIN_SIZE);
551 tl->addWidget(dnsdomain, 0, 1); 551 tl->addWidget(dnsdomain, 0, 1);
552 QString tmp = i18n("If you enter a domain name here, this domain\n" 552 QString tmp = i18n("If you enter a domain name here, this domain\n"
553 "name is used for your computer while you are\n" 553 "name is used for your computer while you are\n"
@@ -561,30 +561,30 @@ DNSWidget::DNSWidget( QWidget *parent, bool isnewaccount, const char *name )
561 QWhatsThis::add(dnsdomain_label,tmp); 561 QWhatsThis::add(dnsdomain_label,tmp);
562 QWhatsThis::add(dnsdomain,tmp); 562 QWhatsThis::add(dnsdomain,tmp);
563 563
564 conf_label = new QLabel(i18n("Configuration:"), parent); 564 conf_label = new QLabel(i18n("Configuration:"), this);
565 tl->addWidget(conf_label, 1, 0); 565 tl->addWidget(conf_label, 1, 0);
566 566
567 bg = new QButtonGroup("Group", this); 567 bg = new QButtonGroup("Group", this);
568 connect(bg, SIGNAL(clicked(int)), SLOT(DNS_Mode_Selected(int))); 568 connect(bg, SIGNAL(clicked(int)), SLOT(DNS_Mode_Selected(int)));
569 bg->hide(); 569 bg->hide();
570 570
571 autodns = new QRadioButton(i18n("Automatic"), parent); 571 autodns = new QRadioButton(i18n("Automatic"), this);
572 bg->insert(autodns, 0); 572 bg->insert(autodns, 0);
573 tl->addWidget(autodns, 1, 1); 573 tl->addWidget(autodns, 1, 1);
574 // no automatic DNS detection for pppd < 2.3.7 574 // no automatic DNS detection for pppd < 2.3.7
575 if(!gpppdata.pppdVersionMin(2, 3, 7)) 575 if(!PPPData::data()->pppdVersionMin(2, 3, 7))
576 autodns->setEnabled(false); 576 autodns->setEnabled(false);
577 577
578 mandns = new QRadioButton(i18n("Manual"), parent); 578 mandns = new QRadioButton(i18n("Manual"), this);
579 bg->insert(mandns, 1); 579 bg->insert(mandns, 1);
580 tl->addWidget(mandns, 2, 1); 580 tl->addWidget(mandns, 2, 1);
581 581
582 dns_label = new QLabel(i18n("DNS IP address:"), parent); 582 dns_label = new QLabel(i18n("DNS IP address:"), this);
583 tl->addWidget(dns_label, 3, 0); 583 tl->addWidget(dns_label, 3, 0);
584 584
585 QHBoxLayout *l2 = new QHBoxLayout; 585 QHBoxLayout *l2 = new QHBoxLayout;
586 tl->addLayout(l2, 3, 1); 586 tl->addLayout(l2, 3, 1);
587 dnsipaddr = new IPLineEdit(parent); 587 dnsipaddr = new IPLineEdit(this);
588 connect(dnsipaddr, SIGNAL(returnPressed()), 588 connect(dnsipaddr, SIGNAL(returnPressed()),
589 SLOT(adddns())); 589 SLOT(adddns()));
590 connect(dnsipaddr, SIGNAL(textChanged(const QString &)), 590 connect(dnsipaddr, SIGNAL(textChanged(const QString &)),
@@ -604,11 +604,11 @@ DNSWidget::DNSWidget( QWidget *parent, bool isnewaccount, const char *name )
604 604
605 QHBoxLayout *l1 = new QHBoxLayout; 605 QHBoxLayout *l1 = new QHBoxLayout;
606 tl->addLayout(l1, 4, 1); 606 tl->addLayout(l1, 4, 1);
607 add = new QPushButton(i18n("Add"), parent); 607 add = new QPushButton(i18n("Add"), this);
608 connect(add, SIGNAL(clicked()), SLOT(adddns())); 608 connect(add, SIGNAL(clicked()), SLOT(adddns()));
609 int width = add->sizeHint().width(); 609// int width = add->sizeHint().width();
610 width = QMAX(width,60); 610// width = QMAX(width,60);
611 add->setMinimumWidth(width); 611// add->setMinimumWidth(width);
612 l1->addWidget(add); 612 l1->addWidget(add);
613 l1->addStretch(1); 613 l1->addStretch(1);
614 QWhatsThis::add(add, 614 QWhatsThis::add(add,
@@ -616,21 +616,21 @@ DNSWidget::DNSWidget( QWidget *parent, bool isnewaccount, const char *name )
616 "specified in the field above. The entry\n" 616 "specified in the field above. The entry\n"
617 "will then be added to the list below")); 617 "will then be added to the list below"));
618 618
619 remove = new QPushButton(i18n("Remove"), parent); 619 remove = new QPushButton(i18n("Remove"), this);
620 connect(remove, SIGNAL(clicked()), SLOT(removedns())); 620 connect(remove, SIGNAL(clicked()), SLOT(removedns()));
621 width = remove->sizeHint().width(); 621// width = remove->sizeHint().width();
622 width = QMAX(width,60); 622// width = QMAX(width,60);
623 remove->setMinimumWidth(width); 623// remove->setMinimumWidth(width);
624 l1->addWidget(remove); 624 l1->addWidget(remove);
625 QWhatsThis::add(remove, 625 QWhatsThis::add(remove,
626 i18n("Click this button to remove the selected DNS\n" 626 i18n("Click this button to remove the selected DNS\n"
627 "server entry from the list below")); 627 "server entry from the list below"));
628 628
629 servers_label = new QLabel(i18n("DNS address list:"), parent); 629 servers_label = new QLabel(i18n("DNS address list:"), this);
630 servers_label->setAlignment(AlignTop|AlignLeft); 630 servers_label->setAlignment(AlignTop|AlignLeft);
631 tl->addWidget(servers_label, 5, 0); 631 tl->addWidget(servers_label, 5, 0);
632 632
633 dnsservers = new QListBox(parent); 633 dnsservers = new QListBox(this);
634 dnsservers->setMinimumSize(150, 80); 634 dnsservers->setMinimumSize(150, 80);
635 connect(dnsservers, SIGNAL(highlighted(int)), 635 connect(dnsservers, SIGNAL(highlighted(int)),
636 SLOT(DNS_Entry_Selected(int))); 636 SLOT(DNS_Entry_Selected(int)));
@@ -644,8 +644,8 @@ DNSWidget::DNSWidget( QWidget *parent, bool isnewaccount, const char *name )
644 644
645 exdnsdisabled_toggle = new QCheckBox(i18n( \ 645 exdnsdisabled_toggle = new QCheckBox(i18n( \
646"Disable existing DNS servers during connection"), 646"Disable existing DNS servers during connection"),
647 parent); 647 this);
648 exdnsdisabled_toggle->setChecked(gpppdata.exDNSDisabled()); 648 exdnsdisabled_toggle->setChecked(PPPData::data()->exDNSDisabled());
649 tl->addMultiCellWidget(exdnsdisabled_toggle, 6, 6, 0, 1, AlignCenter); 649 tl->addMultiCellWidget(exdnsdisabled_toggle, 6, 6, 0, 1, AlignCenter);
650 QWhatsThis::add(exdnsdisabled_toggle, 650 QWhatsThis::add(exdnsdisabled_toggle,
651 i18n("<p>When this option is selected, all DNS\n" 651 i18n("<p>When this option is selected, all DNS\n"
@@ -661,11 +661,11 @@ DNSWidget::DNSWidget( QWidget *parent, bool isnewaccount, const char *name )
661 661
662 // restore data if editing 662 // restore data if editing
663 if(!isnewaccount) { 663 if(!isnewaccount) {
664 dnsservers->insertStringList(gpppdata.dns()); 664 dnsservers->insertStringList(PPPData::data()->dns());
665 dnsdomain->setText(gpppdata.domain()); 665 dnsdomain->setText(PPPData::data()->domain());
666 } 666 }
667 667
668 int mode = gpppdata.autoDNS() ? 0 : 1; 668 int mode = PPPData::data()->autoDNS() ? 0 : 1;
669 bg->setButton(mode); 669 bg->setButton(mode);
670 DNS_Mode_Selected(mode); 670 DNS_Mode_Selected(mode);
671 671
@@ -695,20 +695,20 @@ void DNSWidget::DNS_Mode_Selected(int mode) {
695} 695}
696 696
697void DNSWidget::save() { 697void DNSWidget::save() {
698 gpppdata.setAutoDNS(bg->id(bg->selected()) == 0); 698 PPPData::data()->setAutoDNS(bg->id(bg->selected()) == 0);
699 QStringList serverlist; 699 QStringList serverlist;
700 for(uint i=0; i < dnsservers->count(); i++) 700 for(uint i=0; i < dnsservers->count(); i++)
701 serverlist.append(dnsservers->text(i)); 701 serverlist.append(dnsservers->text(i));
702 gpppdata.setDns(serverlist); 702 PPPData::data()->setDns(serverlist);
703 703
704 // strip leading dot 704 // strip leading dot
705 QString s(dnsdomain->text()); 705 QString s(dnsdomain->text());
706 if(s.left(1) == ".") 706 if(s.left(1) == ".")
707 gpppdata.setDomain(s.mid(1)); 707 PPPData::data()->setDomain(s.mid(1));
708 else 708 else
709 gpppdata.setDomain(dnsdomain->text()); 709 PPPData::data()->setDomain(dnsdomain->text());
710 710
711 gpppdata.setExDNSDisabled(exdnsdisabled_toggle->isChecked()); 711 PPPData::data()->setExDNSDisabled(exdnsdisabled_toggle->isChecked());
712} 712}
713 713
714 714
@@ -735,13 +735,13 @@ void DNSWidget::removedns() {
735GatewayWidget::GatewayWidget( QWidget *parent, bool isnewaccount, const char *name ) 735GatewayWidget::GatewayWidget( QWidget *parent, bool isnewaccount, const char *name )
736 : QWidget(parent, name) 736 : QWidget(parent, name)
737{ 737{
738 QVBoxLayout *topLayout = new QVBoxLayout(parent); 738 QVBoxLayout *topLayout = new QVBoxLayout(this);
739 topLayout->setSpacing( 2 );//KDialog::spacingHint()); 739 topLayout->setSpacing( 2 );//KDialog::spacingHint());
740 740
741 box = new QVGroupBox(i18n("Configuration"), parent); 741 box = new QVGroupBox(i18n("Configuration"), this);
742// box->setInsideSpacing( 2 );//KDialog::spacingHint()); 742// box->setInsideSpacing( 2 );//KDialog::spacingHint());
743 743
744 rb = new QButtonGroup(parent); 744 rb = new QButtonGroup(this);
745 rb->hide(); 745 rb->hide();
746 connect(rb, SIGNAL(clicked(int)), SLOT(hitGatewaySelect(int))); 746 connect(rb, SIGNAL(clicked(int)), SLOT(hitGatewaySelect(int)));
747 747
@@ -771,7 +771,7 @@ GatewayWidget::GatewayWidget( QWidget *parent, bool isnewaccount, const char *na
771 gatewayaddr = new IPLineEdit(gateBox); 771 gatewayaddr = new IPLineEdit(gateBox);
772 772
773 defaultroute = new QCheckBox(i18n("Assign the default route to this gateway"), 773 defaultroute = new QCheckBox(i18n("Assign the default route to this gateway"),
774 parent); 774 this);
775 QWhatsThis::add(defaultroute, 775 QWhatsThis::add(defaultroute,
776 i18n("If this option is enabled, all packets not\n" 776 i18n("If this option is enabled, all packets not\n"
777 "going to the local net are routed through\n" 777 "going to the local net are routed through\n"
@@ -785,15 +785,15 @@ GatewayWidget::GatewayWidget( QWidget *parent, bool isnewaccount, const char *na
785 785
786 //load info from gpppdata 786 //load info from gpppdata
787 if(!isnewaccount) { 787 if(!isnewaccount) {
788 if(gpppdata.gateway() == "0.0.0.0") { 788 if(PPPData::data()->gateway() == "0.0.0.0") {
789 defaultgateway->setChecked(true); 789 defaultgateway->setChecked(true);
790 hitGatewaySelect(0); 790 hitGatewaySelect(0);
791 } 791 }
792 else { 792 else {
793 gatewayaddr->setText(gpppdata.gateway()); 793 gatewayaddr->setText(PPPData::data()->gateway());
794 staticgateway->setChecked(true); 794 staticgateway->setChecked(true);
795 } 795 }
796 defaultroute->setChecked(gpppdata.defaultroute()); 796 defaultroute->setChecked(PPPData::data()->defaultroute());
797 } 797 }
798 else { 798 else {
799 defaultgateway->setChecked(true); 799 defaultgateway->setChecked(true);
@@ -803,8 +803,8 @@ GatewayWidget::GatewayWidget( QWidget *parent, bool isnewaccount, const char *na
803} 803}
804 804
805void GatewayWidget::save() { 805void GatewayWidget::save() {
806 gpppdata.setGateway(gatewayaddr->text()); 806 PPPData::data()->setGateway(gatewayaddr->text());
807 gpppdata.setDefaultroute(defaultroute->isChecked()); 807 PPPData::data()->setDefaultroute(defaultroute->isChecked());
808} 808}
809 809
810 810
@@ -826,13 +826,13 @@ void GatewayWidget::hitGatewaySelect( int i ) {
826ScriptWidget::ScriptWidget( QWidget *parent, bool isnewaccount, const char *name ) 826ScriptWidget::ScriptWidget( QWidget *parent, bool isnewaccount, const char *name )
827 : QWidget(parent, name) 827 : QWidget(parent, name)
828{ 828{
829 QVBoxLayout *tl = new QVBoxLayout(parent, 0 );//, KDialog::spacingHint()); 829 QVBoxLayout *tl = new QVBoxLayout(this, 0 );//, KDialog::spacingHint());
830 se = new ScriptEdit(parent); 830 se = new ScriptEdit(this);
831 connect(se, SIGNAL(returnPressed()), SLOT(addButton())); 831 connect(se, SIGNAL(returnPressed()), SLOT(addButton()));
832 tl->addWidget(se); 832 tl->addWidget(se);
833 833
834 // insert equal-sized buttons 834 // insert equal-sized buttons
835 QButtonGroup *bbox = new QButtonGroup(parent); 835 QButtonGroup *bbox = new QButtonGroup(this);
836 add = new QPushButton( bbox, i18n("Add") ); 836 add = new QPushButton( bbox, i18n("Add") );
837 bbox->insert(add); 837 bbox->insert(add);
838 connect(add, SIGNAL(clicked()), SLOT(addButton())); 838 connect(add, SIGNAL(clicked()), SLOT(addButton()));
@@ -849,18 +849,18 @@ ScriptWidget::ScriptWidget( QWidget *parent, bool isnewaccount, const char *name
849 849
850 QHBoxLayout *l12 = new QHBoxLayout(0); 850 QHBoxLayout *l12 = new QHBoxLayout(0);
851 tl->addLayout(l12); 851 tl->addLayout(l12);
852 stl = new QListBox(parent); 852 stl = new QListBox(this);
853 stl->setVScrollBarMode( QScrollView::AlwaysOff ); 853 stl->setVScrollBarMode( QScrollView::AlwaysOff );
854 connect(stl, SIGNAL(highlighted(int)), SLOT(stlhighlighted(int))); 854 connect(stl, SIGNAL(highlighted(int)), SLOT(stlhighlighted(int)));
855 stl->setMinimumSize(QSize(70, 140)); 855 stl->setMinimumSize(QSize(70, 140));
856 856
857 sl = new QListBox(parent); 857 sl = new QListBox(this);
858 sl->setVScrollBarMode( QScrollView::AlwaysOff ); 858 sl->setVScrollBarMode( QScrollView::AlwaysOff );
859 connect(sl, SIGNAL(highlighted(int)), SLOT(slhighlighted(int))); 859 connect(sl, SIGNAL(highlighted(int)), SLOT(slhighlighted(int)));
860 sl->setMinimumSize(QSize(150, 140)); 860 sl->setMinimumSize(QSize(150, 140));
861 861
862 slb = new QScrollBar(parent); 862 slb = new QScrollBar(this);
863 slb->setFixedWidth(slb->sizeHint().width()); 863// slb->setFixedWidth(slb->sizeHint().width());
864 connect(slb, SIGNAL(valueChanged(int)), SLOT(scrolling(int))); 864 connect(slb, SIGNAL(valueChanged(int)), SLOT(scrolling(int)));
865 865
866 l12->addWidget(stl, 1); 866 l12->addWidget(stl, 1);
@@ -869,8 +869,8 @@ ScriptWidget::ScriptWidget( QWidget *parent, bool isnewaccount, const char *name
869 869
870 //load data from gpppdata 870 //load data from gpppdata
871 if(!isnewaccount) { 871 if(!isnewaccount) {
872 QStringList &comlist = gpppdata.scriptType(); 872 QStringList &comlist = PPPData::data()->scriptType();
873 QStringList &arglist = gpppdata.script(); 873 QStringList &arglist = PPPData::data()->script();
874 QStringList::Iterator itcom = comlist.begin(); 874 QStringList::Iterator itcom = comlist.begin();
875 QStringList::Iterator itarg = arglist.begin(); 875 QStringList::Iterator itarg = arglist.begin();
876 876
@@ -916,8 +916,8 @@ void ScriptWidget::save() {
916 typelist.append(stl->text(i)); 916 typelist.append(stl->text(i));
917 arglist.append(sl->text(i)); 917 arglist.append(sl->text(i));
918 } 918 }
919 gpppdata.setScriptType(typelist); 919 PPPData::data()->setScriptType(typelist);
920 gpppdata.setScript(arglist); 920 PPPData::data()->setScript(arglist);
921} 921}
922 922
923 923
@@ -1154,7 +1154,7 @@ void ScriptWidget::removeButton() {
1154// 1154//
1155///////////////////////////////////////////////////////////////////////////// 1155/////////////////////////////////////////////////////////////////////////////
1156PhoneNumberDialog::PhoneNumberDialog(QWidget *parent) 1156PhoneNumberDialog::PhoneNumberDialog(QWidget *parent)
1157 : QDialog(parent, 0, true ) { 1157 : QDialog(parent,"PhoneNumberDialog",true) {
1158 setCaption( i18n("Add Phone Number") ); 1158 setCaption( i18n("Add Phone Number") );
1159// KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon()); 1159// KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon());
1160 1160
@@ -1165,8 +1165,8 @@ PhoneNumberDialog::PhoneNumberDialog(QWidget *parent)
1165 1165
1166 new QLabel(i18n("Enter a phone number:"), hbox); 1166 new QLabel(i18n("Enter a phone number:"), hbox);
1167 1167
1168 le = newLineEdit(14, hbox); 1168 le = new QLineEdit(hbox);
1169 le->setMinimumWidth(125); 1169// le->setMinimumWidth(125);
1170 1170
1171 connect(le, SIGNAL(textChanged(const QString &)), 1171 connect(le, SIGNAL(textChanged(const QString &)),
1172 this, SLOT(textChanged(const QString &))); 1172 this, SLOT(textChanged(const QString &)));
diff --git a/noncore/settings/networksettings/ppp/general.cpp b/noncore/settings/networksettings/ppp/general.cpp
index f803628..a02ee35 100644
--- a/noncore/settings/networksettings/ppp/general.cpp
+++ b/noncore/settings/networksettings/ppp/general.cpp
@@ -164,7 +164,7 @@ ModemWidget::ModemWidget( QWidget *parent, const char *name)
164 QWhatsThis::add(baud_c,tmp); 164 QWhatsThis::add(baud_c,tmp);
165 165
166 for(int i=0; i <= enter->count()-1; i++) { 166 for(int i=0; i <= enter->count()-1; i++) {
167 if(gpppdata.enter() == enter->text(i)) 167 if(PPPData::data()->enter() == enter->text(i))
168 enter->setCurrentItem(i); 168 enter->setCurrentItem(i);
169 } 169 }
170 170
@@ -173,7 +173,7 @@ ModemWidget::ModemWidget( QWidget *parent, const char *name)
173 //Modem Lock File 173 //Modem Lock File
174 modemlockfile = new QCheckBox(i18n("&Use lock file"), this); 174 modemlockfile = new QCheckBox(i18n("&Use lock file"), this);
175 175
176 modemlockfile->setChecked(gpppdata.modemLockFile()); 176 modemlockfile->setChecked(PPPData::data()->modemLockFile());
177 connect(modemlockfile, SIGNAL(toggled(bool)), 177 connect(modemlockfile, SIGNAL(toggled(bool)),
178 SLOT(modemlockfilechanged(bool))); 178 SLOT(modemlockfilechanged(bool)));
179 tl->addMultiCellWidget(modemlockfile, 5, 5, 0, 1); 179 tl->addMultiCellWidget(modemlockfile, 5, 5, 0, 1);
@@ -191,7 +191,7 @@ ModemWidget::ModemWidget( QWidget *parent, const char *name)
191 191
192 // Modem Timeout Line Edit Box 192 // Modem Timeout Line Edit Box
193 193
194 modemtimeout = new KIntNumInput(gpppdata.modemTimeout(), this); 194 modemtimeout = new KIntNumInput(PPPData::data()->modemTimeout(), this);
195 modemtimeout->setLabel(i18n("Modem &timeout:")); 195 modemtimeout->setLabel(i18n("Modem &timeout:"));
196 modemtimeout->setRange(1, 120, 1); 196 modemtimeout->setRange(1, 120, 1);
197 modemtimeout->setSuffix(i18n(" sec")); 197 modemtimeout->setSuffix(i18n(" sec"));
@@ -206,23 +206,23 @@ ModemWidget::ModemWidget( QWidget *parent, const char *name)
206 206
207 //set stuff from gpppdata 207 //set stuff from gpppdata
208 for(int i=0; i <= enter->count()-1; i++) { 208 for(int i=0; i <= enter->count()-1; i++) {
209 if(gpppdata.enter() == enter->text(i)) 209 if(PPPData::data()->enter() == enter->text(i))
210 enter->setCurrentItem(i); 210 enter->setCurrentItem(i);
211 } 211 }
212 212
213 for(int i=0; i <= modemdevice->count()-1; i++) { 213 for(int i=0; i <= modemdevice->count()-1; i++) {
214 if(gpppdata.modemDevice() == modemdevice->text(i)) 214 if(PPPData::data()->modemDevice() == modemdevice->text(i))
215 modemdevice->setCurrentItem(i); 215 modemdevice->setCurrentItem(i);
216 } 216 }
217 217
218 for(int i=0; i <= flowcontrol->count()-1; i++) { 218 for(int i=0; i <= flowcontrol->count()-1; i++) {
219 if(gpppdata.flowcontrol() == flowcontrol->text(i)) 219 if(PPPData::data()->flowcontrol() == flowcontrol->text(i))
220 flowcontrol->setCurrentItem(i); 220 flowcontrol->setCurrentItem(i);
221 } 221 }
222 222
223 //set the modem speed 223 //set the modem speed
224 for(int i=0; i < baud_c->count(); i++) 224 for(int i=0; i < baud_c->count(); i++)
225 if(baud_c->text(i) == gpppdata.speed()) 225 if(baud_c->text(i) == PPPData::data()->speed())
226 baud_c->setCurrentItem(i); 226 baud_c->setCurrentItem(i);
227 227
228 tl->setRowStretch(7, 1); 228 tl->setRowStretch(7, 1);
@@ -230,32 +230,32 @@ ModemWidget::ModemWidget( QWidget *parent, const char *name)
230 230
231 231
232void ModemWidget::speed_selection(int) { 232void ModemWidget::speed_selection(int) {
233 gpppdata.setSpeed(baud_c->text(baud_c->currentItem())); 233 PPPData::data()->setSpeed(baud_c->text(baud_c->currentItem()));
234} 234}
235 235
236 236
237void ModemWidget::setenter(int ) { 237void ModemWidget::setenter(int ) {
238 gpppdata.setEnter(enter->text(enter->currentItem())); 238 PPPData::data()->setEnter(enter->text(enter->currentItem()));
239} 239}
240 240
241 241
242void ModemWidget::setmodemdc(int i) { 242void ModemWidget::setmodemdc(int i) {
243 gpppdata.setModemDevice(modemdevice->text(i)); 243 PPPData::data()->setModemDevice(modemdevice->text(i));
244} 244}
245 245
246 246
247void ModemWidget::setflowcontrol(int i) { 247void ModemWidget::setflowcontrol(int i) {
248 gpppdata.setFlowcontrol(flowcontrol->text(i)); 248 PPPData::data()->setFlowcontrol(flowcontrol->text(i));
249} 249}
250 250
251 251
252void ModemWidget::modemlockfilechanged(bool set) { 252void ModemWidget::modemlockfilechanged(bool set) {
253 gpppdata.setModemLockFile(set); 253 PPPData::data()->setModemLockFile(set);
254} 254}
255 255
256 256
257void ModemWidget::modemtimeoutchanged(int n) { 257void ModemWidget::modemtimeoutchanged(int n) {
258 gpppdata.setModemTimeout(n); 258 PPPData::data()->setModemTimeout(n);
259} 259}
260 260
261 261
@@ -266,7 +266,7 @@ ModemWidget2::ModemWidget2( QWidget *parent, const char *name)
266 266
267 267
268 waitfordt = new QCheckBox(i18n("&Wait for dial tone before dialing"), this); 268 waitfordt = new QCheckBox(i18n("&Wait for dial tone before dialing"), this);
269 waitfordt->setChecked(gpppdata.waitForDialTone()); 269 waitfordt->setChecked(PPPData::data()->waitForDialTone());
270 connect(waitfordt, SIGNAL(toggled(bool)), SLOT(waitfordtchanged(bool))); 270 connect(waitfordt, SIGNAL(toggled(bool)), SLOT(waitfordtchanged(bool)));
271 l1->addWidget(waitfordt); 271 l1->addWidget(waitfordt);
272 QWhatsThis::add(waitfordt, 272 QWhatsThis::add(waitfordt,
@@ -278,7 +278,7 @@ ModemWidget2::ModemWidget2( QWidget *parent, const char *name)
278 "\n" 278 "\n"
279 "<b>Default:</b>: On")); 279 "<b>Default:</b>: On"));
280 280
281 busywait = new KIntNumInput(gpppdata.busyWait(), this); 281 busywait = new KIntNumInput(PPPData::data()->busyWait(), this);
282 busywait->setLabel(i18n("B&usy wait:")); 282 busywait->setLabel(i18n("B&usy wait:"));
283 busywait->setRange(0, 300, 5, true); 283 busywait->setRange(0, 300, 5, true);
284 busywait->setSuffix(i18n(" sec")); 284 busywait->setSuffix(i18n(" sec"));
@@ -301,7 +301,7 @@ ModemWidget2::ModemWidget2( QWidget *parent, const char *name)
301 301
302 QLabel *volumeLabel = new QLabel(i18n("Modem &volume:"), this); 302 QLabel *volumeLabel = new QLabel(i18n("Modem &volume:"), this);
303 hbl->addWidget(volumeLabel); 303 hbl->addWidget(volumeLabel);
304 volume = new QSlider(0, 2, 1, gpppdata.volume(), QSlider::Horizontal, this); 304 volume = new QSlider(0, 2, 1, PPPData::data()->volume(), QSlider::Horizontal, this);
305 volumeLabel->setBuddy(volume); 305 volumeLabel->setBuddy(volume);
306 volume->setTickmarks(QSlider::Below); 306 volume->setTickmarks(QSlider::Below);
307 hbl->addWidget(volume); 307 hbl->addWidget(volume);
@@ -325,7 +325,7 @@ ModemWidget2::ModemWidget2( QWidget *parent, const char *name)
325 325
326#if 0 326#if 0
327 chkbox1 = new QCheckBox(i18n("Modem asserts CD line"), this); 327 chkbox1 = new QCheckBox(i18n("Modem asserts CD line"), this);
328 chkbox1->setChecked(gpppdata.UseCDLine()); 328 chkbox1->setChecked(PPPData::data()->UseCDLine());
329 connect(chkbox1,SIGNAL(toggled(bool)), 329 connect(chkbox1,SIGNAL(toggled(bool)),
330 this,SLOT(use_cdline_toggled(bool))); 330 this,SLOT(use_cdline_toggled(bool)));
331 l12->addWidget(chkbox1); 331 l12->addWidget(chkbox1);
@@ -402,20 +402,20 @@ void ModemWidget2::query_modem() {
402 402
403#if 0 403#if 0
404void ModemWidget2::use_cdline_toggled(bool on) { 404void ModemWidget2::use_cdline_toggled(bool on) {
405 gpppdata.setUseCDLine(on); 405 PPPData::data()->setUseCDLine(on);
406} 406}
407#endif 407#endif
408 408
409void ModemWidget2::waitfordtchanged(bool b) { 409void ModemWidget2::waitfordtchanged(bool b) {
410 gpppdata.setWaitForDialTone((int)b); 410 PPPData::data()->setWaitForDialTone((int)b);
411} 411}
412 412
413void ModemWidget2::busywaitchanged(int n) { 413void ModemWidget2::busywaitchanged(int n) {
414 gpppdata.setbusyWait(n); 414 PPPData::data()->setbusyWait(n);
415} 415}
416 416
417 417
418void ModemWidget2::volumeChanged(int v) { 418void ModemWidget2::volumeChanged(int v) {
419 gpppdata.setVolume(v); 419 PPPData::data()->setVolume(v);
420} 420}
421 421
diff --git a/noncore/settings/networksettings/ppp/kpppwidget.cpp b/noncore/settings/networksettings/ppp/kpppwidget.cpp
index 2f9feda..8d70cd4 100644
--- a/noncore/settings/networksettings/ppp/kpppwidget.cpp
+++ b/noncore/settings/networksettings/ppp/kpppwidget.cpp
@@ -158,7 +158,7 @@ KPPPWidget::KPPPWidget( QWidget *parent, const char *name, bool modal, WFlags fl
158// log = new QCheckBox(i18n("Show lo&g window"), this); 158// log = new QCheckBox(i18n("Show lo&g window"), this);
159// connect(log, SIGNAL(toggled(bool)), 159// connect(log, SIGNAL(toggled(bool)),
160 // this, SLOT(log_window_toggled(bool))); 160 // this, SLOT(log_window_toggled(bool)));
161// log->setChecked(gpppdata.get_show_log_window()); 161// log->setChecked(PPPData::data()->get_show_log_window());
162// l3->addWidget(log); 162// l3->addWidget(log);
163 163
164// QWhatsThis::add(log, 164// QWhatsThis::add(log,
@@ -191,7 +191,7 @@ KPPPWidget::KPPPWidget( QWidget *parent, const char *name, bool modal, WFlags fl
191 191
192 192
193 193
194// if(gpppdata.access() != KConfig::ReadWrite) 194// if(PPPData::data()->access() != KConfig::ReadWrite)
195// setup_b->setEnabled(false); 195// setup_b->setEnabled(false);
196 196
197// help_b = new QPushButton(i18n("&Help"), this); 197// help_b = new QPushButton(i18n("&Help"), this);
@@ -291,7 +291,7 @@ KPPPWidget::KPPPWidget( QWidget *parent, const char *name, bool modal, WFlags fl
291// } 291// }
292 292
293// if(m_bCmdlAccount){ 293// if(m_bCmdlAccount){
294// bool result = gpppdata.setAccount(m_strCmdlAccount); 294// bool result = PPPData::data()->setAccount(m_strCmdlAccount);
295// if (!result){ 295// if (!result){
296// QString string; 296// QString string;
297// string = i18n("No such Account:\n%1").arg(m_strCmdlAccount); 297// string = i18n("No such Account:\n%1").arg(m_strCmdlAccount);
@@ -363,7 +363,7 @@ void KPPPWidget::enterPressedInPW() {
363 363
364// triggered by the session manager 364// triggered by the session manager
365void KPPPWidget::saveMyself() { 365void KPPPWidget::saveMyself() {
366 gpppdata.save(); 366 PPPData::data()->save();
367} 367}
368 368
369void KPPPWidget::shutDown() { 369void KPPPWidget::shutDown() {
@@ -372,7 +372,7 @@ void KPPPWidget::shutDown() {
372} 372}
373 373
374void KPPPWidget::log_window_toggled(bool on) { 374void KPPPWidget::log_window_toggled(bool on) {
375 gpppdata.set_show_log_window(on); 375 PPPData::data()->set_show_log_window(on);
376} 376}
377 377
378 378
@@ -381,7 +381,7 @@ void KPPPWidget::log_window_toggled(bool on) {
381// void KPPPWidget::resetaccounts() { 381// void KPPPWidget::resetaccounts() {
382// connectto_c->clear(); 382// connectto_c->clear();
383 383
384// int count = gpppdata.count(); 384// int count = PPPData::data()->count();
385 385
386// // enable/disable controls 386// // enable/disable controls
387// connectto_c->setEnabled(count > 0); 387// connectto_c->setEnabled(count > 0);
@@ -392,27 +392,27 @@ void KPPPWidget::log_window_toggled(bool on) {
392 392
393// //load the accounts 393// //load the accounts
394// for(int i=0; i < count; i++) { 394// for(int i=0; i < count; i++) {
395// gpppdata.setAccountbyIndex(i); 395// PPPData::data()->setAccountbyIndex(i);
396// connectto_c->insertItem(gpppdata.accname()); 396// connectto_c->insertItem(PPPData::data()->accname());
397// } 397// }
398 398
399// //set the default account 399// //set the default account
400// if(!gpppdata.defaultAccount().isEmpty()) { 400// if(!PPPData::data()->defaultAccount().isEmpty()) {
401// for(int i=0; i < count; i++) 401// for(int i=0; i < count; i++)
402// if(gpppdata.defaultAccount() == connectto_c->text(i)) { 402// if(PPPData::data()->defaultAccount() == connectto_c->text(i)) {
403 // connectto_c->setCurrentItem(i); 403 // connectto_c->setCurrentItem(i);
404 // gpppdata.setAccountbyIndex(i); 404 // PPPData::data()->setAccountbyIndex(i);
405 405
406 // ID_Edit->setText(gpppdata.storedUsername()); 406 // ID_Edit->setText(PPPData::data()->storedUsername());
407 // PW_Edit->setText(gpppdata.storedPassword()); 407 // PW_Edit->setText(PPPData::data()->storedPassword());
408// } 408// }
409// } 409// }
410// else 410// else
411// if(count > 0) { 411// if(count > 0) {
412// gpppdata.setDefaultAccount(connectto_c->text(0)); 412// PPPData::data()->setDefaultAccount(connectto_c->text(0));
413// gpppdata.save(); 413// PPPData::data()->save();
414 // ID_Edit->setText(gpppdata.storedUsername()); 414 // ID_Edit->setText(PPPData::data()->storedUsername());
415 // PW_Edit->setText(gpppdata.storedPassword()); 415 // PW_Edit->setText(PPPData::data()->storedPassword());
416// } 416// }
417 417
418// connect(ID_Edit, SIGNAL(textChanged(const QString &)), 418// connect(ID_Edit, SIGNAL(textChanged(const QString &)),
@@ -434,7 +434,7 @@ void KPPPWidget::interruptConnection() {
434// emit con->cancelbutton(); 434// emit con->cancelbutton();
435 435
436 // disconnect if online 436 // disconnect if online
437 if (gpppdata.pppdRunning()) 437 if (PPPData::data()->pppdRunning())
438 emit disconnect(); 438 emit disconnect();
439} 439}
440 440
@@ -445,7 +445,7 @@ void KPPPWidget::sigPPPDDied() {
445 // if we are not connected pppdpid is -1 so have have to check for that 445 // if we are not connected pppdpid is -1 so have have to check for that
446 // in the followin line to make sure that we don't raise a false alarm 446 // in the followin line to make sure that we don't raise a false alarm
447 // such as would be the case when the log file viewer exits. 447 // such as would be the case when the log file viewer exits.
448 if(gpppdata.pppdRunning() || gpppdata.pppdError()) { 448 if(PPPData::data()->pppdRunning() || PPPData::data()->pppdError()) {
449 qDebug( "It was pppd that died" ); 449 qDebug( "It was pppd that died" );
450 450
451 // when we killpppd() on Cancel in ConnectWidget 451 // when we killpppd() on Cancel in ConnectWidget
@@ -457,11 +457,11 @@ void KPPPWidget::sigPPPDDied() {
457 Modem::modem->removeSecret(AUTH_PAP); 457 Modem::modem->removeSecret(AUTH_PAP);
458 Modem::modem->removeSecret(AUTH_CHAP); 458 Modem::modem->removeSecret(AUTH_CHAP);
459 459
460 gpppdata.setpppdRunning(false); 460 PPPData::data()->setpppdRunning(false);
461 461
462 qDebug( "Executing command on disconnect since pppd has died." ); 462 qDebug( "Executing command on disconnect since pppd has died." );
463 QApplication::flushX(); 463 QApplication::flushX();
464 execute_command(gpppdata.command_on_disconnect()); 464 execute_command(PPPData::data()->command_on_disconnect());
465 465
466// stopAccounting(); 466// stopAccounting();
467 467
@@ -469,13 +469,13 @@ void KPPPWidget::sigPPPDDied() {
469// DockWidget::dock_widget->stop_stats(); 469// DockWidget::dock_widget->stop_stats();
470// DockWidget::dock_widget->hide(); 470// DockWidget::dock_widget->hide();
471 471
472 if(!gpppdata.pppdError()) 472 if(!PPPData::data()->pppdError())
473 gpppdata.setpppdError(E_PPPD_DIED); 473 PPPData::data()->setpppdError(E_PPPD_DIED);
474 removedns(); 474 removedns();
475 Modem::modem->unlockdevice(); 475 Modem::modem->unlockdevice();
476 // con->pppdDied(); 476 // con->pppdDied();
477 477
478 if(!gpppdata.automatic_redial()) { 478 if(!PPPData::data()->automatic_redial()) {
479 quit_b->setFocus(); 479 quit_b->setFocus();
480 show(); 480 show();
481// con_win->stopClock(); 481// con_win->stopClock();
@@ -483,10 +483,10 @@ void KPPPWidget::sigPPPDDied() {
483// con_win->hide(); 483// con_win->hide();
484// con->hide(); 484// con->hide();
485 485
486 gpppdata.setpppdRunning(false); 486 PPPData::data()->setpppdRunning(false);
487 // // not in a signal handler !!! KNotifyClient::beep(); 487 // // not in a signal handler !!! KNotifyClient::beep();
488 QString msg; 488 QString msg;
489 if (gpppdata.pppdError() == E_IF_TIMEOUT) 489 if (PPPData::data()->pppdError() == E_IF_TIMEOUT)
490 msg = i18n("Timeout expired while waiting for the PPP interface " 490 msg = i18n("Timeout expired while waiting for the PPP interface "
491 "to come up!"); 491 "to come up!");
492 else { 492 else {
@@ -507,22 +507,22 @@ void KPPPWidget::sigPPPDDied() {
507 if (false){ 507 if (false){
508 qDebug( "Trying to reconnect... " ); 508 qDebug( "Trying to reconnect... " );
509 509
510 if(gpppdata.authMethod() == AUTH_PAP || 510 if(PPPData::data()->authMethod() == AUTH_PAP ||
511 gpppdata.authMethod() == AUTH_CHAP || 511 PPPData::data()->authMethod() == AUTH_CHAP ||
512 gpppdata.authMethod() == AUTH_PAPCHAP) 512 PPPData::data()->authMethod() == AUTH_PAPCHAP)
513 Modem::modem->setSecret(gpppdata.authMethod(), 513 Modem::modem->setSecret(PPPData::data()->authMethod(),
514 encodeWord(gpppdata.storedUsername()), 514 encodeWord(PPPData::data()->storedUsername()),
515 encodeWord(gpppdata.password())); 515 encodeWord(PPPData::data()->password()));
516 516
517// con_win->hide(); 517// con_win->hide();
518 // con_win->stopClock(); 518 // con_win->stopClock();
519 //stopAccounting(); 519 //stopAccounting();
520 gpppdata.setpppdRunning(false); 520 PPPData::data()->setpppdRunning(false);
521 // not in a signal handler !!!KNotifyClient::beep(); 521 // not in a signal handler !!!KNotifyClient::beep();
522 emit cmdl_start(); 522 emit cmdl_start();
523 } 523 }
524 } 524 }
525 gpppdata.setpppdError(0); 525 PPPData::data()->setpppdError(0);
526 } 526 }
527} 527}
528 528
@@ -543,10 +543,10 @@ void KPPPWidget::sigPPPDDied() {
543 543
544 544
545void KPPPWidget::newdefaultaccount(int i) { 545void KPPPWidget::newdefaultaccount(int i) {
546 gpppdata.setDefaultAccount(connectto_c->text(i)); 546 PPPData::data()->setDefaultAccount(connectto_c->text(i));
547 gpppdata.save(); 547 PPPData::data()->save();
548 ID_Edit->setText(gpppdata.storedUsername()); 548 ID_Edit->setText(PPPData::data()->storedUsername());
549 PW_Edit->setText(gpppdata.storedPassword()); 549 PW_Edit->setText(PPPData::data()->storedPassword());
550} 550}
551 551
552 552
@@ -556,10 +556,10 @@ void KPPPWidget::beginConnect() {
556 // make sure to connect to the account that is selected in the combo box 556 // make sure to connect to the account that is selected in the combo box
557 // (exeption: an account given by a command line argument) 557 // (exeption: an account given by a command line argument)
558 // if(!m_bCmdlAccount) { 558 // if(!m_bCmdlAccount) {
559// gpppdata.setAccount(connectto_c->currentText()); 559// PPPData::data()->setAccount(connectto_c->currentText());
560// gpppdata.setPassword(PW_Edit->text()); 560// PPPData::data()->setPassword(PW_Edit->text());
561// } else { 561// } else {
562 gpppdata.setPassword(gpppdata.storedPassword()); 562 PPPData::data()->setPassword(PPPData::data()->storedPassword());
563// } 563// }
564 564
565 QFileInfo info(pppdPath()); 565 QFileInfo info(pppdPath());
@@ -577,14 +577,14 @@ void KPPPWidget::beginConnect() {
577 string = i18n("kppp cannot execute:\n %1\n" 577 string = i18n("kppp cannot execute:\n %1\n"
578 "Please make sure that you have given kppp " 578 "Please make sure that you have given kppp "
579 "setuid permission and that " 579 "setuid permission and that "
580 "pppd is executable.").arg(gpppdata.pppdPath()); 580 "pppd is executable.").arg(PPPData::data()->pppdPath());
581 KMessageBox::error(this, string); 581 KMessageBox::error(this, string);
582 return; 582 return;
583 583
584 } 584 }
585#endif 585#endif
586 586
587 QFileInfo info2(gpppdata.modemDevice()); 587 QFileInfo info2(PPPData::data()->modemDevice());
588 588
589 if(!info2.exists()){ 589 if(!info2.exists()){
590 QString string; 590 QString string;
@@ -592,16 +592,16 @@ void KPPPWidget::beginConnect() {
592 "your modem device properly " 592 "your modem device properly "
593 "and/or adjust the location of the modem device on " 593 "and/or adjust the location of the modem device on "
594 "the modem tab of " 594 "the modem tab of "
595 "the setup dialog.").arg(gpppdata.modemDevice()); 595 "the setup dialog.").arg(PPPData::data()->modemDevice());
596 QMessageBox::warning(this, "error", string); 596 QMessageBox::warning(this, "error", string);
597 return; 597 return;
598 } 598 }
599 599
600 // if this is a PAP or CHAP account, ensure that username is 600 // if this is a PAP or CHAP account, ensure that username is
601 // supplied 601 // supplied
602 if(gpppdata.authMethod() == AUTH_PAP || 602 if(PPPData::data()->authMethod() == AUTH_PAP ||
603 gpppdata.authMethod() == AUTH_CHAP || 603 PPPData::data()->authMethod() == AUTH_CHAP ||
604 gpppdata.authMethod() == AUTH_PAPCHAP ) { 604 PPPData::data()->authMethod() == AUTH_PAPCHAP ) {
605 if(ID_Edit->text().isEmpty()) { 605 if(ID_Edit->text().isEmpty()) {
606 QMessageBox::warning(this,"error", 606 QMessageBox::warning(this,"error",
607 i18n( 607 i18n(
@@ -610,9 +610,9 @@ void KPPPWidget::beginConnect() {
610 "supply a username and a password!")); 610 "supply a username and a password!"));
611 return; 611 return;
612 } else { 612 } else {
613 if(!Modem::modem->setSecret(gpppdata.authMethod(), 613 if(!Modem::modem->setSecret(PPPData::data()->authMethod(),
614 encodeWord(gpppdata.storedUsername()), 614 encodeWord(PPPData::data()->storedUsername()),
615 encodeWord(gpppdata.password()))) { 615 encodeWord(PPPData::data()->password()))) {
616 QString s; 616 QString s;
617 s = i18n("Cannot create PAP/CHAP authentication\n" 617 s = i18n("Cannot create PAP/CHAP authentication\n"
618 "file \"%1\"").arg(PAP_AUTH_FILE); 618 "file \"%1\"").arg(PAP_AUTH_FILE);
@@ -622,7 +622,7 @@ void KPPPWidget::beginConnect() {
622 } 622 }
623 } 623 }
624 624
625 if (gpppdata.phonenumber().isEmpty()) { 625 if (PPPData::data()->phonenumber().isEmpty()) {
626 QString s = i18n("You must specify a telephone number!"); 626 QString s = i18n("You must specify a telephone number!");
627 QMessageBox::warning(this, "error", s); 627 QMessageBox::warning(this, "error", s);
628 return; 628 return;
@@ -630,12 +630,12 @@ void KPPPWidget::beginConnect() {
630 630
631 this->hide(); 631 this->hide();
632 632
633 QString tit = i18n("Connecting to: %1").arg(gpppdata.accname()); 633 QString tit = i18n("Connecting to: %1").arg(PPPData::data()->accname());
634// con->setCaption(tit); 634// con->setCaption(tit);
635 635
636// con->show(); 636// con->show();
637 637
638 bool show_debug = gpppdata.get_show_log_window(); 638 bool show_debug = PPPData::data()->get_show_log_window();
639 // con->debug->setOn(show_debug);// toggle button 639 // con->debug->setOn(show_debug);// toggle button
640 debugwindow->clear(); 640 debugwindow->clear();
641 if (!show_debug) 641 if (!show_debug)
@@ -650,7 +650,7 @@ void KPPPWidget::beginConnect() {
650 650
651 651
652void KPPPWidget::disconnect() { 652void KPPPWidget::disconnect() {
653 if (!gpppdata.command_before_disconnect().isEmpty()) { 653 if (!PPPData::data()->command_before_disconnect().isEmpty()) {
654// con_win->hide(); 654// con_win->hide();
655// con->show(); 655// con->show();
656// con->setCaption(i18n("Disconnecting...")); 656// con->setCaption(i18n("Disconnecting..."));
@@ -659,7 +659,7 @@ void KPPPWidget::disconnect() {
659 qApp->processEvents(); 659 qApp->processEvents();
660 QApplication::flushX(); 660 QApplication::flushX();
661// pid_t id = 661// pid_t id =
662 execute_command(gpppdata.command_before_disconnect()); 662 execute_command(PPPData::data()->command_before_disconnect());
663// int i, status; 663// int i, status;
664 664
665// do { 665// do {
@@ -677,7 +677,7 @@ void KPPPWidget::disconnect() {
677 Modem::modem->killPPPDaemon(); 677 Modem::modem->killPPPDaemon();
678 678
679 QApplication::flushX(); 679 QApplication::flushX();
680 execute_command(gpppdata.command_on_disconnect()); 680 execute_command(PPPData::data()->command_on_disconnect());
681 681
682 Modem::modem->removeSecret(AUTH_PAP); 682 Modem::modem->removeSecret(AUTH_PAP);
683 Modem::modem->removeSecret(AUTH_CHAP); 683 Modem::modem->removeSecret(AUTH_CHAP);
@@ -707,22 +707,22 @@ void KPPPWidget::disconnect() {
707 707
708 708
709void KPPPWidget::quitbutton() { 709void KPPPWidget::quitbutton() {
710 if(gpppdata.pppdRunning()) { 710 if(PPPData::data()->pppdRunning()) {
711 int ok = QMessageBox::warning(this, 711 int ok = QMessageBox::warning(this,
712 i18n("Exiting kPPP will close your PPP Session."), 712 i18n("Exiting kPPP will close your PPP Session."),
713 i18n("Quit kPPP?")); 713 i18n("Quit kPPP?"));
714 if(ok == QMessageBox::Yes) { 714 if(ok == QMessageBox::Yes) {
715 Modem::modem->killPPPDaemon(); 715 Modem::modem->killPPPDaemon();
716 QApplication::flushX(); 716 QApplication::flushX();
717 execute_command(gpppdata.command_on_disconnect()); 717 execute_command(PPPData::data()->command_on_disconnect());
718 removedns(); 718 removedns();
719 Modem::modem->unlockdevice(); 719 Modem::modem->unlockdevice();
720 } 720 }
721 } else { 721 } else {
722 if (!gpppdata.accname().isEmpty() && !gpppdata.storePassword()) 722 if (!PPPData::data()->accname().isEmpty() && !PPPData::data()->storePassword())
723 gpppdata.setStoredPassword(""); 723 PPPData::data()->setStoredPassword("");
724 } 724 }
725 gpppdata.save(); 725 PPPData::data()->save();
726 qApp->quit(); 726 qApp->quit();
727} 727}
728 728
@@ -736,13 +736,13 @@ void KPPPWidget::quitbutton() {
736// // volume accounting 736// // volume accounting
737// stats->totalbytes = 0; 737// stats->totalbytes = 0;
738 738
739// kdDebug() << "AcctEnabled: " << gpppdata.AcctEnabled() << endl; 739// kdDebug() << "AcctEnabled: " << PPPData::data()->AcctEnabled() << endl;
740 740
741// // load the ruleset 741// // load the ruleset
742// if(!gpppdata.AcctEnabled()) 742// if(!PPPData::data()->AcctEnabled())
743// return; 743// return;
744 744
745// QString d = AccountingBase::getAccountingFile(gpppdata.accountingFile()); 745// QString d = AccountingBase::getAccountingFile(PPPData::data()->accountingFile());
746// // if(::access(d.data(), X_OK) != 0) 746// // if(::access(d.data(), X_OK) != 0)
747// acct = new Accounting(this, stats); 747// acct = new Accounting(this, stats);
748// // else 748// // else
@@ -752,9 +752,9 @@ void KPPPWidget::quitbutton() {
752// connect(acct, SIGNAL(changed(QString, QString)), 752// connect(acct, SIGNAL(changed(QString, QString)),
753 // con_win, SLOT(slotAccounting(QString, QString))); 753 // con_win, SLOT(slotAccounting(QString, QString)));
754 754
755// // if(!acct->loadRuleSet(gpppdata.accountingFile())) { 755// // if(!acct->loadRuleSet(PPPData::data()->accountingFile())) {
756// // QString s= i18n("Can not load the accounting " 756// // QString s= i18n("Can not load the accounting "
757 // // "ruleset \"%1\"!").arg(gpppdata.accountingFile()); 757 // // "ruleset \"%1\"!").arg(PPPData::data()->accountingFile());
758 758
759// // starting the messagebox with a timer will prevent us 759// // starting the messagebox with a timer will prevent us
760// // from blocking the calling function ConnectWidget::timerEvent 760// // from blocking the calling function ConnectWidget::timerEvent
@@ -769,9 +769,9 @@ void KPPPWidget::quitbutton() {
769// void KPPPWidget::stopAccounting() { 769// void KPPPWidget::stopAccounting() {
770// // store volume accounting 770// // store volume accounting
771// // if(stats->totalbytes != 0) 771// // if(stats->totalbytes != 0)
772// // gpppdata.setTotalBytes(stats->totalbytes); 772// // PPPData::data()->setTotalBytes(stats->totalbytes);
773 773
774// if(!gpppdata.AcctEnabled()) 774// if(!PPPData::data()->AcctEnabled())
775// return; 775// return;
776 776
777// // if(acct != 0) { 777// // if(acct != 0) {
@@ -792,16 +792,16 @@ void KPPPWidget::quitbutton() {
792 792
793void KPPPWidget::usernameChanged(const QString &) { 793void KPPPWidget::usernameChanged(const QString &) {
794 // store username for later use 794 // store username for later use
795 gpppdata.setStoredUsername(ID_Edit->text()); 795 PPPData::data()->setStoredUsername(ID_Edit->text());
796} 796}
797 797
798 798
799void KPPPWidget::passwordChanged(const QString &) { 799void KPPPWidget::passwordChanged(const QString &) {
800 // store the password if so requested 800 // store the password if so requested
801 if(gpppdata.storePassword()) 801 if(PPPData::data()->storePassword())
802 gpppdata.setStoredPassword(PW_Edit->text()); 802 PPPData::data()->setStoredPassword(PW_Edit->text());
803 else 803 else
804 gpppdata.setStoredPassword(""); 804 PPPData::data()->setStoredPassword("");
805} 805}
806 806
807 807
@@ -841,7 +841,7 @@ void KPPPWidget::showNews() {
841 * Introduce the QuickHelp feature to new users of this version 841 * Introduce the QuickHelp feature to new users of this version
842 */ 842 */
843 #define QUICKHELP_HINT "Hint_QuickHelp" 843 #define QUICKHELP_HINT "Hint_QuickHelp"
844 if(gpppdata.readNumConfig(GENERAL_GRP, QUICKHELP_HINT, 0) == 0) { 844 if(PPPData::data()->readNumConfig(GENERAL_GRP, QUICKHELP_HINT, 0) == 0) {
845 QDialog dlg(0, 0, true); 845 QDialog dlg(0, 0, true);
846 dlg.setCaption(i18n("Recent Changes in KPPP")); 846 dlg.setCaption(i18n("Recent Changes in KPPP"));
847 847
@@ -893,8 +893,8 @@ void KPPPWidget::showNews() {
893 893
894 dlg.exec(); 894 dlg.exec();
895 if(cb->isChecked()) { 895 if(cb->isChecked()) {
896 gpppdata.writeConfig(GENERAL_GRP, QUICKHELP_HINT, 1); 896 PPPData::data()->writeConfig(GENERAL_GRP, QUICKHELP_HINT, 1);
897 gpppdata.save(); 897 PPPData::data()->save();
898 } 898 }
899 } 899 }
900#endif 900#endif
diff --git a/noncore/settings/networksettings/ppp/modem.cpp b/noncore/settings/networksettings/ppp/modem.cpp
index a2f77c5..cd5d21c 100644
--- a/noncore/settings/networksettings/ppp/modem.cpp
+++ b/noncore/settings/networksettings/ppp/modem.cpp
@@ -101,7 +101,7 @@ speed_t Modem::modemspeed() {
101 // convert the string modem speed int the gpppdata object to a t_speed type 101 // convert the string modem speed int the gpppdata object to a t_speed type
102 // to set the modem. The constants here should all be ifdef'd because 102 // to set the modem. The constants here should all be ifdef'd because
103 // other systems may not have them 103 // other systems may not have them
104 int i = gpppdata.speed().toInt()/100; 104 int i = PPPData::data()->speed().toInt()/100;
105 105
106 switch(i) { 106 switch(i) {
107 case 24: 107 case 24:
@@ -151,7 +151,7 @@ bool Modem::opentty() {
151 151
152//begin if((modemfd = Requester::rq->openModem(gpppdata.modemDevice()))<0) { 152//begin if((modemfd = Requester::rq->openModem(gpppdata.modemDevice()))<0) {
153 close(modemfd); 153 close(modemfd);
154// device = "/dev/modem";//deviceByIndex(request.modem.deviceNum); 154 device = PPPData::data()->modemDevice();
155 if ((modemfd = open(device, O_RDWR|O_NDELAY|O_NOCTTY)) == -1) { 155 if ((modemfd = open(device, O_RDWR|O_NDELAY|O_NOCTTY)) == -1) {
156 qDebug("error opening modem device !"); 156 qDebug("error opening modem device !");
157 errmsg = i18n("Unable to open modem."); 157 errmsg = i18n("Unable to open modem.");
@@ -161,7 +161,7 @@ bool Modem::opentty() {
161//} 161//}
162 162
163#if 0 163#if 0
164 if(gpppdata.UseCDLine()) { 164 if(PPPData::data()->UseCDLine()) {
165 if(ioctl(modemfd, TIOCMGET, &flags) == -1) { 165 if(ioctl(modemfd, TIOCMGET, &flags) == -1) {
166 errmsg = i18n("Unable to detect state of CD line."); 166 errmsg = i18n("Unable to detect state of CD line.");
167 ::close(modemfd); 167 ::close(modemfd);
@@ -209,8 +209,8 @@ bool Modem::opentty() {
209 tty.c_lflag &= ~(ECHO|ECHOE|ECHOK|ECHOKE); 209 tty.c_lflag &= ~(ECHO|ECHOE|ECHOK|ECHOKE);
210 210
211 211
212 if(gpppdata.flowcontrol() != "None") { 212 if(PPPData::data()->flowcontrol() != "None") {
213 if(gpppdata.flowcontrol() == "CRTSCTS") { 213 if(PPPData::data()->flowcontrol() == "CRTSCTS") {
214 tty.c_cflag |= CRTSCTS; 214 tty.c_cflag |= CRTSCTS;
215 } 215 }
216 else { 216 else {
@@ -339,7 +339,7 @@ bool Modem::writeLine(const char *buf) {
339 char *b = new char[len+2]; 339 char *b = new char[len+2];
340 memcpy(b, buf, len); 340 memcpy(b, buf, len);
341 // different modems seem to need different line terminations 341 // different modems seem to need different line terminations
342 QString term = gpppdata.enter(); 342 QString term = PPPData::data()->enter();
343 if(term == "LF") 343 if(term == "LF")
344 b[len++]='\n'; 344 b[len++]='\n';
345 else if(term == "CR") 345 else if(term == "CR")
@@ -379,9 +379,9 @@ bool Modem::hangup() {
379 if (data_mode) escape_to_command_mode(); 379 if (data_mode) escape_to_command_mode();
380 380
381 // Then hangup command 381 // Then hangup command
382 writeLine(gpppdata.modemHangupStr().local8Bit()); 382 writeLine(PPPData::data()->modemHangupStr().local8Bit());
383 383
384 usleep(gpppdata.modemInitDelay() * 10000); // 0.01 - 3.0 sec 384 usleep(PPPData::data()->modemInitDelay() * 10000); // 0.01 - 3.0 sec
385 385
386#ifndef DEBUG_WO_DIALING 386#ifndef DEBUG_WO_DIALING
387 if (sigsetjmp(jmp_buffer, 1) == 0) { 387 if (sigsetjmp(jmp_buffer, 1) == 0) {
@@ -417,7 +417,7 @@ bool Modem::hangup() {
417 ioctl(modemfd, TIOCMSET, &modemstat); 417 ioctl(modemfd, TIOCMSET, &modemstat);
418#endif 418#endif
419 419
420 usleep(gpppdata.modemInitDelay() * 10000); // 0.01 - 3.0 secs 420 usleep(PPPData::data()->modemInitDelay() * 10000); // 0.01 - 3.0 secs
421 421
422 cfsetospeed(&temptty, modemspeed()); 422 cfsetospeed(&temptty, modemspeed());
423 cfsetispeed(&temptty, modemspeed()); 423 cfsetispeed(&temptty, modemspeed());
@@ -440,11 +440,11 @@ void Modem::escape_to_command_mode() {
440 tcflush(modemfd, TCIOFLUSH); 440 tcflush(modemfd, TCIOFLUSH);
441 441
442 // +3 because quiet time must be greater than guard time. 442 // +3 because quiet time must be greater than guard time.
443 usleep((gpppdata.modemEscapeGuardTime()+3)*20000); 443 usleep((PPPData::data()->modemEscapeGuardTime()+3)*20000);
444 QCString tmp = gpppdata.modemEscapeStr().local8Bit(); 444 QCString tmp = PPPData::data()->modemEscapeStr().local8Bit();
445 write(modemfd, tmp.data(), tmp.length()); 445 write(modemfd, tmp.data(), tmp.length());
446 tcflush(modemfd, TCIOFLUSH); 446 tcflush(modemfd, TCIOFLUSH);
447 usleep((gpppdata.modemEscapeGuardTime()+3)*20000); 447 usleep((PPPData::data()->modemEscapeGuardTime()+3)*20000);
448 448
449 data_mode = false; 449 data_mode = false;
450} 450}
@@ -560,7 +560,7 @@ int Modem::lockdevice() {
560 int fd; 560 int fd;
561 char newlock[80]=""; // safe 561 char newlock[80]=""; // safe
562 562
563 if(!gpppdata.modemLockFile()) { 563 if(!PPPData::data()->modemLockFile()) {
564 qDebug("The user doesn't want a lockfile."); 564 qDebug("The user doesn't want a lockfile.");
565 return 0; 565 return 0;
566 } 566 }
@@ -569,7 +569,7 @@ int Modem::lockdevice() {
569 return 1; 569 return 1;
570 570
571 QString lockfile = LOCK_DIR"/LCK.."; 571 QString lockfile = LOCK_DIR"/LCK..";
572 lockfile += gpppdata.modemDevice().mid(5); // append everything after /dev/ 572 lockfile += PPPData::data()->modemDevice().mid(5); // append everything after /dev/
573 573
574 if(access(QFile::encodeName(lockfile), F_OK) == 0) { 574 if(access(QFile::encodeName(lockfile), F_OK) == 0) {
575// if ((fd = Requester::rq-> 575// if ((fd = Requester::rq->
@@ -600,7 +600,7 @@ if ((fd = openLockfile(QFile::encodeName(lockfile), O_RDONLY)) >= 0) {
600 } 600 }
601 } 601 }
602 602
603 fd = openLockfile(gpppdata.modemDevice(),O_WRONLY|O_TRUNC|O_CREAT); 603 fd = openLockfile(PPPData::data()->modemDevice(),O_WRONLY|O_TRUNC|O_CREAT);
604 if(fd >= 0) { 604 if(fd >= 0) {
605 sprintf(newlock,"%010d\n", getpid()); 605 sprintf(newlock,"%010d\n", getpid());
606 qDebug("Locking Device: %s", newlock); 606 qDebug("Locking Device: %s", newlock);
diff --git a/noncore/settings/networksettings/ppp/modemcmds.cpp b/noncore/settings/networksettings/ppp/modemcmds.cpp
index 766ba0f..65032e8 100644
--- a/noncore/settings/networksettings/ppp/modemcmds.cpp
+++ b/noncore/settings/networksettings/ppp/modemcmds.cpp
@@ -44,9 +44,6 @@ ModemCommands::ModemCommands(QWidget *parent, const char *name)
44 : QDialog(parent, name, true ) //, i18n("Edit Modem Commands") , Ok|Cancel) 44 : QDialog(parent, name, true ) //, i18n("Edit Modem Commands") , Ok|Cancel)
45{ 45{
46 setCaption(i18n("Edit Modem Commands")); 46 setCaption(i18n("Edit Modem Commands"));
47// KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon());
48 QWidget *dummyWidget = new QWidget(this);
49// setMainWidget(dummyWidget);
50 47
51 const int GRIDROWS = 22; 48 const int GRIDROWS = 22;
52 int row = 0; 49 int row = 0;
@@ -243,73 +240,73 @@ ModemCommands::ModemCommands(QWidget *parent, const char *name)
243 l1->addRowSpacing(GRIDROWS, 5); 240 l1->addRowSpacing(GRIDROWS, 5);
244 241
245 //set stuff from gpppdata 242 //set stuff from gpppdata
246 preinitslider->setValue(gpppdata.modemPreInitDelay()); 243 preinitslider->setValue(PPPData::data()->modemPreInitDelay());
247 lpreinitslider->setNum(gpppdata.modemPreInitDelay()); 244 lpreinitslider->setNum(PPPData::data()->modemPreInitDelay());
248 for(int i = 0; i < PPPData::NumInitStrings; i++) 245 for(int i = 0; i < PPPData::NumInitStrings; i++)
249 initstr[i]->setText(gpppdata.modemInitStr(i)); 246 initstr[i]->setText(PPPData::data()->modemInitStr(i));
250 initslider->setValue(gpppdata.modemInitDelay()); 247 initslider->setValue(PPPData::data()->modemInitDelay());
251 linitslider->setNum(gpppdata.modemInitDelay()); 248 linitslider->setNum(PPPData::data()->modemInitDelay());
252 initresp->setText(gpppdata.modemInitResp()); 249 initresp->setText(PPPData::data()->modemInitResp());
253 250
254 durationslider->setValue(gpppdata.modemToneDuration()); 251 durationslider->setValue(PPPData::data()->modemToneDuration());
255 ldurationslider->setNum(gpppdata.modemToneDuration()); 252 ldurationslider->setNum(PPPData::data()->modemToneDuration());
256 253
257 nodetectdialtone->setText(gpppdata.modemNoDialToneDetectionStr()); 254 nodetectdialtone->setText(PPPData::data()->modemNoDialToneDetectionStr());
258 dialstr->setText(gpppdata.modemDialStr()); 255 dialstr->setText(PPPData::data()->modemDialStr());
259 connectresp->setText(gpppdata.modemConnectResp()); 256 connectresp->setText(PPPData::data()->modemConnectResp());
260 busyresp->setText(gpppdata.modemBusyResp()); 257 busyresp->setText(PPPData::data()->modemBusyResp());
261 nocarrierresp->setText(gpppdata.modemNoCarrierResp()); 258 nocarrierresp->setText(PPPData::data()->modemNoCarrierResp());
262 nodialtoneresp->setText(gpppdata.modemNoDialtoneResp()); 259 nodialtoneresp->setText(PPPData::data()->modemNoDialtoneResp());
263 260
264 escapestr->setText(gpppdata.modemEscapeStr()); 261 escapestr->setText(PPPData::data()->modemEscapeStr());
265 escaperesp->setText(gpppdata.modemEscapeResp()); 262 escaperesp->setText(PPPData::data()->modemEscapeResp());
266 263
267 hangupstr->setText(gpppdata.modemHangupStr()); 264 hangupstr->setText(PPPData::data()->modemHangupStr());
268 hangupresp->setText(gpppdata.modemHangupResp()); 265 hangupresp->setText(PPPData::data()->modemHangupResp());
269 266
270 answerstr->setText(gpppdata.modemAnswerStr()); 267 answerstr->setText(PPPData::data()->modemAnswerStr());
271 ringresp->setText(gpppdata.modemRingResp()); 268 ringresp->setText(PPPData::data()->modemRingResp());
272 answerresp->setText(gpppdata.modemAnswerResp()); 269 answerresp->setText(PPPData::data()->modemAnswerResp());
273 270
274 slider->setValue(gpppdata.modemEscapeGuardTime()); 271 slider->setValue(PPPData::data()->modemEscapeGuardTime());
275 lslider->setNum(gpppdata.modemEscapeGuardTime()); 272 lslider->setNum(PPPData::data()->modemEscapeGuardTime());
276 273
277 volume_off->setText(gpppdata.volumeOff()); 274 volume_off->setText(PPPData::data()->volumeOff());
278 volume_medium->setText(gpppdata.volumeMedium()); 275 volume_medium->setText(PPPData::data()->volumeMedium());
279 volume_high->setText(gpppdata.volumeHigh()); 276 volume_high->setText(PPPData::data()->volumeHigh());
280} 277}
281 278
282 279
283void ModemCommands::slotOk() { 280void ModemCommands::slotOk() {
284 gpppdata.setModemPreInitDelay(lpreinitslider->text().toInt()); 281 PPPData::data()->setModemPreInitDelay(lpreinitslider->text().toInt());
285 for(int i = 0; i < PPPData::NumInitStrings; i++) 282 for(int i = 0; i < PPPData::NumInitStrings; i++)
286 gpppdata.setModemInitStr(i, initstr[i]->text()); 283 PPPData::data()->setModemInitStr(i, initstr[i]->text());
287 gpppdata.setModemInitResp(initresp->text()); 284 PPPData::data()->setModemInitResp(initresp->text());
288 gpppdata.setModemInitDelay(linitslider->text().toInt()); 285 PPPData::data()->setModemInitDelay(linitslider->text().toInt());
289 286
290 gpppdata.setModemToneDuration(ldurationslider->text().toInt()); 287 PPPData::data()->setModemToneDuration(ldurationslider->text().toInt());
291 gpppdata.setModemNoDialToneDetectionStr(nodetectdialtone->text()); 288 PPPData::data()->setModemNoDialToneDetectionStr(nodetectdialtone->text());
292 gpppdata.setModemDialStr(dialstr->text()); 289 PPPData::data()->setModemDialStr(dialstr->text());
293 gpppdata.setModemConnectResp(connectresp->text()); 290 PPPData::data()->setModemConnectResp(connectresp->text());
294 gpppdata.setModemBusyResp(busyresp->text()); 291 PPPData::data()->setModemBusyResp(busyresp->text());
295 gpppdata.setModemNoCarrierResp(nocarrierresp->text()); 292 PPPData::data()->setModemNoCarrierResp(nocarrierresp->text());
296 gpppdata.setModemNoDialtoneResp(nodialtoneresp->text()); 293 PPPData::data()->setModemNoDialtoneResp(nodialtoneresp->text());
297 294
298 gpppdata.setModemEscapeStr(escapestr->text()); 295 PPPData::data()->setModemEscapeStr(escapestr->text());
299 gpppdata.setModemEscapeResp(escaperesp->text()); 296 PPPData::data()->setModemEscapeResp(escaperesp->text());
300 gpppdata.setModemEscapeGuardTime(lslider->text().toInt()); 297 PPPData::data()->setModemEscapeGuardTime(lslider->text().toInt());
301 gpppdata.setModemHangupStr(hangupstr->text()); 298 PPPData::data()->setModemHangupStr(hangupstr->text());
302 gpppdata.setModemHangupResp(hangupresp->text()); 299 PPPData::data()->setModemHangupResp(hangupresp->text());
303 300
304 gpppdata.setModemAnswerStr(answerstr->text()); 301 PPPData::data()->setModemAnswerStr(answerstr->text());
305 gpppdata.setModemRingResp(ringresp->text()); 302 PPPData::data()->setModemRingResp(ringresp->text());
306 gpppdata.setModemAnswerResp(answerresp->text()); 303 PPPData::data()->setModemAnswerResp(answerresp->text());
307 304
308 gpppdata.setVolumeHigh(volume_high->text()); 305 PPPData::data()->setVolumeHigh(volume_high->text());
309 gpppdata.setVolumeMedium(volume_medium->text()); 306 PPPData::data()->setVolumeMedium(volume_medium->text());
310 gpppdata.setVolumeOff(volume_off->text()); 307 PPPData::data()->setVolumeOff(volume_off->text());
311 308
312 gpppdata.save(); 309 PPPData::data()->save();
313 accept(); 310 accept();
314} 311}
315 312
diff --git a/noncore/settings/networksettings/ppp/newwidget.cpp b/noncore/settings/networksettings/ppp/newwidget.cpp
deleted file mode 100644
index d2182fb..0000000
--- a/noncore/settings/networksettings/ppp/newwidget.cpp
+++ b/dev/null
@@ -1,17 +0,0 @@
1/////////////////////////////////////////////////////////////////////////////
2//
3// functions generating layout-aware widgets
4//
5/////////////////////////////////////////////////////////////////////////////
6
7#include "newwidget.h"
8
9QLineEdit *newLineEdit(int visiblewidth, QWidget *parent) {
10 QLineEdit *l = new QLineEdit(parent);
11 if(visiblewidth == 0)
12 l->setMinimumWidth(l->sizeHint().width());
13 else
14 l->setFixedWidth(l->fontMetrics().width('H') * visiblewidth);
15
16 return l;
17}
diff --git a/noncore/settings/networksettings/ppp/newwidget.h b/noncore/settings/networksettings/ppp/newwidget.h
deleted file mode 100644
index 52f2ec7..0000000
--- a/noncore/settings/networksettings/ppp/newwidget.h
+++ b/dev/null
@@ -1,19 +0,0 @@
1/////////////////////////////////////////////////////////////////////////////
2//
3// functions generating layout-aware widgets
4//
5/////////////////////////////////////////////////////////////////////////////
6
7#ifndef __NEWWIDGET__H__
8#define __NEWWIDGET__H__
9
10#include <qwidget.h>
11#include <qlineedit.h>
12
13#define L_FIXEDW 1
14#define L_FIXEDH 2
15#define L_FIXED (L_FIXEDW | L_FIXEDH)
16
17QLineEdit *newLineEdit(int visiblewidth, QWidget *parent);
18
19#endif
diff --git a/noncore/settings/networksettings/ppp/ppp.pro b/noncore/settings/networksettings/ppp/ppp.pro
index a456427..ebfc713 100644
--- a/noncore/settings/networksettings/ppp/ppp.pro
+++ b/noncore/settings/networksettings/ppp/ppp.pro
@@ -4,8 +4,8 @@ TEMPLATE = lib
4#CONFIG += qt warn_on release 4#CONFIG += qt warn_on release
5 CONFIG += qt warn_on debug 5 CONFIG += qt warn_on debug
6DESTDIR = $(OPIEDIR)/plugins/networksettings 6DESTDIR = $(OPIEDIR)/plugins/networksettings
7 HEADERS = pppmodule.h devices.h modem.h modeminfo.h pppdata.h kpppconfig.h pppdata.h runtests.h general.h modemcmds.h knuminput.h knumvalidator.h kpppwidget.h conwindow.h debug.h accounts.h connect.h edit.h scriptedit.h pppdargs.h newwidget.h iplined.h pwentry.h pppconfig.h 7 HEADERS = pppmodule.h devices.h modem.h modeminfo.h pppdata.h kpppconfig.h pppdata.h runtests.h general.h modemcmds.h knuminput.h knumvalidator.h kpppwidget.h conwindow.h debug.h accounts.h connect.h edit.h scriptedit.h pppdargs.h iplined.h pwentry.h pppconfig.h
8 SOURCES = pppmodule.cpp modem.cpp modeminfo.cpp pppdata.cpp runtests.cpp general.cpp modemcmds.cpp knuminput.cpp knumvalidator.cpp kpppwidget.cpp conwindow.cpp debug.cpp accounts.cpp connect.cpp edit.cpp scriptedit.cpp pppdargs.cpp newwidget.cpp iplined.cpp pwentry.cpp pppconfig.cpp 8 SOURCES = pppmodule.cpp modem.cpp modeminfo.cpp pppdata.cpp runtests.cpp general.cpp modemcmds.cpp knuminput.cpp knumvalidator.cpp kpppwidget.cpp conwindow.cpp debug.cpp accounts.cpp connect.cpp edit.cpp scriptedit.cpp pppdargs.cpp iplined.cpp pwentry.cpp pppconfig.cpp
9 INCLUDEPATH+= $(OPIEDIR)/include ../ ../interfaces/ 9 INCLUDEPATH+= $(OPIEDIR)/include ../ ../interfaces/
10 DEPENDPATH+= $(OPIEDIR)/include 10 DEPENDPATH+= $(OPIEDIR)/include
11LIBS += -lqpe -L../interfaces/ -linterfaces 11LIBS += -lqpe -L../interfaces/ -linterfaces
diff --git a/noncore/settings/networksettings/ppp/pppconfig.cpp b/noncore/settings/networksettings/ppp/pppconfig.cpp
index 7b2b21b..c0f1fef 100644
--- a/noncore/settings/networksettings/ppp/pppconfig.cpp
+++ b/noncore/settings/networksettings/ppp/pppconfig.cpp
@@ -50,13 +50,13 @@ PPPConfigWidget::~PPPConfigWidget()
50 50
51void PPPConfigWidget::accept() 51void PPPConfigWidget::accept()
52{ 52{
53 gpppdata.save(); 53 PPPData::data()->save();
54 QDialog::accept(); 54 QDialog::accept();
55} 55}
56 56
57 57
58void PPPConfigWidget::reject() 58void PPPConfigWidget::reject()
59{ 59{
60 gpppdata.cancel(); 60 PPPData::data()->cancel();
61 QDialog::reject(); 61 QDialog::reject();
62} 62}
diff --git a/noncore/settings/networksettings/ppp/pppdargs.cpp b/noncore/settings/networksettings/ppp/pppdargs.cpp
index 04d0dd0..b7fca3f 100644
--- a/noncore/settings/networksettings/ppp/pppdargs.cpp
+++ b/noncore/settings/networksettings/ppp/pppdargs.cpp
@@ -121,14 +121,14 @@ void PPPdArguments::removebutton() {
121void PPPdArguments::defaultsbutton() { 121void PPPdArguments::defaultsbutton() {
122 // all of this is a hack 122 // all of this is a hack
123 // save current list 123 // save current list
124 QStringList arglist(gpppdata.pppdArgument()); 124 QStringList arglist(PPPData::data()->pppdArgument());
125 125
126 // get defaults 126 // get defaults
127 gpppdata.setpppdArgumentDefaults(); 127 PPPData::data()->setpppdArgumentDefaults();
128 init(); 128 init();
129 129
130 // restore old list 130 // restore old list
131 gpppdata.setpppdArgument(arglist); 131 PPPData::data()->setpppdArgument(arglist);
132} 132}
133 133
134 134
@@ -136,7 +136,7 @@ void PPPdArguments::closebutton() {
136 QStringList arglist; 136 QStringList arglist;
137 for(uint i=0; i < arguments->count(); i++) 137 for(uint i=0; i < arguments->count(); i++)
138 arglist.append(arguments->text(i)); 138 arglist.append(arguments->text(i));
139 gpppdata.setpppdArgument(arglist); 139 PPPData::data()->setpppdArgument(arglist);
140 140
141 done(0); 141 done(0);
142} 142}
@@ -146,7 +146,7 @@ void PPPdArguments::init() {
146 while(arguments->count()) 146 while(arguments->count())
147 arguments->removeItem(0); 147 arguments->removeItem(0);
148 148
149 QStringList &arglist = gpppdata.pppdArgument(); 149 QStringList &arglist = PPPData::data()->pppdArgument();
150 for ( QStringList::Iterator it = arglist.begin(); 150 for ( QStringList::Iterator it = arglist.begin();
151 it != arglist.end(); 151 it != arglist.end();
152 ++it ) 152 ++it )
diff --git a/noncore/settings/networksettings/ppp/pppdata.cpp b/noncore/settings/networksettings/ppp/pppdata.cpp
index f2386fc..646facd 100644
--- a/noncore/settings/networksettings/ppp/pppdata.cpp
+++ b/noncore/settings/networksettings/ppp/pppdata.cpp
@@ -38,11 +38,24 @@
38// #include <kapplication.h> 38// #include <kapplication.h>
39#include <assert.h> 39#include <assert.h>
40 40
41PPPData gpppdata; 41PPPData *PPPData::_data = 0;
42Config *PPPData::config = 0;
42 43
44PPPData* PPPData::data()
45{
46 if (!_data){
47 qDebug("PPPData::data() creates new Instance");
48 _data = new PPPData();
49 }
50 if (!_data->config){
51 qDebug("PPPData::data() opens conffile");
52 _data->open();
53 }
54 return _data;
55}
43 56
44PPPData::PPPData() 57PPPData::PPPData()
45 : config(0L), 58 : //config(0L),
46 highcount(-1), // start out with no entries 59 highcount(-1), // start out with no entries
47 caccount(-1), // set the current account index also 60 caccount(-1), // set the current account index also
48 suidprocessid(-1), // process ID of setuid child 61 suidprocessid(-1), // process ID of setuid child
@@ -56,25 +69,9 @@ PPPData::PPPData()
56// open configuration file 69// open configuration file
57// 70//
58bool PPPData::open() { 71bool PPPData::open() {
59 72 qDebug("opening configfile NetworkSetupPPP");
60 config = new Config("NetworkSetup"); 73 if (config) return true;
61 /* 74 config = new Config("NetworkSetupPPP");
62 config = kapp->config();
63
64 if (config->getConfigState() == KConfig::NoAccess) {
65 KMessageBox::error(0L,
66 i18n("The application-specific config file could not "
67 "be opened in either read-write or read-only mode.\n"
68 "The superuser might have to change its ownership "
69 "by issuing the following command in your home directory:\n"
70 "chown {YourUsername} .kde/share/config/kppprc"),
71 kapp->name());
72 return false;
73 }
74
75 // don't expand shell variables
76 config->setDollarExpansion(false);
77 */
78 75
79 highcount = readNumConfig(GENERAL_GRP, NUMACCOUNTS_KEY, 0) - 1; 76 highcount = readNumConfig(GENERAL_GRP, NUMACCOUNTS_KEY, 0) - 1;
80 77
@@ -104,7 +101,13 @@ void PPPData::save() {
104 101
105 if (config) { 102 if (config) {
106 writeConfig(GENERAL_GRP, NUMACCOUNTS_KEY, count()); 103 writeConfig(GENERAL_GRP, NUMACCOUNTS_KEY, count());
107// config->sync(); 104 delete config;
105 config = 0;
106 qDebug("worte confi NetworkSetupPPP");
107 }
108 if (_data){
109 delete _data;
110 _data = 0;
108 } 111 }
109 112
110} 113}
@@ -123,17 +126,18 @@ void PPPData::cancel() {
123} 126}
124 127
125 128
126// currently differentiates between READWRITE and NONE only 129// // currently differentiates between READWRITE and NONE only
127int PPPData::access() const { 130// int PPPData::access() const {
128 131
129 return 0;//config->getConfigState(); 132// return 1;//config->getConfigState();
130} 133// }
131 134
132 135
133// functions to read/write date to configuration file 136// functions to read/write date to configuration file
134QString PPPData::readConfig(const QString &group, const QString &key, 137QString PPPData::readConfig(const QString &group, const QString &key,
135 const QString &defvalue = "") 138 const QString &defvalue = "")
136{ 139{
140// qDebug("PPPData::readConfig key >%s< group >%s<",key.latin1(), group.latin1());
137 if (config) { 141 if (config) {
138 config->setGroup(group); 142 config->setGroup(group);
139 return config->readEntry(key, defvalue); 143 return config->readEntry(key, defvalue);
@@ -718,14 +722,14 @@ bool PPPData::isUniqueAccname(const QString &n) {
718 722
719 723
720bool PPPData::deleteAccount() { 724bool PPPData::deleteAccount() {
721 if(caccount < 0) 725 //FIXME:
726// if(caccount < 0)
722 return false; 727 return false;
723 728
724// QMap <QString, QString> map; 729// QMap <QString, QString> map;
725// QMap <QString, QString>::Iterator it; 730// QMap <QString, QString>::Iterator it;
726 731
727 // set all entries of the current account to "" 732// // set all entries of the current account to ""
728// tille: do not handle the accounts here... (?)
729// map = config->entryMap(cgroup); 733// map = config->entryMap(cgroup);
730// it = map.begin(); 734// it = map.begin();
731// while (it != map.end()) { 735// while (it != map.end()) {
@@ -756,13 +760,13 @@ bool PPPData::deleteAccount() {
756// it++; 760// it++;
757// } 761// }
758 762
759 highcount--; 763// highcount--;
760 if(caccount > highcount) 764// if(caccount > highcount)
761 caccount = highcount; 765// caccount = highcount;
762 766
763 setAccountbyIndex(caccount); 767// setAccountbyIndex(caccount);
764 768
765 return true; 769// return true;
766} 770}
767 771
768 772
@@ -778,39 +782,40 @@ bool PPPData::deleteAccount(const QString &aname) {
778 782
779int PPPData::newaccount() { 783int PPPData::newaccount() {
780 784
781 if(!config || highcount >= MAX_ACCOUNTS) 785 qDebug("PPPData::newaccount highcount %i/%i",highcount,MAX_ACCOUNTS);
782 return -1; 786 if(!config) open();
787 if (highcount >= MAX_ACCOUNTS) return -1;
783 788
784 highcount++; 789 highcount++;
785 setAccountbyIndex(highcount); 790 setAccountbyIndex(highcount);
786 791
787 setpppdArgumentDefaults(); 792 setpppdArgumentDefaults();
788 793 qDebug("PPPData::newaccount -> %i",caccount);
789 return caccount; 794 return caccount;
790} 795}
791 796
792int PPPData::copyaccount(int i) { 797int PPPData::copyaccount(int i) {
793 798
794 if(highcount >= MAX_ACCOUNTS) 799// if(highcount >= MAX_ACCOUNTS)
795 return -1; 800 return -1;
796 801
797 setAccountbyIndex(i); 802// setAccountbyIndex(i);
798 803
799// QMap <QString, QString> map = config->entryMap(cgroup); 804// QMap <QString, QString> map = config->entryMap(cgroup);
800// QMap <QString, QString>::ConstIterator it = map.begin(); 805// QMap <QString, QString>::ConstIterator it = map.begin();
801 806
802 QString newname = i18n("%1_copy").arg(accname()); 807// QString newname = i18n("%1_copy").arg(accname());
803 808
804 newaccount(); 809// newaccount();
805 810
806// while (it != map.end()) { 811// while (it != map.end()) {
807// config->writeEntry(it.key(), *it); 812// config->writeEntry(it.key(), *it);
808// it++; 813// it++;
809// } 814// }
810 815
811 setAccname(newname); 816// setAccname(newname);
812 817
813 return caccount; 818// return caccount;
814} 819}
815 820
816 821
@@ -829,7 +834,7 @@ void PPPData::setAccname(const QString &n) {
829} 834}
830 835
831 836
832#define SEPARATOR_CHAR ':' 837#define SEPARATOR_CHAR '&'
833QStringList &PPPData::phonenumbers() { 838QStringList &PPPData::phonenumbers() {
834 839
835 readListConfig(cgroup, PHONENUMBER_KEY, phonelist, SEPARATOR_CHAR); 840 readListConfig(cgroup, PHONENUMBER_KEY, phonelist, SEPARATOR_CHAR);
@@ -1011,7 +1016,7 @@ void PPPData::setDefaultroute(bool set) {
1011 1016
1012bool PPPData::autoDNS() { 1017bool PPPData::autoDNS() {
1013 bool set = (bool) readNumConfig(cgroup, AUTODNS_KEY, true); 1018 bool set = (bool) readNumConfig(cgroup, AUTODNS_KEY, true);
1014 return (set && gpppdata.pppdVersionMin(2, 3, 7)); 1019 return (set && PPPData::data()->pppdVersionMin(2, 3, 7));
1015} 1020}
1016 1021
1017 1022
@@ -1139,49 +1144,49 @@ void PPPData::setpppdArgumentDefaults() {
1139} 1144}
1140 1145
1141 1146
1142// graphing widget 1147// // graphing widget
1143void PPPData::setGraphingOptions(bool enable, 1148// void PPPData::setGraphingOptions(bool enable,
1144 QColor bg, 1149 // QColor bg,
1145 QColor text, 1150 // QColor text,
1146 QColor in, 1151 // QColor in,
1147 QColor out) 1152 // QColor out)
1148{ 1153// {
1149 if(config) { 1154// if(config) {
1150 config->setGroup(GRAPH_GRP); 1155// config->setGroup(GRAPH_GRP);
1151 config->writeEntry(GENABLED, enable); 1156// config->writeEntry(GENABLED, enable);
1152// config->writeEntry(GCOLOR_BG, bg); 1157// // config->writeEntry(GCOLOR_BG, bg);
1153// config->writeEntry(GCOLOR_TEXT, text); 1158// // config->writeEntry(GCOLOR_TEXT, text);
1154// config->writeEntry(GCOLOR_IN, in); 1159// // config->writeEntry(GCOLOR_IN, in);
1155// config->writeEntry(GCOLOR_OUT, out); 1160// // config->writeEntry(GCOLOR_OUT, out);
1156 } 1161// }
1157} 1162// }
1158 1163
1159void PPPData::graphingOptions(bool &enable, 1164// void PPPData::graphingOptions(bool &enable,
1160 QColor &bg, 1165 // QColor &bg,
1161 QColor &text, 1166 // QColor &text,
1162 QColor &in, 1167 // QColor &in,
1163 QColor &out) 1168 // QColor &out)
1164{ 1169// {
1165 QColor c; 1170// QColor c;
1166 1171
1167 if(config) { 1172// if(config) {
1168 config->setGroup(GRAPH_GRP); 1173// config->setGroup(GRAPH_GRP);
1169 enable = config->readBoolEntry(GENABLED, true); 1174// enable = config->readBoolEntry(GENABLED, true);
1170 bg = Qt::white; 1175// bg = Qt::white;
1171 //bg = config->readColorEntry(GCOLOR_BG, &c); 1176// //bg = config->readColorEntry(GCOLOR_BG, &c);
1172 text = Qt::black; 1177// text = Qt::black;
1173 //text = config->readColorEntry(GCOLOR_TEXT, &c); 1178// //text = config->readColorEntry(GCOLOR_TEXT, &c);
1174 in = Qt::blue; 1179// in = Qt::blue;
1175 //in = config->readColorEntry(GCOLOR_IN, &c); 1180// //in = config->readColorEntry(GCOLOR_IN, &c);
1176 out = Qt::red; 1181// out = Qt::red;
1177 //out = config->readColorEntry(GCOLOR_OUT, &c); 1182// //out = config->readColorEntry(GCOLOR_OUT, &c);
1178 } 1183// }
1179} 1184// }
1180 1185
1181 1186
1182bool PPPData::graphingEnabled() { 1187// bool PPPData::graphingEnabled() {
1183 return (bool) readNumConfig(GRAPH_GRP, GENABLED, true); 1188// return (bool) readNumConfig(GRAPH_GRP, GENABLED, true);
1184} 1189// }
1185 1190
1186 1191
1187 1192
@@ -1205,25 +1210,25 @@ void PPPData::setpppdError(int err) {
1205} 1210}
1206 1211
1207 1212
1208// 1213// //
1209// window position 1214// // window position
1210// 1215// //
1211void PPPData::winPosConWin(int& p_x, int& p_y) { 1216// void PPPData::winPosConWin(int& p_x, int& p_y) {
1212 p_x = readNumConfig(WINPOS_GRP, WINPOS_CONWIN_X, QApplication::desktop()->width()/2-160); 1217// p_x = readNumConfig(WINPOS_GRP, WINPOS_CONWIN_X, QApplication::desktop()->width()/2-160);
1213 p_y = readNumConfig(WINPOS_GRP, WINPOS_CONWIN_Y, QApplication::desktop()->height()/2-55); 1218// p_y = readNumConfig(WINPOS_GRP, WINPOS_CONWIN_Y, QApplication::desktop()->height()/2-55);
1214} 1219// }
1215 1220
1216void PPPData::setWinPosConWin(int p_x, int p_y) { 1221// void PPPData::setWinPosConWin(int p_x, int p_y) {
1217 writeConfig(WINPOS_GRP, WINPOS_CONWIN_X, p_x); 1222// writeConfig(WINPOS_GRP, WINPOS_CONWIN_X, p_x);
1218 writeConfig(WINPOS_GRP, WINPOS_CONWIN_Y, p_y); 1223// writeConfig(WINPOS_GRP, WINPOS_CONWIN_Y, p_y);
1219} 1224// }
1220 1225
1221void PPPData::winPosStatWin(int& p_x, int& p_y) { 1226// void PPPData::winPosStatWin(int& p_x, int& p_y) {
1222 p_x = readNumConfig(WINPOS_GRP, WINPOS_STATWIN_X, QApplication::desktop()->width()/2-160); 1227// p_x = readNumConfig(WINPOS_GRP, WINPOS_STATWIN_X, QApplication::desktop()->width()/2-160);
1223 p_y = readNumConfig(WINPOS_GRP, WINPOS_STATWIN_Y, QApplication::desktop()->height()/2-55); 1228// p_y = readNumConfig(WINPOS_GRP, WINPOS_STATWIN_Y, QApplication::desktop()->height()/2-55);
1224} 1229// }
1225 1230
1226void PPPData::setWinPosStatWin(int p_x, int p_y) { 1231// void PPPData::setWinPosStatWin(int p_x, int p_y) {
1227 writeConfig(WINPOS_GRP, WINPOS_STATWIN_X, p_x); 1232// writeConfig(WINPOS_GRP, WINPOS_STATWIN_X, p_x);
1228 writeConfig(WINPOS_GRP, WINPOS_STATWIN_Y, p_y); 1233// writeConfig(WINPOS_GRP, WINPOS_STATWIN_Y, p_y);
1229} 1234// }
diff --git a/noncore/settings/networksettings/ppp/pppdata.h b/noncore/settings/networksettings/ppp/pppdata.h
index e286b70..57ce2fd 100644
--- a/noncore/settings/networksettings/ppp/pppdata.h
+++ b/noncore/settings/networksettings/ppp/pppdata.h
@@ -55,11 +55,11 @@ class Config;
55// 55//
56 56
57// groups 57// groups
58#define GENERAL_GRP "General" 58#define GENERAL_GRP "PPP_General"
59#define MODEM_GRP "Modem" 59#define MODEM_GRP "PPP_Modem"
60#define ACCOUNT_GRP "Account" 60#define ACCOUNT_GRP "PPP_Account"
61#define GRAPH_GRP "Graph" 61//#define GRAPH_GRP "Graph"
62#define WINPOS_GRP "WindowPosition" 62//#define WINPOS_GRP "WindowPosition"
63 63
64// general 64// general
65#define DEFAULTACCOUNT_KEY "DefaultAccount" 65#define DEFAULTACCOUNT_KEY "DefaultAccount"
@@ -161,6 +161,7 @@ class PPPData {
161public: 161public:
162 PPPData(); 162 PPPData();
163 ~PPPData() {}; 163 ~PPPData() {};
164 static PPPData* data();
164 165
165 enum { NumInitStrings = 2 }; 166 enum { NumInitStrings = 2 };
166 167
@@ -168,7 +169,7 @@ public:
168 bool open(); 169 bool open();
169 void save(); 170 void save();
170 void cancel(); 171 void cancel();
171 int access() const; // read/write access 172// int access() const; // read/write access
172 173
173 // function to read/write date to configuration file 174 // function to read/write date to configuration file
174 QString readConfig(const QString &, const QString &, const QString &); 175 QString readConfig(const QString &, const QString &, const QString &);
@@ -426,28 +427,31 @@ public:
426 int totalBytes(); 427 int totalBytes();
427 void setTotalBytes(int); 428 void setTotalBytes(int);
428 429
429 // graphing widget 430// // graphing widget
430 void setGraphingOptions(bool enabled, 431// void setGraphingOptions(bool enabled,
431 QColor bg, 432 // QColor bg,
432 QColor text, 433 // QColor text,
433 QColor in, 434 // QColor in,
434 QColor out); 435 // QColor out);
435 void graphingOptions(bool &enabled, 436// void graphingOptions(bool &enabled,
436 QColor &bg, 437 // QColor &bg,
437 QColor &text, 438 // QColor &text,
438 QColor &in, 439 // QColor &in,
439 QColor &out); 440 // QColor &out);
440 bool graphingEnabled(); 441// bool graphingEnabled();
441 442
442 // window positions 443// // window positions
443 void winPosConWin(int &, int &); 444// void winPosConWin(int &, int &);
444 void setWinPosConWin(int, int); 445// void setWinPosConWin(int, int);
445 void winPosStatWin(int &, int &); 446// void winPosStatWin(int &, int &);
446 void setWinPosStatWin(int, int); 447// void setWinPosStatWin(int, int);
447 448
448private: 449private:
450
451 static PPPData *_data;
452
449 QString passwd; 453 QString passwd;
450 Config* config; // configuration object 454 static Config* config; // configuration object
451 int highcount; // index of highest account 455 int highcount; // index of highest account
452 int caccount; // index of the current account 456 int caccount; // index of the current account
453 QString cgroup; // name of current config group 457 QString cgroup; // name of current config group
@@ -460,6 +464,4 @@ private:
460 QStringList phonelist; 464 QStringList phonelist;
461}; 465};
462 466
463extern PPPData gpppdata;
464
465#endif 467#endif
diff --git a/noncore/settings/networksettings/ppp/pppmodule.cpp b/noncore/settings/networksettings/ppp/pppmodule.cpp
index d6ca88a..da17e26 100644
--- a/noncore/settings/networksettings/ppp/pppmodule.cpp
+++ b/noncore/settings/networksettings/ppp/pppmodule.cpp
@@ -1,6 +1,6 @@
1#include "pppconfig.h" 1#include "pppconfig.h"
2#include "pppmodule.h" 2#include "pppmodule.h"
3//#include "pppimp.h" 3#include "pppdata.h"
4#include "kpppwidget.h" 4#include "kpppwidget.h"
5#include "interfaceinformationimp.h" 5#include "interfaceinformationimp.h"
6//#include "devices.h" 6//#include "devices.h"
@@ -98,6 +98,7 @@ Interface *PPPModule::addNewInterface(const QString &newInterface){
98 if(imp.exec() == QDialog::Accepted ){ 98 if(imp.exec() == QDialog::Accepted ){
99 qDebug("ACCEPTED"); 99 qDebug("ACCEPTED");
100 return new Interface( 0, newInterface ); 100 return new Interface( 0, newInterface );
101 PPPData::data()->save();
101 } 102 }
102 return NULL; 103 return NULL;
103} 104}