summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/ppp/kpppwidget.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings/ppp/kpppwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/ppp/kpppwidget.cpp150
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
@@ -159,5 +159,5 @@ KPPPWidget::KPPPWidget( QWidget *parent, const char *name, bool modal, WFlags fl
159// connect(log, SIGNAL(toggled(bool)), 159// connect(log, SIGNAL(toggled(bool)),
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);
163 163
@@ -192,5 +192,5 @@ KPPPWidget::KPPPWidget( QWidget *parent, const char *name, bool modal, WFlags fl
192 192
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);
196 196
@@ -292,5 +292,5 @@ KPPPWidget::KPPPWidget( QWidget *parent, const char *name, bool modal, WFlags fl
292 292
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){
296// QString string; 296// QString string;
@@ -364,5 +364,5 @@ void KPPPWidget::enterPressedInPW() {
364// triggered by the session manager 364// triggered by the session manager
365void KPPPWidget::saveMyself() { 365void KPPPWidget::saveMyself() {
366 gpppdata.save(); 366 PPPData::data()->save();
367} 367}
368 368
@@ -373,5 +373,5 @@ void KPPPWidget::shutDown() {
373 373
374void KPPPWidget::log_window_toggled(bool on) { 374void KPPPWidget::log_window_toggled(bool on) {
375 gpppdata.set_show_log_window(on); 375 PPPData::data()->set_show_log_window(on);
376} 376}
377 377
@@ -382,5 +382,5 @@ void KPPPWidget::log_window_toggled(bool on) {
382// connectto_c->clear(); 382// connectto_c->clear();
383 383
384// int count = gpppdata.count(); 384// int count = PPPData::data()->count();
385 385
386// // enable/disable controls 386// // enable/disable controls
@@ -393,25 +393,25 @@ void KPPPWidget::log_window_toggled(bool on) {
393// //load the accounts 393// //load the accounts
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// }
398 398
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// }
409// } 409// }
410// else 410// else
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// }
417 417
@@ -435,5 +435,5 @@ void KPPPWidget::interruptConnection() {
435 435
436 // disconnect if online 436 // disconnect if online
437 if (gpppdata.pppdRunning()) 437 if (PPPData::data()->pppdRunning())
438 emit disconnect(); 438 emit disconnect();
439} 439}
@@ -446,5 +446,5 @@ void KPPPWidget::sigPPPDDied() {
446 // in the followin line to make sure that we don't raise a false alarm 446 // in the followin line to make sure that we don't raise a false alarm
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" );
450 450
@@ -458,9 +458,9 @@ void KPPPWidget::sigPPPDDied() {
458 Modem::modem->removeSecret(AUTH_CHAP); 458 Modem::modem->removeSecret(AUTH_CHAP);
459 459
460 gpppdata.setpppdRunning(false); 460 PPPData::data()->setpppdRunning(false);
461 461
462 qDebug( "Executing command on disconnect since pppd has died." ); 462 qDebug( "Executing command on disconnect since pppd has died." );
463 QApplication::flushX(); 463 QApplication::flushX();
464 execute_command(gpppdata.command_on_disconnect()); 464 execute_command(PPPData::data()->command_on_disconnect());
465 465
466// stopAccounting(); 466// stopAccounting();
@@ -470,11 +470,11 @@ void KPPPWidget::sigPPPDDied() {
470// DockWidget::dock_widget->hide(); 470// DockWidget::dock_widget->hide();
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();
475 Modem::modem->unlockdevice(); 475 Modem::modem->unlockdevice();
476 // con->pppdDied(); 476 // con->pppdDied();
477 477
478 if(!gpppdata.automatic_redial()) { 478 if(!PPPData::data()->automatic_redial()) {
479 quit_b->setFocus(); 479 quit_b->setFocus();
480 show(); 480 show();
@@ -484,8 +484,8 @@ void KPPPWidget::sigPPPDDied() {
484// con->hide(); 484// con->hide();
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 "
491 "to come up!"); 491 "to come up!");
@@ -508,20 +508,20 @@ void KPPPWidget::sigPPPDDied() {
508 qDebug( "Trying to reconnect... " ); 508 qDebug( "Trying to reconnect... " );
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
517// con_win->hide(); 517// con_win->hide();
518 // con_win->stopClock(); 518 // con_win->stopClock();
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();
522 emit cmdl_start(); 522 emit cmdl_start();
523 } 523 }
524 } 524 }
525 gpppdata.setpppdError(0); 525 PPPData::data()->setpppdError(0);
526 } 526 }
527} 527}
@@ -544,8 +544,8 @@ void KPPPWidget::sigPPPDDied() {
544 544
545void KPPPWidget::newdefaultaccount(int i) { 545void 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}
551 551
@@ -557,8 +557,8 @@ void KPPPWidget::beginConnect() {
557 // (exeption: an account given by a command line argument) 557 // (exeption: an account given by a command line argument)
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// }
564 564
@@ -578,5 +578,5 @@ void KPPPWidget::beginConnect() {
578 "Please make sure that you have given kppp " 578 "Please make sure that you have given kppp "
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);
582 return; 582 return;
@@ -585,5 +585,5 @@ void KPPPWidget::beginConnect() {
585#endif 585#endif
586 586
587 QFileInfo info2(gpppdata.modemDevice()); 587 QFileInfo info2(PPPData::data()->modemDevice());
588 588
589 if(!info2.exists()){ 589 if(!info2.exists()){
@@ -593,5 +593,5 @@ void KPPPWidget::beginConnect() {
593 "and/or adjust the location of the modem device on " 593 "and/or adjust the location of the modem device on "
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);
597 return; 597 return;
@@ -600,7 +600,7 @@ void KPPPWidget::beginConnect() {
600 // if this is a PAP or CHAP account, ensure that username is 600 // if this is a PAP or CHAP account, ensure that username is
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()) {
606 QMessageBox::warning(this,"error", 606 QMessageBox::warning(this,"error",
@@ -611,7 +611,7 @@ void KPPPWidget::beginConnect() {
611 return; 611 return;
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;
617 s = i18n("Cannot create PAP/CHAP authentication\n" 617 s = i18n("Cannot create PAP/CHAP authentication\n"
@@ -623,5 +623,5 @@ void KPPPWidget::beginConnect() {
623 } 623 }
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!");
627 QMessageBox::warning(this, "error", s); 627 QMessageBox::warning(this, "error", s);
@@ -631,10 +631,10 @@ void KPPPWidget::beginConnect() {
631 this->hide(); 631 this->hide();
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);
635 635
636// con->show(); 636// con->show();
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
640 debugwindow->clear(); 640 debugwindow->clear();
@@ -651,5 +651,5 @@ void KPPPWidget::beginConnect() {
651 651
652void KPPPWidget::disconnect() { 652void 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();
655// con->show(); 655// con->show();
@@ -660,5 +660,5 @@ void KPPPWidget::disconnect() {
660 QApplication::flushX(); 660 QApplication::flushX();
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;
664 664
@@ -678,5 +678,5 @@ void KPPPWidget::disconnect() {
678 678
679 QApplication::flushX(); 679 QApplication::flushX();
680 execute_command(gpppdata.command_on_disconnect()); 680 execute_command(PPPData::data()->command_on_disconnect());
681 681
682 Modem::modem->removeSecret(AUTH_PAP); 682 Modem::modem->removeSecret(AUTH_PAP);
@@ -708,5 +708,5 @@ void KPPPWidget::disconnect() {
708 708
709void KPPPWidget::quitbutton() { 709void KPPPWidget::quitbutton() {
710 if(gpppdata.pppdRunning()) { 710 if(PPPData::data()->pppdRunning()) {
711 int ok = QMessageBox::warning(this, 711 int ok = QMessageBox::warning(this,
712 i18n("Exiting kPPP will close your PPP Session."), 712 i18n("Exiting kPPP will close your PPP Session."),
@@ -715,13 +715,13 @@ void KPPPWidget::quitbutton() {
715 Modem::modem->killPPPDaemon(); 715 Modem::modem->killPPPDaemon();
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();
719 Modem::modem->unlockdevice(); 719 Modem::modem->unlockdevice();
720 } 720 }
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();
727} 727}
@@ -737,11 +737,11 @@ void KPPPWidget::quitbutton() {
737// stats->totalbytes = 0; 737// stats->totalbytes = 0;
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)
747// acct = new Accounting(this, stats); 747// acct = new Accounting(this, stats);
@@ -753,7 +753,7 @@ void KPPPWidget::quitbutton() {
753 // con_win, SLOT(slotAccounting(QString, QString))); 753 // con_win, SLOT(slotAccounting(QString, QString)));
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
759// // starting the messagebox with a timer will prevent us 759// // starting the messagebox with a timer will prevent us
@@ -770,7 +770,7 @@ void KPPPWidget::quitbutton() {
770// // store volume accounting 770// // store volume accounting
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;
776 776
@@ -793,5 +793,5 @@ void KPPPWidget::quitbutton() {
793void KPPPWidget::usernameChanged(const QString &) { 793void 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}
797 797
@@ -799,8 +799,8 @@ void KPPPWidget::usernameChanged(const QString &) {
799void KPPPWidget::passwordChanged(const QString &) { 799void 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}
806 806
@@ -842,5 +842,5 @@ void KPPPWidget::showNews() {
842 */ 842 */
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);
846 dlg.setCaption(i18n("Recent Changes in KPPP")); 846 dlg.setCaption(i18n("Recent Changes in KPPP"));
@@ -894,6 +894,6 @@ void KPPPWidget::showNews() {
894 dlg.exec(); 894 dlg.exec();
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 }
899 } 899 }