summaryrefslogtreecommitdiff
authortille <tille>2003-06-06 13:38:57 (UTC)
committer tille <tille>2003-06-06 13:38:57 (UTC)
commit225486a1c3714b4b0c0e60286df13d8ede029768 (patch) (unidiff)
treea49c0faa1d439308ebb60181e1cd5afd5479d092
parentd3e9154252841f3adcfbd9868e263475fc698ebb (diff)
downloadopie-225486a1c3714b4b0c0e60286df13d8ede029768.zip
opie-225486a1c3714b4b0c0e60286df13d8ede029768.tar.gz
opie-225486a1c3714b4b0c0e60286df13d8ede029768.tar.bz2
more arm fixes..
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/ppp/pppdata.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/settings/networksettings/ppp/pppdata.cpp b/noncore/settings/networksettings/ppp/pppdata.cpp
index 8f066ff..8f45e54 100644
--- a/noncore/settings/networksettings/ppp/pppdata.cpp
+++ b/noncore/settings/networksettings/ppp/pppdata.cpp
@@ -231,513 +231,513 @@ void PPPData::setPassword(const QString &pw) {
231 231
232const QString PPPData::defaultAccount() { 232const QString PPPData::defaultAccount() {
233 return readConfig(GENERAL_GRP, DEFAULTACCOUNT_KEY); 233 return readConfig(GENERAL_GRP, DEFAULTACCOUNT_KEY);
234} 234}
235 235
236 236
237void PPPData::setDefaultAccount(const QString &n) { 237void PPPData::setDefaultAccount(const QString &n) {
238 writeConfig(GENERAL_GRP, DEFAULTACCOUNT_KEY, n); 238 writeConfig(GENERAL_GRP, DEFAULTACCOUNT_KEY, n);
239 239
240 //now set the current account index to the default account 240 //now set the current account index to the default account
241 setAccount(defaultAccount()); 241 setAccount(defaultAccount());
242} 242}
243 243
244 244
245bool PPPData::get_show_clock_on_caption() { 245bool PPPData::get_show_clock_on_caption() {
246 return (bool) readNumConfig(GENERAL_GRP, SHOWCLOCK_KEY, true); 246 return (bool) readNumConfig(GENERAL_GRP, SHOWCLOCK_KEY, true);
247} 247}
248 248
249 249
250void PPPData::set_show_clock_on_caption(bool set) { 250void PPPData::set_show_clock_on_caption(bool set) {
251 writeConfig(GENERAL_GRP, SHOWCLOCK_KEY, (int) set); 251 writeConfig(GENERAL_GRP, SHOWCLOCK_KEY, (int) set);
252} 252}
253 253
254 254
255bool PPPData::get_xserver_exit_disconnect() { 255bool PPPData::get_xserver_exit_disconnect() {
256 return (bool) readNumConfig(GENERAL_GRP, DISCONNECT_KEY, true); 256 return (bool) readNumConfig(GENERAL_GRP, DISCONNECT_KEY, true);
257} 257}
258 258
259 259
260void PPPData::setPPPDebug(bool set) { 260void PPPData::setPPPDebug(bool set) {
261 writeConfig(GENERAL_GRP, PPP_DEBUG_OPTION, (int)set); 261 writeConfig(GENERAL_GRP, PPP_DEBUG_OPTION, (int)set);
262} 262}
263 263
264 264
265bool PPPData::getPPPDebug() { 265bool PPPData::getPPPDebug() {
266 return (bool)readNumConfig(GENERAL_GRP, PPP_DEBUG_OPTION, false); 266 return (bool)readNumConfig(GENERAL_GRP, PPP_DEBUG_OPTION, false);
267} 267}
268 268
269 269
270void PPPData::set_xserver_exit_disconnect(bool set) { 270void PPPData::set_xserver_exit_disconnect(bool set) {
271 writeConfig(GENERAL_GRP, DISCONNECT_KEY, (int) set); 271 writeConfig(GENERAL_GRP, DISCONNECT_KEY, (int) set);
272} 272}
273 273
274 274
275bool PPPData::quit_on_disconnect() { 275bool PPPData::quit_on_disconnect() {
276 return (bool) readNumConfig(GENERAL_GRP, QUITONDISCONNECT_KEY, false); 276 return (bool) readNumConfig(GENERAL_GRP, QUITONDISCONNECT_KEY, false);
277} 277}
278 278
279 279
280void PPPData::set_quit_on_disconnect(bool set) { 280void PPPData::set_quit_on_disconnect(bool set) {
281 writeConfig(GENERAL_GRP, QUITONDISCONNECT_KEY, (int) set); 281 writeConfig(GENERAL_GRP, QUITONDISCONNECT_KEY, (int) set);
282} 282}
283 283
284 284
285bool PPPData::get_show_log_window() { 285bool PPPData::get_show_log_window() {
286 return (bool) readNumConfig (GENERAL_GRP, SHOWLOGWIN_KEY, false); 286 return (bool) readNumConfig (GENERAL_GRP, SHOWLOGWIN_KEY, false);
287} 287}
288 288
289 289
290void PPPData::set_show_log_window(bool set) { 290void PPPData::set_show_log_window(bool set) {
291 writeConfig(GENERAL_GRP, SHOWLOGWIN_KEY, (int) set); 291 writeConfig(GENERAL_GRP, SHOWLOGWIN_KEY, (int) set);
292} 292}
293 293
294 294
295bool PPPData::automatic_redial() { 295bool PPPData::automatic_redial() {
296 return (bool) readNumConfig(GENERAL_GRP, AUTOREDIAL_KEY, FALSE); 296 return (bool) readNumConfig(GENERAL_GRP, AUTOREDIAL_KEY, FALSE);
297} 297}
298 298
299 299
300void PPPData::set_automatic_redial(bool set) { 300void PPPData::set_automatic_redial(bool set) {
301 writeConfig(GENERAL_GRP, AUTOREDIAL_KEY, (int) set); 301 writeConfig(GENERAL_GRP, AUTOREDIAL_KEY, (int) set);
302} 302}
303 303
304 304
305// bool PPPData::get_iconify_on_connect() { 305// bool PPPData::get_iconify_on_connect() {
306// return (bool) readNumConfig(GENERAL_GRP, ICONIFY_ON_CONNECT_KEY, TRUE); 306// return (bool) readNumConfig(GENERAL_GRP, ICONIFY_ON_CONNECT_KEY, TRUE);
307// } 307// }
308 308
309 309
310// void PPPData::set_iconify_on_connect(bool set) { 310// void PPPData::set_iconify_on_connect(bool set) {
311// writeConfig(GENERAL_GRP, ICONIFY_ON_CONNECT_KEY, (int) set); 311// writeConfig(GENERAL_GRP, ICONIFY_ON_CONNECT_KEY, (int) set);
312// } 312// }
313 313
314 314
315// bool PPPData::get_dock_into_panel() { 315// bool PPPData::get_dock_into_panel() {
316// return (bool) readNumConfig(GENERAL_GRP, DOCKING_KEY, false); 316// return (bool) readNumConfig(GENERAL_GRP, DOCKING_KEY, false);
317// } 317// }
318 318
319 319
320// void PPPData::set_dock_into_panel(bool set) { 320// void PPPData::set_dock_into_panel(bool set) {
321// writeConfig(GENERAL_GRP, DOCKING_KEY, (int) set); 321// writeConfig(GENERAL_GRP, DOCKING_KEY, (int) set);
322// } 322// }
323 323
324 324
325QString PPPData::pppdVersion() { 325QString PPPData::pppdVersion() {
326 return QString("%1.%2.%3").arg(pppdVer).arg(pppdMod).arg(pppdPatch); 326 return QString("%1.%2.%3").arg(pppdVer).arg(pppdMod).arg(pppdPatch);
327} 327}
328 328
329bool PPPData::pppdVersionMin(int ver, int mod, int patch) { 329bool PPPData::pppdVersionMin(int ver, int mod, int patch) {
330 // check if pppd version fulfills minimum requirement 330 // check if pppd version fulfills minimum requirement
331 return (pppdVer > ver 331 return (pppdVer > ver
332 || (pppdVer == ver && pppdMod > mod) 332 || (pppdVer == ver && pppdMod > mod)
333 || (pppdVer == ver && pppdMod == mod && pppdPatch >= patch)); 333 || (pppdVer == ver && pppdMod == mod && pppdPatch >= patch));
334} 334}
335 335
336int PPPData::pppdTimeout() { 336int PPPData::pppdTimeout() {
337 return readNumConfig(GENERAL_GRP, PPPDTIMEOUT_KEY, PPPD_TIMEOUT); 337 return readNumConfig(GENERAL_GRP, PPPDTIMEOUT_KEY, PPPD_TIMEOUT);
338} 338}
339 339
340 340
341void PPPData::setpppdTimeout(int n) { 341void PPPData::setpppdTimeout(int n) {
342 writeConfig(GENERAL_GRP, PPPDTIMEOUT_KEY, n); 342 writeConfig(GENERAL_GRP, PPPDTIMEOUT_KEY, n);
343} 343}
344 344
345 345
346const QString PPPData::modemDevice() { 346const QString PPPData::modemDevice() {
347 return readConfig (modemGroup(), MODEMDEV_KEY, devices[DEV_DEFAULT]); 347 return readConfig (modemGroup(), MODEMDEV_KEY, devices[DEV_DEFAULT]);
348} 348}
349 349
350 350
351bool PPPData::setModemDevice(const QString &n) { 351bool PPPData::setModemDevice(const QString &n) {
352 qDebug("Setting modem dev to >%s<", n.latin1()); 352 qDebug("Setting modem dev to >%s<", n.latin1());
353 bool ret = false; 353 bool ret = false;
354 for (int i = 0; devices[i]; i++) 354 for (int i = 0; devices[i]; i++)
355 if (devices[i] == n){ 355 if (devices[i] == n){
356 modemDeviceGroup = i; 356 modemDeviceGroup = i;
357 writeConfig(modemGroup(), MODEMDEV_KEY, n); 357 writeConfig(modemGroup(), MODEMDEV_KEY, n);
358 ret = true; 358 ret = true;
359 } 359 }
360 qDebug(ret?"SUCCESS":"FAILURE"); 360 qDebug(ret?"SUCCESS":"FAILURE");
361 return ret; 361 return ret;
362} 362}
363 363
364 364
365const QString PPPData::flowcontrol() { 365const QString PPPData::flowcontrol() {
366 return readConfig(modemGroup(), FLOWCONTROL_KEY, "CRTSCTS"); 366 return readConfig(modemGroup(), FLOWCONTROL_KEY, "CRTSCTS");
367} 367}
368 368
369 369
370void PPPData::setFlowcontrol(const QString &n) { 370void PPPData::setFlowcontrol(const QString &n) {
371 writeConfig(modemGroup(), FLOWCONTROL_KEY, n); 371 writeConfig(modemGroup(), FLOWCONTROL_KEY, n);
372} 372}
373 373
374 374
375const QString PPPData::speed() { 375const QString PPPData::speed() {
376 QString s = readConfig(modemGroup(), SPEED_KEY, "57600"); 376 QString s = readConfig(modemGroup(), SPEED_KEY, "57600");
377 // undo the damage of a bug in former versions. It left an empty Speed= 377 // undo the damage of a bug in former versions. It left an empty Speed=
378 // entry in kppprc. kppp did set the serial port to 57600 as default but 378 // entry in kppprc. kppp did set the serial port to 57600 as default but
379 // pppd wouldn't receive the speed via the command line. 379 // pppd wouldn't receive the speed via the command line.
380 if(s.toUInt() == 0) 380 if(s.toUInt() == 0)
381 s = "57600"; 381 s = "57600";
382 return s; 382 return s;
383} 383}
384 384
385 385
386void PPPData::setSpeed(const QString &n) { 386void PPPData::setSpeed(const QString &n) {
387 writeConfig(modemGroup(), SPEED_KEY, n); 387 writeConfig(modemGroup(), SPEED_KEY, n);
388} 388}
389 389
390 390
391#if 0 391#if 0
392void PPPData::setUseCDLine(const int n) { 392void PPPData::setUseCDLine(const int n) {
393 writeConfig(modemGroup(),USECDLINE_KEY,n); 393 writeConfig(modemGroup(),USECDLINE_KEY,n);
394} 394}
395 395
396 396
397int PPPData::UseCDLine() { 397int PPPData::UseCDLine() {
398 return readNumConfig(modemGroup(),USECDLINE_KEY,0); 398 return readNumConfig(modemGroup(),USECDLINE_KEY,0);
399} 399}
400#endif 400#endif
401 401
402const QString PPPData::modemEscapeStr() { 402const QString PPPData::modemEscapeStr() {
403 return readConfig(modemGroup(),ESCAPESTR_KEY,"+++"); 403 return readConfig(modemGroup(),ESCAPESTR_KEY,"+++");
404} 404}
405 405
406 406
407void PPPData::setModemEscapeStr(const QString &n) { 407void PPPData::setModemEscapeStr(const QString &n) {
408 writeConfig(modemGroup(),ESCAPESTR_KEY,n); 408 writeConfig(modemGroup(),ESCAPESTR_KEY,n);
409} 409}
410 410
411 411
412const QString PPPData::modemEscapeResp() { 412const QString PPPData::modemEscapeResp() {
413 return readConfig(modemGroup(),ESCAPERESP_KEY,"OK"); 413 return readConfig(modemGroup(),ESCAPERESP_KEY,"OK");
414} 414}
415 415
416 416
417void PPPData::setModemEscapeResp(const QString &n) { 417void PPPData::setModemEscapeResp(const QString &n) {
418 writeConfig(modemGroup(),ESCAPERESP_KEY,n); 418 writeConfig(modemGroup(),ESCAPERESP_KEY,n);
419} 419}
420 420
421 421
422int PPPData::modemEscapeGuardTime() { 422int PPPData::modemEscapeGuardTime() {
423 return readNumConfig(modemGroup(),ESCAPEGUARDTIME_KEY,50); 423 return readNumConfig(modemGroup(),ESCAPEGUARDTIME_KEY,50);
424} 424}
425 425
426 426
427void PPPData::setModemEscapeGuardTime(int n) { 427void PPPData::setModemEscapeGuardTime(int n) {
428 writeConfig(modemGroup(),ESCAPEGUARDTIME_KEY,n); 428 writeConfig(modemGroup(),ESCAPEGUARDTIME_KEY,n);
429} 429}
430 430
431 431
432bool PPPData::modemLockFile() { 432bool PPPData::modemLockFile() {
433 return readNumConfig(modemGroup(), LOCKFILE_KEY, 1); 433 return readNumConfig(modemGroup(), LOCKFILE_KEY, 1);
434} 434}
435 435
436 436
437void PPPData::setModemLockFile(bool set) { 437void PPPData::setModemLockFile(bool set) {
438 writeConfig(modemGroup(), LOCKFILE_KEY, set); 438 writeConfig(modemGroup(), LOCKFILE_KEY, set);
439} 439}
440 440
441 441
442int PPPData::modemTimeout() { 442int PPPData::modemTimeout() {
443 return readNumConfig(modemGroup(), TIMEOUT_KEY, MODEM_TIMEOUT); 443 return readNumConfig(modemGroup(), TIMEOUT_KEY, MODEM_TIMEOUT);
444} 444}
445 445
446 446
447void PPPData::setModemTimeout(int n) { 447void PPPData::setModemTimeout(int n) {
448 writeConfig(modemGroup(), TIMEOUT_KEY, n); 448 writeConfig(modemGroup(), TIMEOUT_KEY, n);
449} 449}
450 450
451 451
452int PPPData::modemToneDuration() { 452int PPPData::modemToneDuration() {
453 return readNumConfig(modemGroup(), TONEDURATION_KEY,MODEM_TONEDURATION); 453 return readNumConfig(modemGroup(), TONEDURATION_KEY,MODEM_TONEDURATION);
454} 454}
455 455
456 456
457void PPPData::setModemToneDuration(int n) { 457void PPPData::setModemToneDuration(int n) {
458 writeConfig(modemGroup(), TONEDURATION_KEY, n); 458 writeConfig(modemGroup(), TONEDURATION_KEY, n);
459} 459}
460 460
461 461
462int PPPData::busyWait() { 462int PPPData::busyWait() {
463 return readNumConfig(modemGroup(), BUSYWAIT_KEY, BUSY_WAIT); 463 return readNumConfig(modemGroup(), BUSYWAIT_KEY, BUSY_WAIT);
464} 464}
465 465
466 466
467void PPPData::setbusyWait(int n) { 467void PPPData::setbusyWait(int n) {
468 writeConfig(modemGroup(), BUSYWAIT_KEY, n); 468 writeConfig(modemGroup(), BUSYWAIT_KEY, n);
469} 469}
470 470
471 471
472// 472//
473//Advanced "Modem" dialog 473//Advanced "Modem" dialog
474// 474//
475// defaults: InitString=ATZ, InitString1="" etc. 475// defaults: InitString=ATZ, InitString1="" etc.
476const QString PPPData::modemInitStr(int i) { 476const QString PPPData::modemInitStr(int i) {
477 assert(i >= 0 && i < NumInitStrings); 477 assert(i >= 0 && i < NumInitStrings);
478 if(i == 0) 478 if(i == 0)
479 return readConfig(modemGroup(), INITSTR_KEY, "ATZ"); 479 return readConfig(modemGroup(), INITSTR_KEY, "ATZ");
480 else 480 else
481 return readConfig(modemGroup(), INITSTR_KEY + QString::number(i), ""); 481 return readConfig(modemGroup(), INITSTR_KEY + QString::number(i), "");
482} 482}
483 483
484 484
485void PPPData::setModemInitStr(int i, const QString &n) { 485void PPPData::setModemInitStr(int i, const QString &n) {
486 assert(i >= 0 && i < NumInitStrings); 486 assert(i >= 0 && i < NumInitStrings);
487 QString k = INITSTR_KEY + (i > 0 ? QString::number(i) : ""); 487 QString k = INITSTR_KEY + (i > 0 ? QString::number(i) : QString(""));
488 writeConfig(modemGroup(), k, n); 488 writeConfig(modemGroup(), k, n);
489} 489}
490 490
491 491
492const QString PPPData::modemInitResp() { 492const QString PPPData::modemInitResp() {
493 return readConfig(modemGroup(), INITRESP_KEY, "OK"); 493 return readConfig(modemGroup(), INITRESP_KEY, "OK");
494} 494}
495 495
496 496
497void PPPData::setModemInitResp(const QString &n) { 497void PPPData::setModemInitResp(const QString &n) {
498 writeConfig(modemGroup(), INITRESP_KEY, n); 498 writeConfig(modemGroup(), INITRESP_KEY, n);
499} 499}
500 500
501 501
502int PPPData::modemPreInitDelay() { 502int PPPData::modemPreInitDelay() {
503 return readNumConfig(modemGroup(), PREINITDELAY_KEY, 50); 503 return readNumConfig(modemGroup(), PREINITDELAY_KEY, 50);
504} 504}
505 505
506 506
507void PPPData::setModemPreInitDelay(int n) { 507void PPPData::setModemPreInitDelay(int n) {
508 writeConfig(modemGroup(), PREINITDELAY_KEY, n); 508 writeConfig(modemGroup(), PREINITDELAY_KEY, n);
509} 509}
510 510
511 511
512int PPPData::modemInitDelay() { 512int PPPData::modemInitDelay() {
513 return readNumConfig(modemGroup(), INITDELAY_KEY, 50); 513 return readNumConfig(modemGroup(), INITDELAY_KEY, 50);
514} 514}
515 515
516 516
517void PPPData::setModemInitDelay(int n) { 517void PPPData::setModemInitDelay(int n) {
518 writeConfig(modemGroup(), INITDELAY_KEY, n); 518 writeConfig(modemGroup(), INITDELAY_KEY, n);
519} 519}
520 520
521QString PPPData::modemNoDialToneDetectionStr() { 521QString PPPData::modemNoDialToneDetectionStr() {
522 return readConfig(modemGroup(), NODTDETECT_KEY, "ATX3"); 522 return readConfig(modemGroup(), NODTDETECT_KEY, "ATX3");
523} 523}
524 524
525void PPPData::setModemNoDialToneDetectionStr(const QString &n) { 525void PPPData::setModemNoDialToneDetectionStr(const QString &n) {
526 writeConfig(modemGroup(), NODTDETECT_KEY, n); 526 writeConfig(modemGroup(), NODTDETECT_KEY, n);
527} 527}
528 528
529const QString PPPData::modemDialStr() { 529const QString PPPData::modemDialStr() {
530 return readConfig(modemGroup(), DIALSTR_KEY, "ATDT"); 530 return readConfig(modemGroup(), DIALSTR_KEY, "ATDT");
531} 531}
532 532
533 533
534void PPPData::setModemDialStr(const QString &n) { 534void PPPData::setModemDialStr(const QString &n) {
535 writeConfig(modemGroup(), DIALSTR_KEY, n); 535 writeConfig(modemGroup(), DIALSTR_KEY, n);
536} 536}
537 537
538 538
539const QString PPPData::modemConnectResp() { 539const QString PPPData::modemConnectResp() {
540 return readConfig(modemGroup(), CONNECTRESP_KEY, "CONNECT"); 540 return readConfig(modemGroup(), CONNECTRESP_KEY, "CONNECT");
541} 541}
542 542
543 543
544void PPPData::setModemConnectResp(const QString &n) { 544void PPPData::setModemConnectResp(const QString &n) {
545 writeConfig(modemGroup(), CONNECTRESP_KEY, n); 545 writeConfig(modemGroup(), CONNECTRESP_KEY, n);
546} 546}
547 547
548 548
549const QString PPPData::modemBusyResp() { 549const QString PPPData::modemBusyResp() {
550 return readConfig(modemGroup(), BUSYRESP_KEY, "BUSY"); 550 return readConfig(modemGroup(), BUSYRESP_KEY, "BUSY");
551} 551}
552 552
553 553
554void PPPData::setModemBusyResp(const QString &n) { 554void PPPData::setModemBusyResp(const QString &n) {
555 writeConfig(modemGroup(), BUSYRESP_KEY, n); 555 writeConfig(modemGroup(), BUSYRESP_KEY, n);
556} 556}
557 557
558 558
559const QString PPPData::modemNoCarrierResp() { 559const QString PPPData::modemNoCarrierResp() {
560 return readConfig(modemGroup(), NOCARRIERRESP_KEY, "NO CARRIER"); 560 return readConfig(modemGroup(), NOCARRIERRESP_KEY, "NO CARRIER");
561} 561}
562 562
563 563
564void PPPData::setModemNoCarrierResp(const QString &n) { 564void PPPData::setModemNoCarrierResp(const QString &n) {
565 writeConfig(modemGroup(), NOCARRIERRESP_KEY, n); 565 writeConfig(modemGroup(), NOCARRIERRESP_KEY, n);
566} 566}
567 567
568 568
569const QString PPPData::modemNoDialtoneResp() { 569const QString PPPData::modemNoDialtoneResp() {
570 return readConfig(modemGroup(), NODIALTONERESP_KEY, "NO DIALTONE"); 570 return readConfig(modemGroup(), NODIALTONERESP_KEY, "NO DIALTONE");
571} 571}
572 572
573 573
574void PPPData::setModemNoDialtoneResp(const QString &n) { 574void PPPData::setModemNoDialtoneResp(const QString &n) {
575 writeConfig(modemGroup(), NODIALTONERESP_KEY, n); 575 writeConfig(modemGroup(), NODIALTONERESP_KEY, n);
576} 576}
577 577
578 578
579const QString PPPData::modemHangupStr() { 579const QString PPPData::modemHangupStr() {
580 return readConfig(modemGroup(), HANGUPSTR_KEY, "+++ATH"); 580 return readConfig(modemGroup(), HANGUPSTR_KEY, "+++ATH");
581} 581}
582 582
583void PPPData::setModemHangupStr(const QString &n) { 583void PPPData::setModemHangupStr(const QString &n) {
584 writeConfig(modemGroup(), HANGUPSTR_KEY, n); 584 writeConfig(modemGroup(), HANGUPSTR_KEY, n);
585} 585}
586 586
587 587
588const QString PPPData::modemHangupResp() { 588const QString PPPData::modemHangupResp() {
589 return readConfig(modemGroup(), HANGUPRESP_KEY, "OK"); 589 return readConfig(modemGroup(), HANGUPRESP_KEY, "OK");
590} 590}
591 591
592void PPPData::setModemHangupResp(const QString &n) { 592void PPPData::setModemHangupResp(const QString &n) {
593 writeConfig(modemGroup(), HANGUPRESP_KEY, n); 593 writeConfig(modemGroup(), HANGUPRESP_KEY, n);
594} 594}
595 595
596 596
597const QString PPPData::modemAnswerStr() { 597const QString PPPData::modemAnswerStr() {
598 return readConfig(modemGroup(), ANSWERSTR_KEY, "ATA"); 598 return readConfig(modemGroup(), ANSWERSTR_KEY, "ATA");
599} 599}
600 600
601 601
602QString PPPData::volumeOff() { 602QString PPPData::volumeOff() {
603 return readConfig(modemGroup(), VOLUME_OFF, "M0L0"); 603 return readConfig(modemGroup(), VOLUME_OFF, "M0L0");
604} 604}
605 605
606 606
607void PPPData::setVolumeOff(const QString &s) { 607void PPPData::setVolumeOff(const QString &s) {
608 writeConfig(modemGroup(), VOLUME_OFF, s); 608 writeConfig(modemGroup(), VOLUME_OFF, s);
609} 609}
610 610
611 611
612QString PPPData::volumeMedium() { 612QString PPPData::volumeMedium() {
613 return readConfig(modemGroup(), VOLUME_MEDIUM, "M1L1"); 613 return readConfig(modemGroup(), VOLUME_MEDIUM, "M1L1");
614} 614}
615 615
616 616
617void PPPData::setVolumeMedium(const QString &s) { 617void PPPData::setVolumeMedium(const QString &s) {
618 writeConfig(modemGroup(), VOLUME_MEDIUM, s); 618 writeConfig(modemGroup(), VOLUME_MEDIUM, s);
619} 619}
620 620
621 621
622QString PPPData::volumeHigh() { 622QString PPPData::volumeHigh() {
623 QString tmp = readConfig(modemGroup(), VOLUME_HIGH, "M1L3"); 623 QString tmp = readConfig(modemGroup(), VOLUME_HIGH, "M1L3");
624 if(tmp == "M1L4") 624 if(tmp == "M1L4")
625 tmp = "M1L3"; 625 tmp = "M1L3";
626 return tmp; 626 return tmp;
627} 627}
628 628
629 629
630void PPPData::setVolumeHigh(const QString &s) { 630void PPPData::setVolumeHigh(const QString &s) {
631 writeConfig(modemGroup(), VOLUME_HIGH, s); 631 writeConfig(modemGroup(), VOLUME_HIGH, s);
632} 632}
633 633
634 634
635QString PPPData::volumeInitString() { 635QString PPPData::volumeInitString() {
636 QString s; 636 QString s;
637 637
638 switch(volume()) { 638 switch(volume()) {
639 case 0: 639 case 0:
640 s = volumeOff(); 640 s = volumeOff();
641 break; 641 break;
642 case 1: 642 case 1:
643 s = volumeMedium(); 643 s = volumeMedium();
644 break; 644 break;
645 case 2: 645 case 2:
646 s = volumeHigh(); 646 s = volumeHigh();
647 break; 647 break;
648 default: 648 default:
649 s = volumeMedium(); 649 s = volumeMedium();
650 } 650 }
651 651
652 return s; 652 return s;
653} 653}
654 654
655 655
656int PPPData::volume() { 656int PPPData::volume() {
657 return readNumConfig(modemGroup(), VOLUME_KEY, 1); 657 return readNumConfig(modemGroup(), VOLUME_KEY, 1);
658} 658}
659 659
660 660
661void PPPData::setVolume(int i) { 661void PPPData::setVolume(int i) {
662 writeConfig(modemGroup(), VOLUME_KEY, i); 662 writeConfig(modemGroup(), VOLUME_KEY, i);
663} 663}
664 664
665int PPPData::waitForDialTone() { 665int PPPData::waitForDialTone() {
666 return readNumConfig(modemGroup(), DIALTONEWAIT_KEY, 1); 666 return readNumConfig(modemGroup(), DIALTONEWAIT_KEY, 1);
667} 667}
668 668
669void PPPData::setWaitForDialTone(int i) { 669void PPPData::setWaitForDialTone(int i) {
670 writeConfig(modemGroup(), DIALTONEWAIT_KEY, i); 670 writeConfig(modemGroup(), DIALTONEWAIT_KEY, i);
671} 671}
672 672
673void PPPData::setModemAnswerStr(const QString &n) { 673void PPPData::setModemAnswerStr(const QString &n) {
674 writeConfig(modemGroup(), ANSWERSTR_KEY, n); 674 writeConfig(modemGroup(), ANSWERSTR_KEY, n);
675} 675}
676 676
677 677
678const QString PPPData::modemRingResp() { 678const QString PPPData::modemRingResp() {
679 return readConfig(modemGroup(), RINGRESP_KEY, "RING"); 679 return readConfig(modemGroup(), RINGRESP_KEY, "RING");
680} 680}
681 681
682 682
683void PPPData::setModemRingResp(const QString &n) { 683void PPPData::setModemRingResp(const QString &n) {
684 writeConfig(modemGroup(), RINGRESP_KEY, n); 684 writeConfig(modemGroup(), RINGRESP_KEY, n);
685} 685}
686 686
687 687
688const QString PPPData::modemAnswerResp() { 688const QString PPPData::modemAnswerResp() {
689 return readConfig(modemGroup(), ANSWERRESP_KEY, "CONNECT"); 689 return readConfig(modemGroup(), ANSWERRESP_KEY, "CONNECT");
690} 690}
691 691
692 692
693void PPPData::setModemAnswerResp(const QString &n) { 693void PPPData::setModemAnswerResp(const QString &n) {
694 writeConfig(modemGroup(), ANSWERRESP_KEY, n); 694 writeConfig(modemGroup(), ANSWERRESP_KEY, n);
695} 695}
696 696
697 697
698const QString PPPData::enter() { 698const QString PPPData::enter() {
699 return readConfig(modemGroup(), ENTER_KEY, "CR"); 699 return readConfig(modemGroup(), ENTER_KEY, "CR");
700} 700}
701 701
702 702
703void PPPData::setEnter(const QString &n) { 703void PPPData::setEnter(const QString &n) {
704 writeConfig(modemGroup(), ENTER_KEY, n); 704 writeConfig(modemGroup(), ENTER_KEY, n);
705} 705}
706 706
707 707
708// 708//
709// functions to set/return account information 709// functions to set/return account information
710// 710//
711 711
712//returns number of accounts 712//returns number of accounts
713int PPPData::count() const { 713int PPPData::count() const {
714 return highcount + 1; 714 return highcount + 1;
715} 715}
716 716
717 717
718bool PPPData::setAccount(const QString &aname) { 718bool PPPData::setAccount(const QString &aname) {
719 qDebug("setting account to >%s<", aname.latin1()); 719 qDebug("setting account to >%s<", aname.latin1());
720 for(int i = 0; i <= highcount; i++) { 720 for(int i = 0; i <= highcount; i++) {
721 setAccountbyIndex(i); 721 setAccountbyIndex(i);
722 if(accname() == aname) { 722 if(accname() == aname) {
723 caccount = i; 723 caccount = i;
724 qDebug("SUCCESS"); 724 qDebug("SUCCESS");
725 return true; 725 return true;
726 } 726 }
727 } 727 }
728 qDebug("FAILURE"); 728 qDebug("FAILURE");
729 return false; 729 return false;
730} 730}
731 731
732 732
733bool PPPData::setAccountbyIndex(int i) { 733bool PPPData::setAccountbyIndex(int i) {
734 if(i >= 0 && i <= highcount) { 734 if(i >= 0 && i <= highcount) {
735 caccount = i; 735 caccount = i;
736 cgroup.sprintf("%s%i", ACCOUNT_GRP, i); 736 cgroup.sprintf("%s%i", ACCOUNT_GRP, i);
737 return true; 737 return true;
738 } 738 }
739 return false; 739 return false;
740} 740}
741 741
742 742
743bool PPPData::isUniqueAccname(const QString &n) { 743bool PPPData::isUniqueAccname(const QString &n) {