summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/ppp/connect.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings/ppp/connect.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings/ppp/connect.cpp180
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
@@ -181,3 +181,3 @@ void ConnectWidget::preinit() {
181void ConnectWidget::init() { 181void ConnectWidget::init() {
182 gpppdata.setpppdError(0); 182 PPPData::data()->setpppdError(0);
183 inittimer->stop(); 183 inittimer->stop();
@@ -198,8 +198,8 @@ void ConnectWidget::init() {
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);
@@ -209,3 +209,3 @@ void ConnectWidget::init() {
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..."));
@@ -215,3 +215,3 @@ void ConnectWidget::init() {
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;
@@ -252,3 +252,3 @@ void ConnectWidget::init() {
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
@@ -286,3 +286,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
286 286
287 QString initStr = gpppdata.modemInitStr(substate); 287 QString initStr = PPPData::data()->modemInitStr(substate);
288 if (!initStr.isEmpty()) { 288 if (!initStr.isEmpty()) {
@@ -290,10 +290,10 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
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 }
@@ -308,3 +308,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
308 */ 308 */
309 if (MODEM_TONEDURATION != gpppdata.modemToneDuration()) 309 if (MODEM_TONEDURATION != PPPData::data()->modemToneDuration())
310 vmain = 5; 310 vmain = 5;
@@ -318,3 +318,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
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;
@@ -322,3 +322,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
322 emit debugMessage(msg); 322 emit debugMessage(msg);
323 setExpect(gpppdata.modemInitResp()); 323 setExpect(PPPData::data()->modemInitResp());
324 writeline(sToneDuration); 324 writeline(sToneDuration);
@@ -338,3 +338,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
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;
@@ -345,7 +345,7 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
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;
@@ -357,3 +357,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
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...");
@@ -361,4 +361,4 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
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 }
@@ -374,6 +374,6 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
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);
@@ -383,4 +383,4 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
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);
@@ -390,3 +390,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
390 390
391 setExpect(gpppdata.modemConnectResp()); 391 setExpect(PPPData::data()->modemConnectResp());
392 vmain = 100; 392 vmain = 100;
@@ -400,3 +400,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
400 if(!expecting) { 400 if(!expecting) {
401 myreadbuffer = gpppdata.modemConnectResp(); 401 myreadbuffer = PPPData::data()->modemConnectResp();
402 setExpect("\n"); 402 setExpect("\n");
@@ -406,5 +406,5 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
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
@@ -414,4 +414,4 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
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);
@@ -421,3 +421,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
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();
@@ -431,3 +431,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
431 431
432 if(readbuffer.contains(gpppdata.modemNoDialtoneResp())) { 432 if(readbuffer.contains(PPPData::data()->modemNoDialtoneResp())) {
433 timeout_timer->stop(); 433 timeout_timer->stop();
@@ -440,3 +440,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
440 440
441 if(readbuffer.contains(gpppdata.modemNoCarrierResp())) { 441 if(readbuffer.contains(PPPData::data()->modemNoCarrierResp())) {
442 timeout_timer->stop(); 442 timeout_timer->stop();
@@ -459,3 +459,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
459 vmain = 2; 459 vmain = 2;
460 scriptTimeout=gpppdata.modemTimeout()*1000; 460 scriptTimeout=PPPData::data()->modemTimeout()*1000;
461 return; 461 return;
@@ -496,6 +496,6 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
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;
@@ -515,4 +515,4 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
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
@@ -580,4 +580,4 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
580 580
581 writeline(gpppdata.modemHangupStr()); 581 writeline(PPPData::data()->modemHangupStr());
582 setExpect(gpppdata.modemHangupResp()); 582 setExpect(PPPData::data()->modemHangupResp());
583 583
@@ -594,3 +594,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
594 594
595 setExpect(gpppdata.modemRingResp()); 595 setExpect(PPPData::data()->modemRingResp());
596 vmain = 150; 596 vmain = 150;
@@ -604,3 +604,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
604 604
605 QString idstring = gpppdata.storedUsername(); 605 QString idstring = PPPData::data()->storedUsername();
606 606
@@ -640,3 +640,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
640 640
641 QString pwstring = gpppdata.password(); 641 QString pwstring = PPPData::data()->password();
642 642
@@ -787,4 +787,4 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
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
@@ -816,3 +816,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
816 816
817 if(gpppdata.authMethod() == AUTH_TERMINAL) { 817 if(PPPData::data()->authMethod() == AUTH_TERMINAL) {
818 // if (termwindow) { 818 // if (termwindow) {
@@ -837,4 +837,4 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
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
@@ -851,3 +851,3 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
851 if(result) { 851 if(result) {
852 if(!gpppdata.autoDNS()) 852 if(!PPPData::data()->autoDNS())
853 adddns(); 853 adddns();
@@ -1065,3 +1065,3 @@ void ConnectWidget::if_waiting_timed_out() {
1065 1065
1066 gpppdata.setpppdError(E_IF_TIMEOUT); 1066 PPPData::data()->setpppdError(E_IF_TIMEOUT);
1067 1067
@@ -1090,3 +1090,3 @@ void ConnectWidget::if_waiting_slot() {
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.
@@ -1107,3 +1107,3 @@ void ConnectWidget::if_waiting_slot() {
1107 1107
1108 if(gpppdata.autoDNS()) 1108 if(PPPData::data()->autoDNS())
1109 addpeerdns(); 1109 addpeerdns();
@@ -1116,3 +1116,3 @@ void ConnectWidget::if_waiting_slot() {
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..."));
@@ -1121,3 +1121,3 @@ void ConnectWidget::if_waiting_slot() {
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"));
@@ -1143,3 +1143,3 @@ void ConnectWidget::if_waiting_slot() {
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();
@@ -1151,3 +1151,3 @@ void ConnectWidget::if_waiting_slot() {
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();
@@ -1170,5 +1170,5 @@ bool ConnectWidget::execppp() {
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
@@ -1176,7 +1176,7 @@ bool ConnectWidget::execppp() {
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 += ":";
@@ -1188,11 +1188,11 @@ bool ConnectWidget::execppp() {
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";
@@ -1202,9 +1202,9 @@ bool ConnectWidget::execppp() {
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();
@@ -1217,5 +1217,5 @@ bool ConnectWidget::execppp() {
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 }
@@ -1223,5 +1223,5 @@ bool ConnectWidget::execppp() {
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 }
@@ -1229,5 +1229,5 @@ bool ConnectWidget::execppp() {
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 }
@@ -1235,3 +1235,3 @@ bool ConnectWidget::execppp() {
1235 // check for debug 1235 // check for debug
1236 if(gpppdata.getPPPDebug()) 1236 if(PPPData::data()->getPPPDebug())
1237 command += " debug"; 1237 command += " debug";
@@ -1279,4 +1279,4 @@ void auto_hostname() {
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());
@@ -1334,3 +1334,3 @@ void add_domain(const QString &domain) {
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")) {
@@ -1357,3 +1357,3 @@ void adddns()
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();
@@ -1368,3 +1368,3 @@ void adddns()
1368 } 1368 }
1369 add_domain(gpppdata.domain()); 1369 add_domain(PPPData::data()->domain());
1370} 1370}
@@ -1389,3 +1389,3 @@ void addpeerdns() {
1389 } 1389 }
1390 add_domain(gpppdata.domain()); 1390 add_domain(PPPData::data()->domain());
1391} 1391}