author | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
commit | 16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 (patch) (unidiff) | |
tree | 0701eae15aa606a0211a2fccfde0eafdac69357c /noncore/settings/networksettings/ppp/kpppwidget.cpp | |
parent | 8d2d2664e5f544b8292806e617deb7a0e4170dc0 (diff) | |
download | opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.zip opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.gz opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.bz2 |
convert to Opie Debugging Framework
Diffstat (limited to 'noncore/settings/networksettings/ppp/kpppwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/kpppwidget.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/noncore/settings/networksettings/ppp/kpppwidget.cpp b/noncore/settings/networksettings/ppp/kpppwidget.cpp index e21bbc7..fd09332 100644 --- a/noncore/settings/networksettings/ppp/kpppwidget.cpp +++ b/noncore/settings/networksettings/ppp/kpppwidget.cpp | |||
@@ -65,31 +65,31 @@ | |||
65 | #define execute_command system | 65 | #define execute_command system |
66 | 66 | ||
67 | KPPPWidget *p_kppp = 0; | 67 | KPPPWidget *p_kppp = 0; |
68 | 68 | ||
69 | KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *name, bool modal, WFlags fl ) | 69 | KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *name, bool modal, WFlags fl ) |
70 | : QDialog(parent, name, modal, Qt::WStyle_ContextHelp ), _pppdata(pd) | 70 | : QDialog(parent, name, modal, Qt::WStyle_ContextHelp ), _pppdata(pd) |
71 | { | 71 | { |
72 | // tabWindow = 0; | 72 | // tabWindow = 0; |
73 | p_kppp = this; | 73 | p_kppp = this; |
74 | // before doing anything else, run a few tests | 74 | // before doing anything else, run a few tests |
75 | if (!_pppdata->setModemDevice( i->getInterfaceName() )) | 75 | if (!_pppdata->setModemDevice( i->getInterfaceName() )) |
76 | _pppdata->setModemDevice("/dev/modem"); | 76 | _pppdata->setModemDevice("/dev/modem"); |
77 | qDebug("PPPConfigWidget::PPPConfigWidget"); | 77 | odebug << "PPPConfigWidget::PPPConfigWidget" << oendl; |
78 | qDebug(" interface->getHardwareName >%s<", i->getHardwareName().latin1()); | 78 | odebug << " interface->getHardwareName >" << i->getHardwareName().latin1() << "<" << oendl; |
79 | if (!_pppdata->setAccount( i->getHardwareName() )) | 79 | if (!_pppdata->setAccount( i->getHardwareName() )) |
80 | _pppdata->setAccount( 0 ); | 80 | _pppdata->setAccount( 0 ); |
81 | 81 | ||
82 | qDebug(" _pppdata->accname >%s<",_pppdata->accname().latin1()); | 82 | odebug << " _pppdata->accname >" << _pppdata->accname().latin1() << "<" << oendl; |
83 | qDebug(" _pppdata->currentAccountID() >%i<",_pppdata->currentAccountID()); | 83 | odebug << " _pppdata->currentAccountID() >" << _pppdata->currentAccountID() << "<" << oendl; |
84 | 84 | ||
85 | int result = runTests(); | 85 | int result = runTests(); |
86 | if(result == TEST_CRITICAL) | 86 | if(result == TEST_CRITICAL) |
87 | exit(4); | 87 | exit(4); |
88 | 88 | ||
89 | // installEventFilter(this); | 89 | // installEventFilter(this); |
90 | 90 | ||
91 | QVBoxLayout *tl = new QVBoxLayout(this, 10, 10); | 91 | QVBoxLayout *tl = new QVBoxLayout(this, 10, 10); |
92 | 92 | ||
93 | QGridLayout *l1 = new QGridLayout(3, 4); | 93 | QGridLayout *l1 = new QGridLayout(3, 4); |
94 | tl->addLayout(l1); | 94 | tl->addLayout(l1); |
95 | l1->addColSpacing(0, 10); | 95 | l1->addColSpacing(0, 10); |
@@ -296,25 +296,25 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na | |||
296 | } | 296 | } |
297 | 297 | ||
298 | KPPPWidget::~KPPPWidget() | 298 | KPPPWidget::~KPPPWidget() |
299 | { | 299 | { |
300 | p_kppp = 0; | 300 | p_kppp = 0; |
301 | // delete stats; | 301 | // delete stats; |
302 | } | 302 | } |
303 | 303 | ||
304 | // bool KPPPWidget::eventFilter(QObject *o, QEvent *e) { | 304 | // bool KPPPWidget::eventFilter(QObject *o, QEvent *e) { |
305 | // if(e->type() == QEvent::User) { | 305 | // if(e->type() == QEvent::User) { |
306 | // switch(((SignalEvent*)e)->sigType()) { | 306 | // switch(((SignalEvent*)e)->sigType()) { |
307 | // case SIGINT: | 307 | // case SIGINT: |
308 | // qDebug( "Received a SIGINT" ); | 308 | // odebug << "Received a SIGINT" << oendl; |
309 | // interruptConnection(); | 309 | // interruptConnection(); |
310 | // break; | 310 | // break; |
311 | // case SIGCHLD: | 311 | // case SIGCHLD: |
312 | // sigChld(); | 312 | // sigChld(); |
313 | // break; | 313 | // break; |
314 | // case SIGUSR1: | 314 | // case SIGUSR1: |
315 | // sigPPPDDied(); | 315 | // sigPPPDDied(); |
316 | // break; | 316 | // break; |
317 | // } | 317 | // } |
318 | // return true; | 318 | // return true; |
319 | // } | 319 | // } |
320 | 320 | ||
@@ -414,44 +414,44 @@ void KPPPWidget::interruptConnection() { | |||
414 | // | 414 | // |
415 | 415 | ||
416 | if (con->isVisible()) | 416 | if (con->isVisible()) |
417 | emit con->cancelbutton(); | 417 | emit con->cancelbutton(); |
418 | 418 | ||
419 | // disconnect if online | 419 | // disconnect if online |
420 | if (_pppdata->pppdRunning()) | 420 | if (_pppdata->pppdRunning()) |
421 | emit disconnect(); | 421 | emit disconnect(); |
422 | } | 422 | } |
423 | 423 | ||
424 | 424 | ||
425 | void KPPPWidget::sigPPPDDied() { | 425 | void KPPPWidget::sigPPPDDied() { |
426 | qDebug( "Received a SIGUSR1" ); | 426 | odebug << "Received a SIGUSR1" << oendl; |
427 | 427 | ||
428 | // if we are not connected pppdpid is -1 so have have to check for that | 428 | // if we are not connected pppdpid is -1 so have have to check for that |
429 | // in the followin line to make sure that we don't raise a false alarm | 429 | // in the followin line to make sure that we don't raise a false alarm |
430 | // such as would be the case when the log file viewer exits. | 430 | // such as would be the case when the log file viewer exits. |
431 | if(_pppdata->pppdRunning() || _pppdata->pppdError()) { | 431 | if(_pppdata->pppdRunning() || _pppdata->pppdError()) { |
432 | qDebug( "It was pppd that died" ); | 432 | odebug << "It was pppd that died" << oendl; |
433 | 433 | ||
434 | // when we killpppd() on Cancel in ConnectWidget | 434 | // when we killpppd() on Cancel in ConnectWidget |
435 | // we set pppid to -1 so we won't | 435 | // we set pppid to -1 so we won't |
436 | // enter this block | 436 | // enter this block |
437 | 437 | ||
438 | // just to be sure | 438 | // just to be sure |
439 | 439 | ||
440 | Modem::modem->removeSecret(AUTH_PAP); | 440 | Modem::modem->removeSecret(AUTH_PAP); |
441 | Modem::modem->removeSecret(AUTH_CHAP); | 441 | Modem::modem->removeSecret(AUTH_CHAP); |
442 | 442 | ||
443 | _pppdata->setpppdRunning(false); | 443 | _pppdata->setpppdRunning(false); |
444 | 444 | ||
445 | qDebug( "Executing command on disconnect since pppd has died." ); | 445 | odebug << "Executing command on disconnect since pppd has died." << oendl; |
446 | QApplication::flushX(); | 446 | QApplication::flushX(); |
447 | execute_command(_pppdata->command_on_disconnect()); | 447 | execute_command(_pppdata->command_on_disconnect()); |
448 | 448 | ||
449 | // stopAccounting(); | 449 | // stopAccounting(); |
450 | 450 | ||
451 | con_win->stopClock(); | 451 | con_win->stopClock(); |
452 | // DockWidget::dock_widget->stop_stats(); | 452 | // DockWidget::dock_widget->stop_stats(); |
453 | // DockWidget::dock_widget->hide(); | 453 | // DockWidget::dock_widget->hide(); |
454 | 454 | ||
455 | if(!_pppdata->pppdError()) | 455 | if(!_pppdata->pppdError()) |
456 | _pppdata->setpppdError(E_PPPD_DIED); | 456 | _pppdata->setpppdError(E_PPPD_DIED); |
457 | removedns(); | 457 | removedns(); |
@@ -480,47 +480,47 @@ void KPPPWidget::sigPPPDDied() { | |||
480 | msg += QObject::tr("<p>Exit status: %1").arg(Modem::modem->lastStatus); | 480 | msg += QObject::tr("<p>Exit status: %1").arg(Modem::modem->lastStatus); |
481 | msg += QObject::tr("</p><p>See 'man pppd' for an explanation of the error " | 481 | msg += QObject::tr("</p><p>See 'man pppd' for an explanation of the error " |
482 | "codes or take a look at the kppp FAQ on " | 482 | "codes or take a look at the kppp FAQ on " |
483 | " <a href=http://devel-home.kde.org/~kppp/index.html>" | 483 | " <a href=http://devel-home.kde.org/~kppp/index.html>" |
484 | "http://devel-home.kde.org/~kppp/index.html</a></p>"); | 484 | "http://devel-home.kde.org/~kppp/index.html</a></p>"); |
485 | } | 485 | } |
486 | } | 486 | } |
487 | 487 | ||
488 | // if(QMessageBox::warning(0, msg, QObject::tr("Error"), QObject::tr("&OK"), QObject::tr("&Details...")) == QMessageBox::No) | 488 | // if(QMessageBox::warning(0, msg, QObject::tr("Error"), QObject::tr("&OK"), QObject::tr("&Details...")) == QMessageBox::No) |
489 | // // PPPL_ShowLog(); | 489 | // // PPPL_ShowLog(); |
490 | // } else { /* reconnect on disconnect */ | 490 | // } else { /* reconnect on disconnect */ |
491 | if (false){ | 491 | if (false){ |
492 | qDebug( "Trying to reconnect... " ); | 492 | odebug << "Trying to reconnect... " << oendl; |
493 | 493 | ||
494 | if(_pppdata->authMethod() == AUTH_PAP || | 494 | if(_pppdata->authMethod() == AUTH_PAP || |
495 | _pppdata->authMethod() == AUTH_CHAP || | 495 | _pppdata->authMethod() == AUTH_CHAP || |
496 | _pppdata->authMethod() == AUTH_PAPCHAP) | 496 | _pppdata->authMethod() == AUTH_PAPCHAP) |
497 | Modem::modem->setSecret(_pppdata->authMethod(), | 497 | Modem::modem->setSecret(_pppdata->authMethod(), |
498 | encodeWord(_pppdata->storedUsername()), | 498 | encodeWord(_pppdata->storedUsername()), |
499 | encodeWord(_pppdata->password())); | 499 | encodeWord(_pppdata->password())); |
500 | 500 | ||
501 | con_win->hide(); | 501 | con_win->hide(); |
502 | con_win->stopClock(); | 502 | con_win->stopClock(); |
503 | //stopAccounting(); | 503 | //stopAccounting(); |
504 | _pppdata->setpppdRunning(false); | 504 | _pppdata->setpppdRunning(false); |
505 | // not in a signal handler !!!KNotifyClient::beep(); | 505 | // not in a signal handler !!!KNotifyClient::beep(); |
506 | emit cmdl_start(); | 506 | emit cmdl_start(); |
507 | } | 507 | } |
508 | } | 508 | } |
509 | _pppdata->setpppdError(0); | 509 | _pppdata->setpppdError(0); |
510 | } | 510 | } |
511 | } | 511 | } |
512 | 512 | ||
513 | // void KPPPWidget::sigChld() { | 513 | // void KPPPWidget::sigChld() { |
514 | // qDebug( "sigchld()" ); | 514 | // odebug << "sigchld()" << oendl; |
515 | // // pid_t id = wait(0L); | 515 | // // pid_t id = wait(0L); |
516 | // // if(id == helperPid && helperPid != -1) { | 516 | // // if(id == helperPid && helperPid != -1) { |
517 | // // kdDebug(5002) << "It was the setuid child that died" << endl; | 517 | // // kdDebug(5002) << "It was the setuid child that died" << endl; |
518 | // // helperPid = -1; | 518 | // // helperPid = -1; |
519 | // QString msg = QObject::tr("kppp's helper process just died.\n" | 519 | // QString msg = QObject::tr("kppp's helper process just died.\n" |
520 | // "Since a further execution would be pointless, " | 520 | // "Since a further execution would be pointless, " |
521 | // "kppp will shut down now."); | 521 | // "kppp will shut down now."); |
522 | // QMessageBox::warning(0L,"error", msg); | 522 | // QMessageBox::warning(0L,"error", msg); |
523 | // //remove_pidfile(); | 523 | // //remove_pidfile(); |
524 | // exit(1); | 524 | // exit(1); |
525 | // // } | 525 | // // } |
526 | // } | 526 | // } |