Diffstat (limited to 'noncore/settings/networksettings/ppp/connect.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/connect.cpp | 180 |
1 files changed, 90 insertions, 90 deletions
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 | |||
@@ -180,5 +180,5 @@ void ConnectWidget::preinit() { | |||
180 | 180 | ||
181 | void ConnectWidget::init() { | 181 | void ConnectWidget::init() { |
182 | gpppdata.setpppdError(0); | 182 | PPPData::data()->setpppdError(0); |
183 | inittimer->stop(); | 183 | inittimer->stop(); |
184 | vmain = 0; | 184 | vmain = 0; |
@@ -197,10 +197,10 @@ void ConnectWidget::init() { | |||
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 | ||
@@ -208,5 +208,5 @@ void ConnectWidget::init() { | |||
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...")); |
@@ -214,5 +214,5 @@ void ConnectWidget::init() { | |||
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 | ||
@@ -251,5 +251,5 @@ void ConnectWidget::init() { | |||
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. |
@@ -285,16 +285,16 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
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 | ||
@@ -307,5 +307,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
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 |
@@ -317,9 +317,9 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
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 | } |
@@ -337,5 +337,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
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; |
@@ -344,9 +344,9 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
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; |
@@ -356,10 +356,10 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
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; |
@@ -373,8 +373,8 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
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); |
@@ -382,6 +382,6 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
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()) |
@@ -389,5 +389,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
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; |
@@ -399,5 +399,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
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; |
@@ -405,7 +405,7 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
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...")); |
@@ -413,6 +413,6 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
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); |
@@ -420,5 +420,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
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 | } |
@@ -430,5 +430,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
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 | ||
@@ -439,5 +439,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
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 | ||
@@ -458,5 +458,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
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 | } |
@@ -495,8 +495,8 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
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 | } |
@@ -514,6 +514,6 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
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") |
@@ -579,6 +579,6 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
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++; |
@@ -593,5 +593,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
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; |
@@ -603,5 +603,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
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) { |
@@ -639,5 +639,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
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) { |
@@ -786,6 +786,6 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
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; |
@@ -815,5 +815,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
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; |
@@ -836,6 +836,6 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
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 |
@@ -850,5 +850,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) { | |||
850 | 850 | ||
851 | if(result) { | 851 | if(result) { |
852 | if(!gpppdata.autoDNS()) | 852 | if(!PPPData::data()->autoDNS()) |
853 | adddns(); | 853 | adddns(); |
854 | 854 | ||
@@ -1064,5 +1064,5 @@ void ConnectWidget::if_waiting_timed_out() { | |||
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 |
@@ -1089,5 +1089,5 @@ void ConnectWidget::if_waiting_slot() { | |||
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(); |
@@ -1106,5 +1106,5 @@ void ConnectWidget::if_waiting_slot() { | |||
1106 | usleep(200000); | 1106 | usleep(200000); |
1107 | 1107 | ||
1108 | if(gpppdata.autoDNS()) | 1108 | if(PPPData::data()->autoDNS()) |
1109 | addpeerdns(); | 1109 | addpeerdns(); |
1110 | 1110 | ||
@@ -1115,10 +1115,10 @@ void ConnectWidget::if_waiting_slot() { | |||
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 | } |
@@ -1142,5 +1142,5 @@ void ConnectWidget::if_waiting_slot() { | |||
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(); |
@@ -1150,5 +1150,5 @@ void ConnectWidget::if_waiting_slot() { | |||
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 | } |
@@ -1169,15 +1169,15 @@ bool ConnectWidget::execppp() { | |||
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 | } |
@@ -1187,13 +1187,13 @@ bool ConnectWidget::execppp() { | |||
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 |
@@ -1201,11 +1201,11 @@ bool ConnectWidget::execppp() { | |||
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(); |
@@ -1216,23 +1216,23 @@ bool ConnectWidget::execppp() { | |||
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 | ||
@@ -1278,6 +1278,6 @@ void auto_hostname() { | |||
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); |
@@ -1333,5 +1333,5 @@ void add_domain(const QString &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() + |
@@ -1356,5 +1356,5 @@ void adddns() | |||
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(); |
@@ -1367,5 +1367,5 @@ void adddns() | |||
1367 | close(fd); | 1367 | close(fd); |
1368 | } | 1368 | } |
1369 | add_domain(gpppdata.domain()); | 1369 | add_domain(PPPData::data()->domain()); |
1370 | } | 1370 | } |
1371 | 1371 | ||
@@ -1388,5 +1388,5 @@ void addpeerdns() { | |||
1388 | close(fd); | 1388 | close(fd); |
1389 | } | 1389 | } |
1390 | add_domain(gpppdata.domain()); | 1390 | add_domain(PPPData::data()->domain()); |
1391 | } | 1391 | } |
1392 | 1392 | ||