author | tille <tille> | 2003-06-06 13:38:57 (UTC) |
---|---|---|
committer | tille <tille> | 2003-06-06 13:38:57 (UTC) |
commit | 225486a1c3714b4b0c0e60286df13d8ede029768 (patch) (unidiff) | |
tree | a49c0faa1d439308ebb60181e1cd5afd5479d092 | |
parent | d3e9154252841f3adcfbd9868e263475fc698ebb (diff) | |
download | opie-225486a1c3714b4b0c0e60286df13d8ede029768.zip opie-225486a1c3714b4b0c0e60286df13d8ede029768.tar.gz opie-225486a1c3714b4b0c0e60286df13d8ede029768.tar.bz2 |
more arm fixes..
-rw-r--r-- | noncore/settings/networksettings/ppp/pppdata.cpp | 2 |
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 | ||
232 | const QString PPPData::defaultAccount() { | 232 | const QString PPPData::defaultAccount() { |
233 | return readConfig(GENERAL_GRP, DEFAULTACCOUNT_KEY); | 233 | return readConfig(GENERAL_GRP, DEFAULTACCOUNT_KEY); |
234 | } | 234 | } |
235 | 235 | ||
236 | 236 | ||
237 | void PPPData::setDefaultAccount(const QString &n) { | 237 | void 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 | ||
245 | bool PPPData::get_show_clock_on_caption() { | 245 | bool 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 | ||
250 | void PPPData::set_show_clock_on_caption(bool set) { | 250 | void 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 | ||
255 | bool PPPData::get_xserver_exit_disconnect() { | 255 | bool 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 | ||
260 | void PPPData::setPPPDebug(bool set) { | 260 | void 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 | ||
265 | bool PPPData::getPPPDebug() { | 265 | bool 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 | ||
270 | void PPPData::set_xserver_exit_disconnect(bool set) { | 270 | void 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 | ||
275 | bool PPPData::quit_on_disconnect() { | 275 | bool 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 | ||
280 | void PPPData::set_quit_on_disconnect(bool set) { | 280 | void 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 | ||
285 | bool PPPData::get_show_log_window() { | 285 | bool 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 | ||
290 | void PPPData::set_show_log_window(bool set) { | 290 | void 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 | ||
295 | bool PPPData::automatic_redial() { | 295 | bool 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 | ||
300 | void PPPData::set_automatic_redial(bool set) { | 300 | void 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 | ||
325 | QString PPPData::pppdVersion() { | 325 | QString 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 | ||
329 | bool PPPData::pppdVersionMin(int ver, int mod, int patch) { | 329 | bool 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 | ||
336 | int PPPData::pppdTimeout() { | 336 | int 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 | ||
341 | void PPPData::setpppdTimeout(int n) { | 341 | void PPPData::setpppdTimeout(int n) { |
342 | writeConfig(GENERAL_GRP, PPPDTIMEOUT_KEY, n); | 342 | writeConfig(GENERAL_GRP, PPPDTIMEOUT_KEY, n); |
343 | } | 343 | } |
344 | 344 | ||
345 | 345 | ||
346 | const QString PPPData::modemDevice() { | 346 | const 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 | ||
351 | bool PPPData::setModemDevice(const QString &n) { | 351 | bool 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 | ||
365 | const QString PPPData::flowcontrol() { | 365 | const QString PPPData::flowcontrol() { |
366 | return readConfig(modemGroup(), FLOWCONTROL_KEY, "CRTSCTS"); | 366 | return readConfig(modemGroup(), FLOWCONTROL_KEY, "CRTSCTS"); |
367 | } | 367 | } |
368 | 368 | ||
369 | 369 | ||
370 | void PPPData::setFlowcontrol(const QString &n) { | 370 | void PPPData::setFlowcontrol(const QString &n) { |
371 | writeConfig(modemGroup(), FLOWCONTROL_KEY, n); | 371 | writeConfig(modemGroup(), FLOWCONTROL_KEY, n); |
372 | } | 372 | } |
373 | 373 | ||
374 | 374 | ||
375 | const QString PPPData::speed() { | 375 | const 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 | ||
386 | void PPPData::setSpeed(const QString &n) { | 386 | void 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 |
392 | void PPPData::setUseCDLine(const int n) { | 392 | void PPPData::setUseCDLine(const int n) { |
393 | writeConfig(modemGroup(),USECDLINE_KEY,n); | 393 | writeConfig(modemGroup(),USECDLINE_KEY,n); |
394 | } | 394 | } |
395 | 395 | ||
396 | 396 | ||
397 | int PPPData::UseCDLine() { | 397 | int PPPData::UseCDLine() { |
398 | return readNumConfig(modemGroup(),USECDLINE_KEY,0); | 398 | return readNumConfig(modemGroup(),USECDLINE_KEY,0); |
399 | } | 399 | } |
400 | #endif | 400 | #endif |
401 | 401 | ||
402 | const QString PPPData::modemEscapeStr() { | 402 | const QString PPPData::modemEscapeStr() { |
403 | return readConfig(modemGroup(),ESCAPESTR_KEY,"+++"); | 403 | return readConfig(modemGroup(),ESCAPESTR_KEY,"+++"); |
404 | } | 404 | } |
405 | 405 | ||
406 | 406 | ||
407 | void PPPData::setModemEscapeStr(const QString &n) { | 407 | void PPPData::setModemEscapeStr(const QString &n) { |
408 | writeConfig(modemGroup(),ESCAPESTR_KEY,n); | 408 | writeConfig(modemGroup(),ESCAPESTR_KEY,n); |
409 | } | 409 | } |
410 | 410 | ||
411 | 411 | ||
412 | const QString PPPData::modemEscapeResp() { | 412 | const QString PPPData::modemEscapeResp() { |
413 | return readConfig(modemGroup(),ESCAPERESP_KEY,"OK"); | 413 | return readConfig(modemGroup(),ESCAPERESP_KEY,"OK"); |
414 | } | 414 | } |
415 | 415 | ||
416 | 416 | ||
417 | void PPPData::setModemEscapeResp(const QString &n) { | 417 | void PPPData::setModemEscapeResp(const QString &n) { |
418 | writeConfig(modemGroup(),ESCAPERESP_KEY,n); | 418 | writeConfig(modemGroup(),ESCAPERESP_KEY,n); |
419 | } | 419 | } |
420 | 420 | ||
421 | 421 | ||
422 | int PPPData::modemEscapeGuardTime() { | 422 | int PPPData::modemEscapeGuardTime() { |
423 | return readNumConfig(modemGroup(),ESCAPEGUARDTIME_KEY,50); | 423 | return readNumConfig(modemGroup(),ESCAPEGUARDTIME_KEY,50); |
424 | } | 424 | } |
425 | 425 | ||
426 | 426 | ||
427 | void PPPData::setModemEscapeGuardTime(int n) { | 427 | void PPPData::setModemEscapeGuardTime(int n) { |
428 | writeConfig(modemGroup(),ESCAPEGUARDTIME_KEY,n); | 428 | writeConfig(modemGroup(),ESCAPEGUARDTIME_KEY,n); |
429 | } | 429 | } |
430 | 430 | ||
431 | 431 | ||
432 | bool PPPData::modemLockFile() { | 432 | bool PPPData::modemLockFile() { |
433 | return readNumConfig(modemGroup(), LOCKFILE_KEY, 1); | 433 | return readNumConfig(modemGroup(), LOCKFILE_KEY, 1); |
434 | } | 434 | } |
435 | 435 | ||
436 | 436 | ||
437 | void PPPData::setModemLockFile(bool set) { | 437 | void PPPData::setModemLockFile(bool set) { |
438 | writeConfig(modemGroup(), LOCKFILE_KEY, set); | 438 | writeConfig(modemGroup(), LOCKFILE_KEY, set); |
439 | } | 439 | } |
440 | 440 | ||
441 | 441 | ||
442 | int PPPData::modemTimeout() { | 442 | int PPPData::modemTimeout() { |
443 | return readNumConfig(modemGroup(), TIMEOUT_KEY, MODEM_TIMEOUT); | 443 | return readNumConfig(modemGroup(), TIMEOUT_KEY, MODEM_TIMEOUT); |
444 | } | 444 | } |
445 | 445 | ||
446 | 446 | ||
447 | void PPPData::setModemTimeout(int n) { | 447 | void PPPData::setModemTimeout(int n) { |
448 | writeConfig(modemGroup(), TIMEOUT_KEY, n); | 448 | writeConfig(modemGroup(), TIMEOUT_KEY, n); |
449 | } | 449 | } |
450 | 450 | ||
451 | 451 | ||
452 | int PPPData::modemToneDuration() { | 452 | int PPPData::modemToneDuration() { |
453 | return readNumConfig(modemGroup(), TONEDURATION_KEY,MODEM_TONEDURATION); | 453 | return readNumConfig(modemGroup(), TONEDURATION_KEY,MODEM_TONEDURATION); |
454 | } | 454 | } |
455 | 455 | ||
456 | 456 | ||
457 | void PPPData::setModemToneDuration(int n) { | 457 | void PPPData::setModemToneDuration(int n) { |
458 | writeConfig(modemGroup(), TONEDURATION_KEY, n); | 458 | writeConfig(modemGroup(), TONEDURATION_KEY, n); |
459 | } | 459 | } |
460 | 460 | ||
461 | 461 | ||
462 | int PPPData::busyWait() { | 462 | int PPPData::busyWait() { |
463 | return readNumConfig(modemGroup(), BUSYWAIT_KEY, BUSY_WAIT); | 463 | return readNumConfig(modemGroup(), BUSYWAIT_KEY, BUSY_WAIT); |
464 | } | 464 | } |
465 | 465 | ||
466 | 466 | ||
467 | void PPPData::setbusyWait(int n) { | 467 | void 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. |
476 | const QString PPPData::modemInitStr(int i) { | 476 | const 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 | ||
485 | void PPPData::setModemInitStr(int i, const QString &n) { | 485 | void 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 | ||
492 | const QString PPPData::modemInitResp() { | 492 | const QString PPPData::modemInitResp() { |
493 | return readConfig(modemGroup(), INITRESP_KEY, "OK"); | 493 | return readConfig(modemGroup(), INITRESP_KEY, "OK"); |
494 | } | 494 | } |
495 | 495 | ||
496 | 496 | ||
497 | void PPPData::setModemInitResp(const QString &n) { | 497 | void PPPData::setModemInitResp(const QString &n) { |
498 | writeConfig(modemGroup(), INITRESP_KEY, n); | 498 | writeConfig(modemGroup(), INITRESP_KEY, n); |
499 | } | 499 | } |
500 | 500 | ||
501 | 501 | ||
502 | int PPPData::modemPreInitDelay() { | 502 | int PPPData::modemPreInitDelay() { |
503 | return readNumConfig(modemGroup(), PREINITDELAY_KEY, 50); | 503 | return readNumConfig(modemGroup(), PREINITDELAY_KEY, 50); |
504 | } | 504 | } |
505 | 505 | ||
506 | 506 | ||
507 | void PPPData::setModemPreInitDelay(int n) { | 507 | void PPPData::setModemPreInitDelay(int n) { |
508 | writeConfig(modemGroup(), PREINITDELAY_KEY, n); | 508 | writeConfig(modemGroup(), PREINITDELAY_KEY, n); |
509 | } | 509 | } |
510 | 510 | ||
511 | 511 | ||
512 | int PPPData::modemInitDelay() { | 512 | int PPPData::modemInitDelay() { |
513 | return readNumConfig(modemGroup(), INITDELAY_KEY, 50); | 513 | return readNumConfig(modemGroup(), INITDELAY_KEY, 50); |
514 | } | 514 | } |
515 | 515 | ||
516 | 516 | ||
517 | void PPPData::setModemInitDelay(int n) { | 517 | void PPPData::setModemInitDelay(int n) { |
518 | writeConfig(modemGroup(), INITDELAY_KEY, n); | 518 | writeConfig(modemGroup(), INITDELAY_KEY, n); |
519 | } | 519 | } |
520 | 520 | ||
521 | QString PPPData::modemNoDialToneDetectionStr() { | 521 | QString PPPData::modemNoDialToneDetectionStr() { |
522 | return readConfig(modemGroup(), NODTDETECT_KEY, "ATX3"); | 522 | return readConfig(modemGroup(), NODTDETECT_KEY, "ATX3"); |
523 | } | 523 | } |
524 | 524 | ||
525 | void PPPData::setModemNoDialToneDetectionStr(const QString &n) { | 525 | void PPPData::setModemNoDialToneDetectionStr(const QString &n) { |
526 | writeConfig(modemGroup(), NODTDETECT_KEY, n); | 526 | writeConfig(modemGroup(), NODTDETECT_KEY, n); |
527 | } | 527 | } |
528 | 528 | ||
529 | const QString PPPData::modemDialStr() { | 529 | const QString PPPData::modemDialStr() { |
530 | return readConfig(modemGroup(), DIALSTR_KEY, "ATDT"); | 530 | return readConfig(modemGroup(), DIALSTR_KEY, "ATDT"); |
531 | } | 531 | } |
532 | 532 | ||
533 | 533 | ||
534 | void PPPData::setModemDialStr(const QString &n) { | 534 | void PPPData::setModemDialStr(const QString &n) { |
535 | writeConfig(modemGroup(), DIALSTR_KEY, n); | 535 | writeConfig(modemGroup(), DIALSTR_KEY, n); |
536 | } | 536 | } |
537 | 537 | ||
538 | 538 | ||
539 | const QString PPPData::modemConnectResp() { | 539 | const QString PPPData::modemConnectResp() { |
540 | return readConfig(modemGroup(), CONNECTRESP_KEY, "CONNECT"); | 540 | return readConfig(modemGroup(), CONNECTRESP_KEY, "CONNECT"); |
541 | } | 541 | } |
542 | 542 | ||
543 | 543 | ||
544 | void PPPData::setModemConnectResp(const QString &n) { | 544 | void PPPData::setModemConnectResp(const QString &n) { |
545 | writeConfig(modemGroup(), CONNECTRESP_KEY, n); | 545 | writeConfig(modemGroup(), CONNECTRESP_KEY, n); |
546 | } | 546 | } |
547 | 547 | ||
548 | 548 | ||
549 | const QString PPPData::modemBusyResp() { | 549 | const QString PPPData::modemBusyResp() { |
550 | return readConfig(modemGroup(), BUSYRESP_KEY, "BUSY"); | 550 | return readConfig(modemGroup(), BUSYRESP_KEY, "BUSY"); |
551 | } | 551 | } |
552 | 552 | ||
553 | 553 | ||
554 | void PPPData::setModemBusyResp(const QString &n) { | 554 | void PPPData::setModemBusyResp(const QString &n) { |
555 | writeConfig(modemGroup(), BUSYRESP_KEY, n); | 555 | writeConfig(modemGroup(), BUSYRESP_KEY, n); |
556 | } | 556 | } |
557 | 557 | ||
558 | 558 | ||
559 | const QString PPPData::modemNoCarrierResp() { | 559 | const 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 | ||
564 | void PPPData::setModemNoCarrierResp(const QString &n) { | 564 | void PPPData::setModemNoCarrierResp(const QString &n) { |
565 | writeConfig(modemGroup(), NOCARRIERRESP_KEY, n); | 565 | writeConfig(modemGroup(), NOCARRIERRESP_KEY, n); |
566 | } | 566 | } |
567 | 567 | ||
568 | 568 | ||
569 | const QString PPPData::modemNoDialtoneResp() { | 569 | const 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 | ||
574 | void PPPData::setModemNoDialtoneResp(const QString &n) { | 574 | void PPPData::setModemNoDialtoneResp(const QString &n) { |
575 | writeConfig(modemGroup(), NODIALTONERESP_KEY, n); | 575 | writeConfig(modemGroup(), NODIALTONERESP_KEY, n); |
576 | } | 576 | } |
577 | 577 | ||
578 | 578 | ||
579 | const QString PPPData::modemHangupStr() { | 579 | const QString PPPData::modemHangupStr() { |
580 | return readConfig(modemGroup(), HANGUPSTR_KEY, "+++ATH"); | 580 | return readConfig(modemGroup(), HANGUPSTR_KEY, "+++ATH"); |
581 | } | 581 | } |
582 | 582 | ||
583 | void PPPData::setModemHangupStr(const QString &n) { | 583 | void PPPData::setModemHangupStr(const QString &n) { |
584 | writeConfig(modemGroup(), HANGUPSTR_KEY, n); | 584 | writeConfig(modemGroup(), HANGUPSTR_KEY, n); |
585 | } | 585 | } |
586 | 586 | ||
587 | 587 | ||
588 | const QString PPPData::modemHangupResp() { | 588 | const QString PPPData::modemHangupResp() { |
589 | return readConfig(modemGroup(), HANGUPRESP_KEY, "OK"); | 589 | return readConfig(modemGroup(), HANGUPRESP_KEY, "OK"); |
590 | } | 590 | } |
591 | 591 | ||
592 | void PPPData::setModemHangupResp(const QString &n) { | 592 | void PPPData::setModemHangupResp(const QString &n) { |
593 | writeConfig(modemGroup(), HANGUPRESP_KEY, n); | 593 | writeConfig(modemGroup(), HANGUPRESP_KEY, n); |
594 | } | 594 | } |
595 | 595 | ||
596 | 596 | ||
597 | const QString PPPData::modemAnswerStr() { | 597 | const QString PPPData::modemAnswerStr() { |
598 | return readConfig(modemGroup(), ANSWERSTR_KEY, "ATA"); | 598 | return readConfig(modemGroup(), ANSWERSTR_KEY, "ATA"); |
599 | } | 599 | } |
600 | 600 | ||
601 | 601 | ||
602 | QString PPPData::volumeOff() { | 602 | QString PPPData::volumeOff() { |
603 | return readConfig(modemGroup(), VOLUME_OFF, "M0L0"); | 603 | return readConfig(modemGroup(), VOLUME_OFF, "M0L0"); |
604 | } | 604 | } |
605 | 605 | ||
606 | 606 | ||
607 | void PPPData::setVolumeOff(const QString &s) { | 607 | void PPPData::setVolumeOff(const QString &s) { |
608 | writeConfig(modemGroup(), VOLUME_OFF, s); | 608 | writeConfig(modemGroup(), VOLUME_OFF, s); |
609 | } | 609 | } |
610 | 610 | ||
611 | 611 | ||
612 | QString PPPData::volumeMedium() { | 612 | QString PPPData::volumeMedium() { |
613 | return readConfig(modemGroup(), VOLUME_MEDIUM, "M1L1"); | 613 | return readConfig(modemGroup(), VOLUME_MEDIUM, "M1L1"); |
614 | } | 614 | } |
615 | 615 | ||
616 | 616 | ||
617 | void PPPData::setVolumeMedium(const QString &s) { | 617 | void PPPData::setVolumeMedium(const QString &s) { |
618 | writeConfig(modemGroup(), VOLUME_MEDIUM, s); | 618 | writeConfig(modemGroup(), VOLUME_MEDIUM, s); |
619 | } | 619 | } |
620 | 620 | ||
621 | 621 | ||
622 | QString PPPData::volumeHigh() { | 622 | QString 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 | ||
630 | void PPPData::setVolumeHigh(const QString &s) { | 630 | void PPPData::setVolumeHigh(const QString &s) { |
631 | writeConfig(modemGroup(), VOLUME_HIGH, s); | 631 | writeConfig(modemGroup(), VOLUME_HIGH, s); |
632 | } | 632 | } |
633 | 633 | ||
634 | 634 | ||
635 | QString PPPData::volumeInitString() { | 635 | QString 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 | ||
656 | int PPPData::volume() { | 656 | int PPPData::volume() { |
657 | return readNumConfig(modemGroup(), VOLUME_KEY, 1); | 657 | return readNumConfig(modemGroup(), VOLUME_KEY, 1); |
658 | } | 658 | } |
659 | 659 | ||
660 | 660 | ||
661 | void PPPData::setVolume(int i) { | 661 | void PPPData::setVolume(int i) { |
662 | writeConfig(modemGroup(), VOLUME_KEY, i); | 662 | writeConfig(modemGroup(), VOLUME_KEY, i); |
663 | } | 663 | } |
664 | 664 | ||
665 | int PPPData::waitForDialTone() { | 665 | int PPPData::waitForDialTone() { |
666 | return readNumConfig(modemGroup(), DIALTONEWAIT_KEY, 1); | 666 | return readNumConfig(modemGroup(), DIALTONEWAIT_KEY, 1); |
667 | } | 667 | } |
668 | 668 | ||
669 | void PPPData::setWaitForDialTone(int i) { | 669 | void PPPData::setWaitForDialTone(int i) { |
670 | writeConfig(modemGroup(), DIALTONEWAIT_KEY, i); | 670 | writeConfig(modemGroup(), DIALTONEWAIT_KEY, i); |
671 | } | 671 | } |
672 | 672 | ||
673 | void PPPData::setModemAnswerStr(const QString &n) { | 673 | void PPPData::setModemAnswerStr(const QString &n) { |
674 | writeConfig(modemGroup(), ANSWERSTR_KEY, n); | 674 | writeConfig(modemGroup(), ANSWERSTR_KEY, n); |
675 | } | 675 | } |
676 | 676 | ||
677 | 677 | ||
678 | const QString PPPData::modemRingResp() { | 678 | const QString PPPData::modemRingResp() { |
679 | return readConfig(modemGroup(), RINGRESP_KEY, "RING"); | 679 | return readConfig(modemGroup(), RINGRESP_KEY, "RING"); |
680 | } | 680 | } |
681 | 681 | ||
682 | 682 | ||
683 | void PPPData::setModemRingResp(const QString &n) { | 683 | void PPPData::setModemRingResp(const QString &n) { |
684 | writeConfig(modemGroup(), RINGRESP_KEY, n); | 684 | writeConfig(modemGroup(), RINGRESP_KEY, n); |
685 | } | 685 | } |
686 | 686 | ||
687 | 687 | ||
688 | const QString PPPData::modemAnswerResp() { | 688 | const QString PPPData::modemAnswerResp() { |
689 | return readConfig(modemGroup(), ANSWERRESP_KEY, "CONNECT"); | 689 | return readConfig(modemGroup(), ANSWERRESP_KEY, "CONNECT"); |
690 | } | 690 | } |
691 | 691 | ||
692 | 692 | ||
693 | void PPPData::setModemAnswerResp(const QString &n) { | 693 | void PPPData::setModemAnswerResp(const QString &n) { |
694 | writeConfig(modemGroup(), ANSWERRESP_KEY, n); | 694 | writeConfig(modemGroup(), ANSWERRESP_KEY, n); |
695 | } | 695 | } |
696 | 696 | ||
697 | 697 | ||
698 | const QString PPPData::enter() { | 698 | const QString PPPData::enter() { |
699 | return readConfig(modemGroup(), ENTER_KEY, "CR"); | 699 | return readConfig(modemGroup(), ENTER_KEY, "CR"); |
700 | } | 700 | } |
701 | 701 | ||
702 | 702 | ||
703 | void PPPData::setEnter(const QString &n) { | 703 | void 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 |
713 | int PPPData::count() const { | 713 | int PPPData::count() const { |
714 | return highcount + 1; | 714 | return highcount + 1; |
715 | } | 715 | } |
716 | 716 | ||
717 | 717 | ||
718 | bool PPPData::setAccount(const QString &aname) { | 718 | bool 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 | ||
733 | bool PPPData::setAccountbyIndex(int i) { | 733 | bool 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 | ||
743 | bool PPPData::isUniqueAccname(const QString &n) { | 743 | bool PPPData::isUniqueAccname(const QString &n) { |