author | tille <tille> | 2003-05-24 16:12:02 (UTC) |
---|---|---|
committer | tille <tille> | 2003-05-24 16:12:02 (UTC) |
commit | cc1aa3e178dff65854913bd5667579fc33ce707d (patch) (side-by-side diff) | |
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 // this, SLOT(log_window_toggled(bool))); -// log->setChecked(gpppdata.get_show_log_window()); +// log->setChecked(PPPData::data()->get_show_log_window()); // l3->addWidget(log); @@ -193,3 +193,3 @@ KPPPWidget::KPPPWidget( QWidget *parent, const char *name, bool modal, WFlags fl -// if(gpppdata.access() != KConfig::ReadWrite) +// if(PPPData::data()->access() != KConfig::ReadWrite) // setup_b->setEnabled(false); @@ -293,3 +293,3 @@ KPPPWidget::KPPPWidget( QWidget *parent, const char *name, bool modal, WFlags fl // if(m_bCmdlAccount){ -// bool result = gpppdata.setAccount(m_strCmdlAccount); +// bool result = PPPData::data()->setAccount(m_strCmdlAccount); // if (!result){ @@ -365,3 +365,3 @@ void KPPPWidget::enterPressedInPW() { void KPPPWidget::saveMyself() { - gpppdata.save(); + PPPData::data()->save(); } @@ -374,3 +374,3 @@ void KPPPWidget::shutDown() { void KPPPWidget::log_window_toggled(bool on) { - gpppdata.set_show_log_window(on); + PPPData::data()->set_show_log_window(on); } @@ -383,3 +383,3 @@ void KPPPWidget::log_window_toggled(bool on) { -// int count = gpppdata.count(); +// int count = PPPData::data()->count(); @@ -394,4 +394,4 @@ void KPPPWidget::log_window_toggled(bool on) { // for(int i=0; i < count; i++) { -// gpppdata.setAccountbyIndex(i); -// connectto_c->insertItem(gpppdata.accname()); +// PPPData::data()->setAccountbyIndex(i); +// connectto_c->insertItem(PPPData::data()->accname()); // } @@ -399,10 +399,10 @@ void KPPPWidget::log_window_toggled(bool on) { // //set the default account -// if(!gpppdata.defaultAccount().isEmpty()) { +// if(!PPPData::data()->defaultAccount().isEmpty()) { // for(int i=0; i < count; i++) -// if(gpppdata.defaultAccount() == connectto_c->text(i)) { +// if(PPPData::data()->defaultAccount() == connectto_c->text(i)) { // connectto_c->setCurrentItem(i); -// gpppdata.setAccountbyIndex(i); +// PPPData::data()->setAccountbyIndex(i); -// ID_Edit->setText(gpppdata.storedUsername()); -// PW_Edit->setText(gpppdata.storedPassword()); +// ID_Edit->setText(PPPData::data()->storedUsername()); +// PW_Edit->setText(PPPData::data()->storedPassword()); // } @@ -411,6 +411,6 @@ void KPPPWidget::log_window_toggled(bool on) { // if(count > 0) { -// gpppdata.setDefaultAccount(connectto_c->text(0)); -// gpppdata.save(); -// ID_Edit->setText(gpppdata.storedUsername()); -// PW_Edit->setText(gpppdata.storedPassword()); +// PPPData::data()->setDefaultAccount(connectto_c->text(0)); +// PPPData::data()->save(); +// ID_Edit->setText(PPPData::data()->storedUsername()); +// PW_Edit->setText(PPPData::data()->storedPassword()); // } @@ -436,3 +436,3 @@ void KPPPWidget::interruptConnection() { // disconnect if online - if (gpppdata.pppdRunning()) + if (PPPData::data()->pppdRunning()) emit disconnect(); @@ -447,3 +447,3 @@ void KPPPWidget::sigPPPDDied() { // such as would be the case when the log file viewer exits. - if(gpppdata.pppdRunning() || gpppdata.pppdError()) { + if(PPPData::data()->pppdRunning() || PPPData::data()->pppdError()) { qDebug( "It was pppd that died" ); @@ -459,3 +459,3 @@ void KPPPWidget::sigPPPDDied() { - gpppdata.setpppdRunning(false); + PPPData::data()->setpppdRunning(false); @@ -463,3 +463,3 @@ void KPPPWidget::sigPPPDDied() { QApplication::flushX(); - execute_command(gpppdata.command_on_disconnect()); + execute_command(PPPData::data()->command_on_disconnect()); @@ -471,4 +471,4 @@ void KPPPWidget::sigPPPDDied() { - if(!gpppdata.pppdError()) - gpppdata.setpppdError(E_PPPD_DIED); + if(!PPPData::data()->pppdError()) + PPPData::data()->setpppdError(E_PPPD_DIED); removedns(); @@ -477,3 +477,3 @@ void KPPPWidget::sigPPPDDied() { - if(!gpppdata.automatic_redial()) { + if(!PPPData::data()->automatic_redial()) { quit_b->setFocus(); @@ -485,6 +485,6 @@ void KPPPWidget::sigPPPDDied() { - gpppdata.setpppdRunning(false); + PPPData::data()->setpppdRunning(false); // // not in a signal handler !!! KNotifyClient::beep(); QString msg; - if (gpppdata.pppdError() == E_IF_TIMEOUT) + if (PPPData::data()->pppdError() == E_IF_TIMEOUT) msg = i18n("Timeout expired while waiting for the PPP interface " @@ -509,8 +509,8 @@ void KPPPWidget::sigPPPDDied() { - if(gpppdata.authMethod() == AUTH_PAP || - gpppdata.authMethod() == AUTH_CHAP || - gpppdata.authMethod() == AUTH_PAPCHAP) - Modem::modem->setSecret(gpppdata.authMethod(), - encodeWord(gpppdata.storedUsername()), - encodeWord(gpppdata.password())); + if(PPPData::data()->authMethod() == AUTH_PAP || + PPPData::data()->authMethod() == AUTH_CHAP || + PPPData::data()->authMethod() == AUTH_PAPCHAP) + Modem::modem->setSecret(PPPData::data()->authMethod(), + encodeWord(PPPData::data()->storedUsername()), + encodeWord(PPPData::data()->password())); @@ -519,3 +519,3 @@ void KPPPWidget::sigPPPDDied() { // stopAccounting(); - gpppdata.setpppdRunning(false); + PPPData::data()->setpppdRunning(false); // not in a signal handler !!! KNotifyClient::beep(); @@ -524,3 +524,3 @@ void KPPPWidget::sigPPPDDied() { } - gpppdata.setpppdError(0); + PPPData::data()->setpppdError(0); } @@ -545,6 +545,6 @@ void KPPPWidget::sigPPPDDied() { void KPPPWidget::newdefaultaccount(int i) { - gpppdata.setDefaultAccount(connectto_c->text(i)); - gpppdata.save(); - ID_Edit->setText(gpppdata.storedUsername()); - PW_Edit->setText(gpppdata.storedPassword()); + PPPData::data()->setDefaultAccount(connectto_c->text(i)); + PPPData::data()->save(); + ID_Edit->setText(PPPData::data()->storedUsername()); + PW_Edit->setText(PPPData::data()->storedPassword()); } @@ -558,6 +558,6 @@ void KPPPWidget::beginConnect() { // if(!m_bCmdlAccount) { -// gpppdata.setAccount(connectto_c->currentText()); -// gpppdata.setPassword(PW_Edit->text()); +// PPPData::data()->setAccount(connectto_c->currentText()); +// PPPData::data()->setPassword(PW_Edit->text()); // } else { - gpppdata.setPassword(gpppdata.storedPassword()); + PPPData::data()->setPassword(PPPData::data()->storedPassword()); // } @@ -579,3 +579,3 @@ void KPPPWidget::beginConnect() { "setuid permission and that " - "pppd is executable.").arg(gpppdata.pppdPath()); + "pppd is executable.").arg(PPPData::data()->pppdPath()); KMessageBox::error(this, string); @@ -586,3 +586,3 @@ void KPPPWidget::beginConnect() { - QFileInfo info2(gpppdata.modemDevice()); + QFileInfo info2(PPPData::data()->modemDevice()); @@ -594,3 +594,3 @@ void KPPPWidget::beginConnect() { "the modem tab of " - "the setup dialog.").arg(gpppdata.modemDevice()); + "the setup dialog.").arg(PPPData::data()->modemDevice()); QMessageBox::warning(this, "error", string); @@ -601,5 +601,5 @@ void KPPPWidget::beginConnect() { // supplied - if(gpppdata.authMethod() == AUTH_PAP || - gpppdata.authMethod() == AUTH_CHAP || - gpppdata.authMethod() == AUTH_PAPCHAP ) { + if(PPPData::data()->authMethod() == AUTH_PAP || + PPPData::data()->authMethod() == AUTH_CHAP || + PPPData::data()->authMethod() == AUTH_PAPCHAP ) { if(ID_Edit->text().isEmpty()) { @@ -612,5 +612,5 @@ void KPPPWidget::beginConnect() { } else { - if(!Modem::modem->setSecret(gpppdata.authMethod(), - encodeWord(gpppdata.storedUsername()), - encodeWord(gpppdata.password()))) { + if(!Modem::modem->setSecret(PPPData::data()->authMethod(), + encodeWord(PPPData::data()->storedUsername()), + encodeWord(PPPData::data()->password()))) { QString s; @@ -624,3 +624,3 @@ void KPPPWidget::beginConnect() { - if (gpppdata.phonenumber().isEmpty()) { + if (PPPData::data()->phonenumber().isEmpty()) { QString s = i18n("You must specify a telephone number!"); @@ -632,3 +632,3 @@ void KPPPWidget::beginConnect() { - QString tit = i18n("Connecting to: %1").arg(gpppdata.accname()); + QString tit = i18n("Connecting to: %1").arg(PPPData::data()->accname()); // con->setCaption(tit); @@ -637,3 +637,3 @@ void KPPPWidget::beginConnect() { - bool show_debug = gpppdata.get_show_log_window(); + bool show_debug = PPPData::data()->get_show_log_window(); // con->debug->setOn(show_debug); // toggle button @@ -652,3 +652,3 @@ void KPPPWidget::beginConnect() { void KPPPWidget::disconnect() { - if (!gpppdata.command_before_disconnect().isEmpty()) { + if (!PPPData::data()->command_before_disconnect().isEmpty()) { // con_win->hide(); @@ -661,3 +661,3 @@ void KPPPWidget::disconnect() { // pid_t id = - execute_command(gpppdata.command_before_disconnect()); + execute_command(PPPData::data()->command_before_disconnect()); // int i, status; @@ -679,3 +679,3 @@ void KPPPWidget::disconnect() { QApplication::flushX(); - execute_command(gpppdata.command_on_disconnect()); + execute_command(PPPData::data()->command_on_disconnect()); @@ -709,3 +709,3 @@ void KPPPWidget::disconnect() { void KPPPWidget::quitbutton() { - if(gpppdata.pppdRunning()) { + if(PPPData::data()->pppdRunning()) { int ok = QMessageBox::warning(this, @@ -716,3 +716,3 @@ void KPPPWidget::quitbutton() { QApplication::flushX(); - execute_command(gpppdata.command_on_disconnect()); + execute_command(PPPData::data()->command_on_disconnect()); removedns(); @@ -721,6 +721,6 @@ void KPPPWidget::quitbutton() { } else { - if (!gpppdata.accname().isEmpty() && !gpppdata.storePassword()) - gpppdata.setStoredPassword(""); + if (!PPPData::data()->accname().isEmpty() && !PPPData::data()->storePassword()) + PPPData::data()->setStoredPassword(""); } - gpppdata.save(); + PPPData::data()->save(); qApp->quit(); @@ -738,9 +738,9 @@ void KPPPWidget::quitbutton() { -// kdDebug() << "AcctEnabled: " << gpppdata.AcctEnabled() << endl; +// kdDebug() << "AcctEnabled: " << PPPData::data()->AcctEnabled() << endl; // // load the ruleset -// if(!gpppdata.AcctEnabled()) +// if(!PPPData::data()->AcctEnabled()) // return; -// QString d = AccountingBase::getAccountingFile(gpppdata.accountingFile()); +// QString d = AccountingBase::getAccountingFile(PPPData::data()->accountingFile()); // // if(::access(d.data(), X_OK) != 0) @@ -754,5 +754,5 @@ void KPPPWidget::quitbutton() { -// // if(!acct->loadRuleSet(gpppdata.accountingFile())) { +// // if(!acct->loadRuleSet(PPPData::data()->accountingFile())) { // // QString s= i18n("Can not load the accounting " -// // "ruleset \"%1\"!").arg(gpppdata.accountingFile()); +// // "ruleset \"%1\"!").arg(PPPData::data()->accountingFile()); @@ -771,5 +771,5 @@ void KPPPWidget::quitbutton() { // // if(stats->totalbytes != 0) -// // gpppdata.setTotalBytes(stats->totalbytes); +// // PPPData::data()->setTotalBytes(stats->totalbytes); -// if(!gpppdata.AcctEnabled()) +// if(!PPPData::data()->AcctEnabled()) // return; @@ -794,3 +794,3 @@ void KPPPWidget::usernameChanged(const QString &) { // store username for later use - gpppdata.setStoredUsername(ID_Edit->text()); + PPPData::data()->setStoredUsername(ID_Edit->text()); } @@ -800,6 +800,6 @@ void KPPPWidget::passwordChanged(const QString &) { // store the password if so requested - if(gpppdata.storePassword()) - gpppdata.setStoredPassword(PW_Edit->text()); + if(PPPData::data()->storePassword()) + PPPData::data()->setStoredPassword(PW_Edit->text()); else - gpppdata.setStoredPassword(""); + PPPData::data()->setStoredPassword(""); } @@ -843,3 +843,3 @@ void KPPPWidget::showNews() { #define QUICKHELP_HINT "Hint_QuickHelp" - if(gpppdata.readNumConfig(GENERAL_GRP, QUICKHELP_HINT, 0) == 0) { + if(PPPData::data()->readNumConfig(GENERAL_GRP, QUICKHELP_HINT, 0) == 0) { QDialog dlg(0, 0, true); @@ -895,4 +895,4 @@ void KPPPWidget::showNews() { if(cb->isChecked()) { - gpppdata.writeConfig(GENERAL_GRP, QUICKHELP_HINT, 1); - gpppdata.save(); + PPPData::data()->writeConfig(GENERAL_GRP, QUICKHELP_HINT, 1); + PPPData::data()->save(); } |