author | tille <tille> | 2003-05-24 16:12:02 (UTC) |
---|---|---|
committer | tille <tille> | 2003-05-24 16:12:02 (UTC) |
commit | cc1aa3e178dff65854913bd5667579fc33ce707d (patch) (unidiff) | |
tree | d37d7fd8fb3b9832c0825b015af862f2cc62f473 /noncore/settings/networksettings/ppp/kpppwidget.cpp | |
parent | 5667ded1d4583cfb79b2ddfd7aaae0e58ed6d552 (diff) | |
download | opie-cc1aa3e178dff65854913bd5667579fc33ce707d.zip opie-cc1aa3e178dff65854913bd5667579fc33ce707d.tar.gz opie-cc1aa3e178dff65854913bd5667579fc33ce707d.tar.bz2 |
saves config (still in the kppp way)
Diffstat (limited to 'noncore/settings/networksettings/ppp/kpppwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/kpppwidget.cpp | 150 |
1 files changed, 75 insertions, 75 deletions
diff --git a/noncore/settings/networksettings/ppp/kpppwidget.cpp b/noncore/settings/networksettings/ppp/kpppwidget.cpp index 2f9feda..8d70cd4 100644 --- a/noncore/settings/networksettings/ppp/kpppwidget.cpp +++ b/noncore/settings/networksettings/ppp/kpppwidget.cpp | |||
@@ -160,3 +160,3 @@ KPPPWidget::KPPPWidget( QWidget *parent, const char *name, bool modal, WFlags fl | |||
160 | // this, SLOT(log_window_toggled(bool))); | 160 | // this, SLOT(log_window_toggled(bool))); |
161 | // log->setChecked(gpppdata.get_show_log_window()); | 161 | // log->setChecked(PPPData::data()->get_show_log_window()); |
162 | // l3->addWidget(log); | 162 | // l3->addWidget(log); |
@@ -193,3 +193,3 @@ KPPPWidget::KPPPWidget( QWidget *parent, const char *name, bool modal, WFlags fl | |||
193 | 193 | ||
194 | // if(gpppdata.access() != KConfig::ReadWrite) | 194 | // if(PPPData::data()->access() != KConfig::ReadWrite) |
195 | // setup_b->setEnabled(false); | 195 | // setup_b->setEnabled(false); |
@@ -293,3 +293,3 @@ KPPPWidget::KPPPWidget( QWidget *parent, const char *name, bool modal, WFlags fl | |||
293 | // if(m_bCmdlAccount){ | 293 | // if(m_bCmdlAccount){ |
294 | // bool result = gpppdata.setAccount(m_strCmdlAccount); | 294 | // bool result = PPPData::data()->setAccount(m_strCmdlAccount); |
295 | // if (!result){ | 295 | // if (!result){ |
@@ -365,3 +365,3 @@ void KPPPWidget::enterPressedInPW() { | |||
365 | void KPPPWidget::saveMyself() { | 365 | void KPPPWidget::saveMyself() { |
366 | gpppdata.save(); | 366 | PPPData::data()->save(); |
367 | } | 367 | } |
@@ -374,3 +374,3 @@ void KPPPWidget::shutDown() { | |||
374 | void KPPPWidget::log_window_toggled(bool on) { | 374 | void KPPPWidget::log_window_toggled(bool on) { |
375 | gpppdata.set_show_log_window(on); | 375 | PPPData::data()->set_show_log_window(on); |
376 | } | 376 | } |
@@ -383,3 +383,3 @@ void KPPPWidget::log_window_toggled(bool on) { | |||
383 | 383 | ||
384 | // int count = gpppdata.count(); | 384 | // int count = PPPData::data()->count(); |
385 | 385 | ||
@@ -394,4 +394,4 @@ void KPPPWidget::log_window_toggled(bool on) { | |||
394 | // for(int i=0; i < count; i++) { | 394 | // for(int i=0; i < count; i++) { |
395 | // gpppdata.setAccountbyIndex(i); | 395 | // PPPData::data()->setAccountbyIndex(i); |
396 | // connectto_c->insertItem(gpppdata.accname()); | 396 | // connectto_c->insertItem(PPPData::data()->accname()); |
397 | // } | 397 | // } |
@@ -399,10 +399,10 @@ void KPPPWidget::log_window_toggled(bool on) { | |||
399 | // //set the default account | 399 | // //set the default account |
400 | // if(!gpppdata.defaultAccount().isEmpty()) { | 400 | // if(!PPPData::data()->defaultAccount().isEmpty()) { |
401 | // for(int i=0; i < count; i++) | 401 | // for(int i=0; i < count; i++) |
402 | // if(gpppdata.defaultAccount() == connectto_c->text(i)) { | 402 | // if(PPPData::data()->defaultAccount() == connectto_c->text(i)) { |
403 | // connectto_c->setCurrentItem(i); | 403 | // connectto_c->setCurrentItem(i); |
404 | // gpppdata.setAccountbyIndex(i); | 404 | // PPPData::data()->setAccountbyIndex(i); |
405 | 405 | ||
406 | // ID_Edit->setText(gpppdata.storedUsername()); | 406 | // ID_Edit->setText(PPPData::data()->storedUsername()); |
407 | // PW_Edit->setText(gpppdata.storedPassword()); | 407 | // PW_Edit->setText(PPPData::data()->storedPassword()); |
408 | // } | 408 | // } |
@@ -411,6 +411,6 @@ void KPPPWidget::log_window_toggled(bool on) { | |||
411 | // if(count > 0) { | 411 | // if(count > 0) { |
412 | // gpppdata.setDefaultAccount(connectto_c->text(0)); | 412 | // PPPData::data()->setDefaultAccount(connectto_c->text(0)); |
413 | // gpppdata.save(); | 413 | // PPPData::data()->save(); |
414 | // ID_Edit->setText(gpppdata.storedUsername()); | 414 | // ID_Edit->setText(PPPData::data()->storedUsername()); |
415 | // PW_Edit->setText(gpppdata.storedPassword()); | 415 | // PW_Edit->setText(PPPData::data()->storedPassword()); |
416 | // } | 416 | // } |
@@ -436,3 +436,3 @@ void KPPPWidget::interruptConnection() { | |||
436 | // disconnect if online | 436 | // disconnect if online |
437 | if (gpppdata.pppdRunning()) | 437 | if (PPPData::data()->pppdRunning()) |
438 | emit disconnect(); | 438 | emit disconnect(); |
@@ -447,3 +447,3 @@ void KPPPWidget::sigPPPDDied() { | |||
447 | // such as would be the case when the log file viewer exits. | 447 | // such as would be the case when the log file viewer exits. |
448 | if(gpppdata.pppdRunning() || gpppdata.pppdError()) { | 448 | if(PPPData::data()->pppdRunning() || PPPData::data()->pppdError()) { |
449 | qDebug( "It was pppd that died" ); | 449 | qDebug( "It was pppd that died" ); |
@@ -459,3 +459,3 @@ void KPPPWidget::sigPPPDDied() { | |||
459 | 459 | ||
460 | gpppdata.setpppdRunning(false); | 460 | PPPData::data()->setpppdRunning(false); |
461 | 461 | ||
@@ -463,3 +463,3 @@ void KPPPWidget::sigPPPDDied() { | |||
463 | QApplication::flushX(); | 463 | QApplication::flushX(); |
464 | execute_command(gpppdata.command_on_disconnect()); | 464 | execute_command(PPPData::data()->command_on_disconnect()); |
465 | 465 | ||
@@ -471,4 +471,4 @@ void KPPPWidget::sigPPPDDied() { | |||
471 | 471 | ||
472 | if(!gpppdata.pppdError()) | 472 | if(!PPPData::data()->pppdError()) |
473 | gpppdata.setpppdError(E_PPPD_DIED); | 473 | PPPData::data()->setpppdError(E_PPPD_DIED); |
474 | removedns(); | 474 | removedns(); |
@@ -477,3 +477,3 @@ void KPPPWidget::sigPPPDDied() { | |||
477 | 477 | ||
478 | if(!gpppdata.automatic_redial()) { | 478 | if(!PPPData::data()->automatic_redial()) { |
479 | quit_b->setFocus(); | 479 | quit_b->setFocus(); |
@@ -485,6 +485,6 @@ void KPPPWidget::sigPPPDDied() { | |||
485 | 485 | ||
486 | gpppdata.setpppdRunning(false); | 486 | PPPData::data()->setpppdRunning(false); |
487 | // // not in a signal handler !!! KNotifyClient::beep(); | 487 | // // not in a signal handler !!! KNotifyClient::beep(); |
488 | QString msg; | 488 | QString msg; |
489 | if (gpppdata.pppdError() == E_IF_TIMEOUT) | 489 | if (PPPData::data()->pppdError() == E_IF_TIMEOUT) |
490 | msg = i18n("Timeout expired while waiting for the PPP interface " | 490 | msg = i18n("Timeout expired while waiting for the PPP interface " |
@@ -509,8 +509,8 @@ void KPPPWidget::sigPPPDDied() { | |||
509 | 509 | ||
510 | if(gpppdata.authMethod() == AUTH_PAP || | 510 | if(PPPData::data()->authMethod() == AUTH_PAP || |
511 | gpppdata.authMethod() == AUTH_CHAP || | 511 | PPPData::data()->authMethod() == AUTH_CHAP || |
512 | gpppdata.authMethod() == AUTH_PAPCHAP) | 512 | PPPData::data()->authMethod() == AUTH_PAPCHAP) |
513 | Modem::modem->setSecret(gpppdata.authMethod(), | 513 | Modem::modem->setSecret(PPPData::data()->authMethod(), |
514 | encodeWord(gpppdata.storedUsername()), | 514 | encodeWord(PPPData::data()->storedUsername()), |
515 | encodeWord(gpppdata.password())); | 515 | encodeWord(PPPData::data()->password())); |
516 | 516 | ||
@@ -519,3 +519,3 @@ void KPPPWidget::sigPPPDDied() { | |||
519 | //stopAccounting(); | 519 | //stopAccounting(); |
520 | gpppdata.setpppdRunning(false); | 520 | PPPData::data()->setpppdRunning(false); |
521 | // not in a signal handler !!!KNotifyClient::beep(); | 521 | // not in a signal handler !!!KNotifyClient::beep(); |
@@ -524,3 +524,3 @@ void KPPPWidget::sigPPPDDied() { | |||
524 | } | 524 | } |
525 | gpppdata.setpppdError(0); | 525 | PPPData::data()->setpppdError(0); |
526 | } | 526 | } |
@@ -545,6 +545,6 @@ void KPPPWidget::sigPPPDDied() { | |||
545 | void KPPPWidget::newdefaultaccount(int i) { | 545 | void KPPPWidget::newdefaultaccount(int i) { |
546 | gpppdata.setDefaultAccount(connectto_c->text(i)); | 546 | PPPData::data()->setDefaultAccount(connectto_c->text(i)); |
547 | gpppdata.save(); | 547 | PPPData::data()->save(); |
548 | ID_Edit->setText(gpppdata.storedUsername()); | 548 | ID_Edit->setText(PPPData::data()->storedUsername()); |
549 | PW_Edit->setText(gpppdata.storedPassword()); | 549 | PW_Edit->setText(PPPData::data()->storedPassword()); |
550 | } | 550 | } |
@@ -558,6 +558,6 @@ void KPPPWidget::beginConnect() { | |||
558 | // if(!m_bCmdlAccount) { | 558 | // if(!m_bCmdlAccount) { |
559 | // gpppdata.setAccount(connectto_c->currentText()); | 559 | // PPPData::data()->setAccount(connectto_c->currentText()); |
560 | // gpppdata.setPassword(PW_Edit->text()); | 560 | // PPPData::data()->setPassword(PW_Edit->text()); |
561 | // } else { | 561 | // } else { |
562 | gpppdata.setPassword(gpppdata.storedPassword()); | 562 | PPPData::data()->setPassword(PPPData::data()->storedPassword()); |
563 | // } | 563 | // } |
@@ -579,3 +579,3 @@ void KPPPWidget::beginConnect() { | |||
579 | "setuid permission and that " | 579 | "setuid permission and that " |
580 | "pppd is executable.").arg(gpppdata.pppdPath()); | 580 | "pppd is executable.").arg(PPPData::data()->pppdPath()); |
581 | KMessageBox::error(this, string); | 581 | KMessageBox::error(this, string); |
@@ -586,3 +586,3 @@ void KPPPWidget::beginConnect() { | |||
586 | 586 | ||
587 | QFileInfo info2(gpppdata.modemDevice()); | 587 | QFileInfo info2(PPPData::data()->modemDevice()); |
588 | 588 | ||
@@ -594,3 +594,3 @@ void KPPPWidget::beginConnect() { | |||
594 | "the modem tab of " | 594 | "the modem tab of " |
595 | "the setup dialog.").arg(gpppdata.modemDevice()); | 595 | "the setup dialog.").arg(PPPData::data()->modemDevice()); |
596 | QMessageBox::warning(this, "error", string); | 596 | QMessageBox::warning(this, "error", string); |
@@ -601,5 +601,5 @@ void KPPPWidget::beginConnect() { | |||
601 | // supplied | 601 | // supplied |
602 | if(gpppdata.authMethod() == AUTH_PAP || | 602 | if(PPPData::data()->authMethod() == AUTH_PAP || |
603 | gpppdata.authMethod() == AUTH_CHAP || | 603 | PPPData::data()->authMethod() == AUTH_CHAP || |
604 | gpppdata.authMethod() == AUTH_PAPCHAP ) { | 604 | PPPData::data()->authMethod() == AUTH_PAPCHAP ) { |
605 | if(ID_Edit->text().isEmpty()) { | 605 | if(ID_Edit->text().isEmpty()) { |
@@ -612,5 +612,5 @@ void KPPPWidget::beginConnect() { | |||
612 | } else { | 612 | } else { |
613 | if(!Modem::modem->setSecret(gpppdata.authMethod(), | 613 | if(!Modem::modem->setSecret(PPPData::data()->authMethod(), |
614 | encodeWord(gpppdata.storedUsername()), | 614 | encodeWord(PPPData::data()->storedUsername()), |
615 | encodeWord(gpppdata.password()))) { | 615 | encodeWord(PPPData::data()->password()))) { |
616 | QString s; | 616 | QString s; |
@@ -624,3 +624,3 @@ void KPPPWidget::beginConnect() { | |||
624 | 624 | ||
625 | if (gpppdata.phonenumber().isEmpty()) { | 625 | if (PPPData::data()->phonenumber().isEmpty()) { |
626 | QString s = i18n("You must specify a telephone number!"); | 626 | QString s = i18n("You must specify a telephone number!"); |
@@ -632,3 +632,3 @@ void KPPPWidget::beginConnect() { | |||
632 | 632 | ||
633 | QString tit = i18n("Connecting to: %1").arg(gpppdata.accname()); | 633 | QString tit = i18n("Connecting to: %1").arg(PPPData::data()->accname()); |
634 | // con->setCaption(tit); | 634 | // con->setCaption(tit); |
@@ -637,3 +637,3 @@ void KPPPWidget::beginConnect() { | |||
637 | 637 | ||
638 | bool show_debug = gpppdata.get_show_log_window(); | 638 | bool show_debug = PPPData::data()->get_show_log_window(); |
639 | // con->debug->setOn(show_debug);// toggle button | 639 | // con->debug->setOn(show_debug);// toggle button |
@@ -652,3 +652,3 @@ void KPPPWidget::beginConnect() { | |||
652 | void KPPPWidget::disconnect() { | 652 | void KPPPWidget::disconnect() { |
653 | if (!gpppdata.command_before_disconnect().isEmpty()) { | 653 | if (!PPPData::data()->command_before_disconnect().isEmpty()) { |
654 | // con_win->hide(); | 654 | // con_win->hide(); |
@@ -661,3 +661,3 @@ void KPPPWidget::disconnect() { | |||
661 | // pid_t id = | 661 | // pid_t id = |
662 | execute_command(gpppdata.command_before_disconnect()); | 662 | execute_command(PPPData::data()->command_before_disconnect()); |
663 | // int i, status; | 663 | // int i, status; |
@@ -679,3 +679,3 @@ void KPPPWidget::disconnect() { | |||
679 | QApplication::flushX(); | 679 | QApplication::flushX(); |
680 | execute_command(gpppdata.command_on_disconnect()); | 680 | execute_command(PPPData::data()->command_on_disconnect()); |
681 | 681 | ||
@@ -709,3 +709,3 @@ void KPPPWidget::disconnect() { | |||
709 | void KPPPWidget::quitbutton() { | 709 | void KPPPWidget::quitbutton() { |
710 | if(gpppdata.pppdRunning()) { | 710 | if(PPPData::data()->pppdRunning()) { |
711 | int ok = QMessageBox::warning(this, | 711 | int ok = QMessageBox::warning(this, |
@@ -716,3 +716,3 @@ void KPPPWidget::quitbutton() { | |||
716 | QApplication::flushX(); | 716 | QApplication::flushX(); |
717 | execute_command(gpppdata.command_on_disconnect()); | 717 | execute_command(PPPData::data()->command_on_disconnect()); |
718 | removedns(); | 718 | removedns(); |
@@ -721,6 +721,6 @@ void KPPPWidget::quitbutton() { | |||
721 | } else { | 721 | } else { |
722 | if (!gpppdata.accname().isEmpty() && !gpppdata.storePassword()) | 722 | if (!PPPData::data()->accname().isEmpty() && !PPPData::data()->storePassword()) |
723 | gpppdata.setStoredPassword(""); | 723 | PPPData::data()->setStoredPassword(""); |
724 | } | 724 | } |
725 | gpppdata.save(); | 725 | PPPData::data()->save(); |
726 | qApp->quit(); | 726 | qApp->quit(); |
@@ -738,9 +738,9 @@ void KPPPWidget::quitbutton() { | |||
738 | 738 | ||
739 | // kdDebug() << "AcctEnabled: " << gpppdata.AcctEnabled() << endl; | 739 | // kdDebug() << "AcctEnabled: " << PPPData::data()->AcctEnabled() << endl; |
740 | 740 | ||
741 | // // load the ruleset | 741 | // // load the ruleset |
742 | // if(!gpppdata.AcctEnabled()) | 742 | // if(!PPPData::data()->AcctEnabled()) |
743 | // return; | 743 | // return; |
744 | 744 | ||
745 | // QString d = AccountingBase::getAccountingFile(gpppdata.accountingFile()); | 745 | // QString d = AccountingBase::getAccountingFile(PPPData::data()->accountingFile()); |
746 | // // if(::access(d.data(), X_OK) != 0) | 746 | // // if(::access(d.data(), X_OK) != 0) |
@@ -754,5 +754,5 @@ void KPPPWidget::quitbutton() { | |||
754 | 754 | ||
755 | // // if(!acct->loadRuleSet(gpppdata.accountingFile())) { | 755 | // // if(!acct->loadRuleSet(PPPData::data()->accountingFile())) { |
756 | // // QString s= i18n("Can not load the accounting " | 756 | // // QString s= i18n("Can not load the accounting " |
757 | // // "ruleset \"%1\"!").arg(gpppdata.accountingFile()); | 757 | // // "ruleset \"%1\"!").arg(PPPData::data()->accountingFile()); |
758 | 758 | ||
@@ -771,5 +771,5 @@ void KPPPWidget::quitbutton() { | |||
771 | // // if(stats->totalbytes != 0) | 771 | // // if(stats->totalbytes != 0) |
772 | // // gpppdata.setTotalBytes(stats->totalbytes); | 772 | // // PPPData::data()->setTotalBytes(stats->totalbytes); |
773 | 773 | ||
774 | // if(!gpppdata.AcctEnabled()) | 774 | // if(!PPPData::data()->AcctEnabled()) |
775 | // return; | 775 | // return; |
@@ -794,3 +794,3 @@ void KPPPWidget::usernameChanged(const QString &) { | |||
794 | // store username for later use | 794 | // store username for later use |
795 | gpppdata.setStoredUsername(ID_Edit->text()); | 795 | PPPData::data()->setStoredUsername(ID_Edit->text()); |
796 | } | 796 | } |
@@ -800,6 +800,6 @@ void KPPPWidget::passwordChanged(const QString &) { | |||
800 | // store the password if so requested | 800 | // store the password if so requested |
801 | if(gpppdata.storePassword()) | 801 | if(PPPData::data()->storePassword()) |
802 | gpppdata.setStoredPassword(PW_Edit->text()); | 802 | PPPData::data()->setStoredPassword(PW_Edit->text()); |
803 | else | 803 | else |
804 | gpppdata.setStoredPassword(""); | 804 | PPPData::data()->setStoredPassword(""); |
805 | } | 805 | } |
@@ -843,3 +843,3 @@ void KPPPWidget::showNews() { | |||
843 | #define QUICKHELP_HINT "Hint_QuickHelp" | 843 | #define QUICKHELP_HINT "Hint_QuickHelp" |
844 | if(gpppdata.readNumConfig(GENERAL_GRP, QUICKHELP_HINT, 0) == 0) { | 844 | if(PPPData::data()->readNumConfig(GENERAL_GRP, QUICKHELP_HINT, 0) == 0) { |
845 | QDialog dlg(0, 0, true); | 845 | QDialog dlg(0, 0, true); |
@@ -895,4 +895,4 @@ void KPPPWidget::showNews() { | |||
895 | if(cb->isChecked()) { | 895 | if(cb->isChecked()) { |
896 | gpppdata.writeConfig(GENERAL_GRP, QUICKHELP_HINT, 1); | 896 | PPPData::data()->writeConfig(GENERAL_GRP, QUICKHELP_HINT, 1); |
897 | gpppdata.save(); | 897 | PPPData::data()->save(); |
898 | } | 898 | } |