Diffstat (limited to 'noncore/settings/networksettings/ppp/connect.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/connect.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/noncore/settings/networksettings/ppp/connect.cpp b/noncore/settings/networksettings/ppp/connect.cpp index e3fab24..b75410c 100644 --- a/noncore/settings/networksettings/ppp/connect.cpp +++ b/noncore/settings/networksettings/ppp/connect.cpp | |||
@@ -451,49 +451,49 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
451 | if(vmain == 101) { | 451 | if(vmain == 101) { |
452 | if(!expecting) { | 452 | if(!expecting) { |
453 | _ifaceppp->modem()->setDataMode(true); // modem will no longer respond to AT commands | 453 | _ifaceppp->modem()->setDataMode(true); // modem will no longer respond to AT commands |
454 | 454 | ||
455 | emit startAccounting(); | 455 | emit startAccounting(); |
456 | // p_kppp->con_win->startClock(); | 456 | // p_kppp->con_win->startClock(); |
457 | 457 | ||
458 | vmain = 2; | 458 | vmain = 2; |
459 | scriptTimeout=_ifaceppp->data()->modemTimeout()*1000; | 459 | scriptTimeout=_ifaceppp->data()->modemTimeout()*1000; |
460 | return; | 460 | return; |
461 | } | 461 | } |
462 | } | 462 | } |
463 | 463 | ||
464 | // execute the script | 464 | // execute the script |
465 | if(vmain == 2) { | 465 | if(vmain == 2) { |
466 | if(!expecting && !pausing && !scanning) { | 466 | if(!expecting && !pausing && !scanning) { |
467 | 467 | ||
468 | timeout_timer->stop(); | 468 | timeout_timer->stop(); |
469 | timeout_timer->start(scriptTimeout); | 469 | timeout_timer->start(scriptTimeout); |
470 | 470 | ||
471 | if((unsigned) scriptindex < comlist->count()) { | 471 | if((unsigned) scriptindex < comlist->count()) { |
472 | scriptCommand = *(comlist->at(scriptindex)); | 472 | scriptCommand = *(comlist->at(scriptindex)); |
473 | scriptArgument = *(arglist->at(scriptindex)); | 473 | scriptArgument = *(arglist->at(scriptindex)); |
474 | } else { | 474 | } else { |
475 | qDebug( "End of script" ); | 475 | odebug << "End of script" << oendl; |
476 | vmain = 10; | 476 | vmain = 10; |
477 | return; | 477 | return; |
478 | } | 478 | } |
479 | 479 | ||
480 | if (scriptCommand == "Scan") { | 480 | if (scriptCommand == "Scan") { |
481 | QString bm = QObject::tr("Scanning %1").arg(scriptArgument); | 481 | QString bm = QObject::tr("Scanning %1").arg(scriptArgument); |
482 | messg->setText(bm); | 482 | messg->setText(bm); |
483 | emit debugMessage(bm); | 483 | emit debugMessage(bm); |
484 | 484 | ||
485 | setScan(scriptArgument); | 485 | setScan(scriptArgument); |
486 | scriptindex++; | 486 | scriptindex++; |
487 | return; | 487 | return; |
488 | } | 488 | } |
489 | 489 | ||
490 | if (scriptCommand == "Save") { | 490 | if (scriptCommand == "Save") { |
491 | QString bm = QObject::tr("Saving %1").arg(scriptArgument); | 491 | QString bm = QObject::tr("Saving %1").arg(scriptArgument); |
492 | messg->setText(bm); | 492 | messg->setText(bm); |
493 | emit debugMessage(bm); | 493 | emit debugMessage(bm); |
494 | 494 | ||
495 | if (scriptArgument.lower() == "password") { | 495 | if (scriptArgument.lower() == "password") { |
496 | _ifaceppp->data()->setPassword(scanvar); | 496 | _ifaceppp->data()->setPassword(scanvar); |
497 | // p_kppp->setPW_Edit(scanvar); | 497 | // p_kppp->setPW_Edit(scanvar); |
498 | if(_ifaceppp->data()->storePassword()) | 498 | if(_ifaceppp->data()->storePassword()) |
499 | _ifaceppp->data()->setStoredPassword(scanvar); | 499 | _ifaceppp->data()->setStoredPassword(scanvar); |
@@ -817,59 +817,59 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
817 | // if (termwindow) { | 817 | // if (termwindow) { |
818 | // delete termwindow; | 818 | // delete termwindow; |
819 | // termwindow = 0L; | 819 | // termwindow = 0L; |
820 | // this->show(); | 820 | // this->show(); |
821 | // } else { | 821 | // } else { |
822 | // termwindow = new LoginTerm(0L, 0L); | 822 | // termwindow = new LoginTerm(0L, 0L); |
823 | // hide(); | 823 | // hide(); |
824 | // termwindow->show(); | 824 | // termwindow->show(); |
825 | // vmain = 30; | 825 | // vmain = 30; |
826 | // return; | 826 | // return; |
827 | // } | 827 | // } |
828 | } | 828 | } |
829 | 829 | ||
830 | // Close the tty. This prevents the QTimer::singleShot() in | 830 | // Close the tty. This prevents the QTimer::singleShot() in |
831 | // Modem::readtty() from re-enabling the socket notifier. | 831 | // Modem::readtty() from re-enabling the socket notifier. |
832 | // The port is still held open by the helper process. | 832 | // The port is still held open by the helper process. |
833 | 833 | ||
834 | /* Er, there _is_ not QTimer::singleShot() in Modem::readtty(), | 834 | /* Er, there _is_ not QTimer::singleShot() in Modem::readtty(), |
835 | and closing the thing prevents pppd from using it later. */ | 835 | and closing the thing prevents pppd from using it later. */ |
836 | //_ifaceppp->modem()->closetty(); | 836 | //_ifaceppp->modem()->closetty(); |
837 | 837 | ||
838 | killTimer( main_timer_ID ); | 838 | killTimer( main_timer_ID ); |
839 | 839 | ||
840 | if_timeout_timer->start(_ifaceppp->data()->pppdTimeout()*1000); | 840 | if_timeout_timer->start(_ifaceppp->data()->pppdTimeout()*1000); |
841 | qDebug( "started if timeout timer with %i", _ifaceppp->data()->pppdTimeout()*1000); | 841 | odebug << "started if timeout timer with " << _ifaceppp->data()->pppdTimeout()*1000 << "" << oendl; |
842 | 842 | ||
843 | // find out PPP interface and notify the stats module | 843 | // find out PPP interface and notify the stats module |
844 | // stats->setUnit(pppInterfaceNumber()); | 844 | // stats->setUnit(pppInterfaceNumber()); |
845 | 845 | ||
846 | qApp->flushX(); | 846 | qApp->flushX(); |
847 | semaphore = true; | 847 | semaphore = true; |
848 | result = execppp(); | 848 | result = execppp(); |
849 | 849 | ||
850 | emit debugMessage(QObject::tr("Starting pppd...")); | 850 | emit debugMessage(QObject::tr("Starting pppd...")); |
851 | qDebug("execppp() returned with return-code %i", result ); | 851 | odebug << "execppp() returned with return-code " << result << "" << oendl; |
852 | 852 | ||
853 | if(result) { | 853 | if(result) { |
854 | if(!_ifaceppp->data()->autoDNS()) | 854 | if(!_ifaceppp->data()->autoDNS()) |
855 | adddns( _ifaceppp ); | 855 | adddns( _ifaceppp ); |
856 | 856 | ||
857 | // O.K we are done here, let's change over to the if_waiting loop | 857 | // O.K we are done here, let's change over to the if_waiting loop |
858 | // where we wait for the ppp if (interface) to come up. | 858 | // where we wait for the ppp if (interface) to come up. |
859 | 859 | ||
860 | emit if_waiting_signal(); | 860 | emit if_waiting_signal(); |
861 | } else { | 861 | } else { |
862 | 862 | ||
863 | // starting pppd wasn't successful. Error messages were | 863 | // starting pppd wasn't successful. Error messages were |
864 | // handled by execppp(); | 864 | // handled by execppp(); |
865 | if_timeout_timer->stop(); | 865 | if_timeout_timer->stop(); |
866 | this->hide(); | 866 | this->hide(); |
867 | messg->setText(""); | 867 | messg->setText(""); |
868 | //p_kppp->quit_b->setFocus(); | 868 | //p_kppp->quit_b->setFocus(); |
869 | //p_kppp->show(); | 869 | //p_kppp->show(); |
870 | qApp->processEvents(); | 870 | qApp->processEvents(); |
871 | _ifaceppp->modem()->hangup(); | 871 | _ifaceppp->modem()->hangup(); |
872 | emit stopAccounting(); | 872 | emit stopAccounting(); |
873 | //p_kppp->con_win->stopClock(); | 873 | //p_kppp->con_win->stopClock(); |
874 | _ifaceppp->modem()->closetty(); | 874 | _ifaceppp->modem()->closetty(); |
875 | _ifaceppp->modem()->unlockdevice(); | 875 | _ifaceppp->modem()->unlockdevice(); |
@@ -1043,49 +1043,49 @@ void ConnectWidget::setScan(const QString &n) { | |||
1043 | scanstr = n; | 1043 | scanstr = n; |
1044 | scanbuffer = ""; | 1044 | scanbuffer = ""; |
1045 | 1045 | ||
1046 | QString ts = QObject::tr("Scanning: %1").arg(n); | 1046 | QString ts = QObject::tr("Scanning: %1").arg(n); |
1047 | emit debugMessage(ts); | 1047 | emit debugMessage(ts); |
1048 | } | 1048 | } |
1049 | 1049 | ||
1050 | 1050 | ||
1051 | void ConnectWidget::setExpect(const QString &n) { | 1051 | void ConnectWidget::setExpect(const QString &n) { |
1052 | expecting = true; | 1052 | expecting = true; |
1053 | expectstr = n; | 1053 | expectstr = n; |
1054 | 1054 | ||
1055 | QString ts = QObject::tr("Expecting: %1").arg(n); | 1055 | QString ts = QObject::tr("Expecting: %1").arg(n); |
1056 | ts.replace(QRegExp("\n"), "<LF>"); | 1056 | ts.replace(QRegExp("\n"), "<LF>"); |
1057 | emit debugMessage(ts); | 1057 | emit debugMessage(ts); |
1058 | 1058 | ||
1059 | // check if the expected string is in the read buffer already. | 1059 | // check if the expected string is in the read buffer already. |
1060 | checkBuffers(); | 1060 | checkBuffers(); |
1061 | } | 1061 | } |
1062 | 1062 | ||
1063 | 1063 | ||
1064 | void ConnectWidget::if_waiting_timed_out() { | 1064 | void ConnectWidget::if_waiting_timed_out() { |
1065 | if_timer->stop(); | 1065 | if_timer->stop(); |
1066 | if_timeout_timer->stop(); | 1066 | if_timeout_timer->stop(); |
1067 | qDebug("if_waiting_timed_out()"); | 1067 | odebug << "if_waiting_timed_out()" << oendl; |
1068 | 1068 | ||
1069 | _ifaceppp->data()->setpppdError(E_IF_TIMEOUT); | 1069 | _ifaceppp->data()->setpppdError(E_IF_TIMEOUT); |
1070 | 1070 | ||
1071 | // let's kill the stuck pppd | 1071 | // let's kill the stuck pppd |
1072 | _ifaceppp->modem()->killPPPDaemon(); | 1072 | _ifaceppp->modem()->killPPPDaemon(); |
1073 | 1073 | ||
1074 | emit stopAccounting(); | 1074 | emit stopAccounting(); |
1075 | // p_kppp->con_win->stopClock(); | 1075 | // p_kppp->con_win->stopClock(); |
1076 | 1076 | ||
1077 | 1077 | ||
1078 | // killing ppp will generate a SIGCHLD which will be caught in pppdie() | 1078 | // killing ppp will generate a SIGCHLD which will be caught in pppdie() |
1079 | // in main.cpp what happens next will depend on the boolean | 1079 | // in main.cpp what happens next will depend on the boolean |
1080 | // reconnect_on_disconnect which is set in ConnectWidget::init(); | 1080 | // reconnect_on_disconnect which is set in ConnectWidget::init(); |
1081 | } | 1081 | } |
1082 | 1082 | ||
1083 | void ConnectWidget::pppdDied() | 1083 | void ConnectWidget::pppdDied() |
1084 | { | 1084 | { |
1085 | if_timer->stop(); | 1085 | if_timer->stop(); |
1086 | if_timeout_timer->stop(); | 1086 | if_timeout_timer->stop(); |
1087 | } | 1087 | } |
1088 | 1088 | ||
1089 | void ConnectWidget::if_waiting_slot() { | 1089 | void ConnectWidget::if_waiting_slot() { |
1090 | messg->setText(QObject::tr("Logging on to network...")); | 1090 | messg->setText(QObject::tr("Logging on to network...")); |
1091 | 1091 | ||
@@ -1250,49 +1250,49 @@ bool ConnectWidget::execppp() { | |||
1250 | 1250 | ||
1251 | // check for debug | 1251 | // check for debug |
1252 | if(_ifaceppp->data()->getPPPDebug()) | 1252 | if(_ifaceppp->data()->getPPPDebug()) |
1253 | command += " debug"; | 1253 | command += " debug"; |
1254 | 1254 | ||
1255 | QStringList &arglist = _ifaceppp->data()->pppdArgument(); | 1255 | QStringList &arglist = _ifaceppp->data()->pppdArgument(); |
1256 | for ( QStringList::Iterator it = arglist.begin(); | 1256 | for ( QStringList::Iterator it = arglist.begin(); |
1257 | it != arglist.end(); | 1257 | it != arglist.end(); |
1258 | ++it ) | 1258 | ++it ) |
1259 | { | 1259 | { |
1260 | command += " " + *it; | 1260 | command += " " + *it; |
1261 | } | 1261 | } |
1262 | 1262 | ||
1263 | command += " call opie-kppp logfd 11"; | 1263 | command += " call opie-kppp logfd 11"; |
1264 | 1264 | ||
1265 | if (command.length() > MAX_CMDLEN) { | 1265 | if (command.length() > MAX_CMDLEN) { |
1266 | QMessageBox::critical(this, "error", QObject::tr( | 1266 | QMessageBox::critical(this, "error", QObject::tr( |
1267 | "pppd command + command-line arguments exceed " | 1267 | "pppd command + command-line arguments exceed " |
1268 | "2024 characters in length." | 1268 | "2024 characters in length." |
1269 | )); | 1269 | )); |
1270 | 1270 | ||
1271 | return false; // nonsensically long command which would bust my buffer buf. | 1271 | return false; // nonsensically long command which would bust my buffer buf. |
1272 | } | 1272 | } |
1273 | 1273 | ||
1274 | qWarning("Command IS: %s",command.latin1() ); | 1274 | owarn << "Command IS: " << command.latin1() << "" << oendl; |
1275 | 1275 | ||
1276 | qApp->flushX(); | 1276 | qApp->flushX(); |
1277 | 1277 | ||
1278 | return _ifaceppp->modem()->execPPPDaemon(command); | 1278 | return _ifaceppp->modem()->execPPPDaemon(command); |
1279 | } | 1279 | } |
1280 | 1280 | ||
1281 | 1281 | ||
1282 | void ConnectWidget::closeEvent( QCloseEvent *e ) { | 1282 | void ConnectWidget::closeEvent( QCloseEvent *e ) { |
1283 | e->ignore(); | 1283 | e->ignore(); |
1284 | emit cancelbutton(); | 1284 | emit cancelbutton(); |
1285 | } | 1285 | } |
1286 | 1286 | ||
1287 | 1287 | ||
1288 | void ConnectWidget::setMsg(const QString &msg) { | 1288 | void ConnectWidget::setMsg(const QString &msg) { |
1289 | messg->setText(msg); | 1289 | messg->setText(msg); |
1290 | } | 1290 | } |
1291 | 1291 | ||
1292 | void ConnectWidget::writeline(const QString &s) { | 1292 | void ConnectWidget::writeline(const QString &s) { |
1293 | _ifaceppp->modem()->writeLine(s.local8Bit()); | 1293 | _ifaceppp->modem()->writeLine(s.local8Bit()); |
1294 | } | 1294 | } |
1295 | 1295 | ||
1296 | // Set the hostname and domain from DNS Server | 1296 | // Set the hostname and domain from DNS Server |
1297 | void auto_hostname(InterfacePPP *_ifaceppp) { | 1297 | void auto_hostname(InterfacePPP *_ifaceppp) { |
1298 | struct in_addr local_ip; | 1298 | struct in_addr local_ip; |