Diffstat (limited to 'noncore/settings/networksettings/ppp/accounts.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/accounts.cpp | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/noncore/settings/networksettings/ppp/accounts.cpp b/noncore/settings/networksettings/ppp/accounts.cpp index 11d4739..3fa2f84 100644 --- a/noncore/settings/networksettings/ppp/accounts.cpp +++ b/noncore/settings/networksettings/ppp/accounts.cpp @@ -51,6 +51,6 @@ void parseargs(char* buf, char** args); -AccountWidget::AccountWidget( QWidget *parent, const char *name ) - : QWidget( parent, name ) +AccountWidget::AccountWidget( PPPData *pd, QWidget *parent, const char *name ) + : QWidget( parent, name ), _pppdata(pd) { QVBoxLayout *l1 = new QVBoxLayout(this, 10, 10); @@ -153,15 +153,15 @@ AccountWidget::AccountWidget( QWidget *parent, const char *name ) //load up account list from gppdata to the list box - if(PPPData::data()->count() > 0) { - for(int i=0; i <= PPPData::data()->count()-1; i++) { - PPPData::data()->setAccountbyIndex(i); - accountlist_l->insertItem(PPPData::data()->accname()); + if(_pppdata->count() > 0) { + for(int i=0; i <= _pppdata->count()-1; i++) { + _pppdata->setAccountbyIndex(i); + accountlist_l->insertItem(_pppdata->accname()); } } // slotListBoxSelect(accountlist_l->currentItem()); - qDebug("setting listview index to %i",PPPData::data()->currentAccountID() ); - accountlist_l->setCurrentItem( PPPData::data()->currentAccountID() ); -// slotListBoxSelect( PPPData::data()->currentAccountID()); + qDebug("setting listview index to %i",_pppdata->currentAccountID() ); + accountlist_l->setCurrentItem( _pppdata->currentAccountID() ); +// slotListBoxSelect( _pppdata->currentAccountID()); l1->activate(); @@ -176,7 +176,7 @@ void AccountWidget::slotListBoxSelect(int idx) { if(idx!=-1) { qDebug("setting account to %i", idx); - QString account = PPPData::data()->accname(); - PPPData::data()->setAccountbyIndex(accountlist_l->currentItem()); - // PPPData::data()->setAccount(account); + QString account = _pppdata->accname(); + _pppdata->setAccountbyIndex(accountlist_l->currentItem()); + // _pppdata->setAccount(account); } } @@ -215,12 +215,12 @@ void AccountWidget::slotListBoxSelect(int idx) { void AccountWidget::editaccount() { - PPPData::data()->setAccount(accountlist_l->text(accountlist_l->currentItem())); + _pppdata->setAccount(accountlist_l->text(accountlist_l->currentItem())); int result = doTab(); if(result == QDialog::Accepted) { - accountlist_l->changeItem(PPPData::data()->accname(),accountlist_l->currentItem()); + accountlist_l->changeItem(_pppdata->accname(),accountlist_l->currentItem()); // emit resetaccounts(); - PPPData::data()->save(); + _pppdata->save(); } } @@ -246,5 +246,5 @@ void AccountWidget::newaccount() { // case QMessageBox::Yes: // { -// if (PPPData::data()->newaccount() == -1) +// if (_pppdata->newaccount() == -1) // return; // // ProviderDB pdb(this); @@ -253,6 +253,6 @@ void AccountWidget::newaccount() { // } // case QMessageBox::No: - if (PPPData::data()->newaccount() == -1){ - qDebug("PPPData::data()->newaccount() == -1"); + if (_pppdata->newaccount() == -1){ + qDebug("_pppdata->newaccount() == -1"); return; } @@ -264,11 +264,11 @@ void AccountWidget::newaccount() { if(result == QDialog::Accepted) { - accountlist_l->insertItem(PPPData::data()->accname()); - accountlist_l->setSelected(accountlist_l->findItem(PPPData::data()->accname()), + accountlist_l->insertItem(_pppdata->accname()); + accountlist_l->setSelected(accountlist_l->findItem(_pppdata->accname()), true); // emit resetaccounts(); - PPPData::data()->save(); + _pppdata->save(); } else - PPPData::data()->deleteAccount(); + _pppdata->deleteAccount(); } @@ -285,9 +285,9 @@ void AccountWidget::copyaccount() { } - PPPData::data()->copyaccount(accountlist_l->currentItem()); + _pppdata->copyaccount(accountlist_l->currentItem()); - accountlist_l->insertItem(PPPData::data()->accname()); + accountlist_l->insertItem(_pppdata->accname()); // emit resetaccounts(); - PPPData::data()->save(); + _pppdata->save(); } @@ -301,9 +301,9 @@ void AccountWidget::deleteaccount() { return; - if(PPPData::data()->deleteAccount(accountlist_l->text(accountlist_l->currentItem()))) + if(_pppdata->deleteAccount(accountlist_l->text(accountlist_l->currentItem()))) accountlist_l->removeItem(accountlist_l->currentItem()); emit resetaccounts(); - PPPData::data()->save(); + _pppdata->save(); slotListBoxSelect(accountlist_l->currentItem()); @@ -323,25 +323,25 @@ int AccountWidget::doTab(){ bool isnewaccount; - if(PPPData::data()->accname().isEmpty()) { + if(_pppdata->accname().isEmpty()) { dlg->setCaption(i18n("New Account")); isnewaccount = true; } else { QString tit = i18n("Edit Account: "); - tit += PPPData::data()->accname(); + tit += _pppdata->accname(); dlg->setCaption(tit); isnewaccount = false; } - dial_w = new DialWidget( tabWindow, isnewaccount, "Dial Setup"); + dial_w = new DialWidget( _pppdata, tabWindow, isnewaccount, "Dial Setup"); tabWindow->addTab( dial_w, i18n("Dial") ); - ip_w = new IPWidget( tabWindow, isnewaccount, i18n("IP Setup")); + ip_w = new IPWidget( _pppdata, tabWindow, isnewaccount, i18n("IP Setup")); tabWindow->addTab( ip_w, i18n("IP") ); - gateway_w = new GatewayWidget( tabWindow, isnewaccount, i18n("Gateway Setup")); + gateway_w = new GatewayWidget( _pppdata, tabWindow, isnewaccount, i18n("Gateway Setup")); tabWindow->addTab( gateway_w, i18n("Gateway") ); - dns_w = new DNSWidget( tabWindow, isnewaccount, i18n("DNS Servers") ); + dns_w = new DNSWidget( _pppdata, tabWindow, isnewaccount, i18n("DNS Servers") ); tabWindow->addTab( dns_w, i18n("DNS") ); - script_w = new ScriptWidget( tabWindow, isnewaccount, i18n("Edit Login Script")); + script_w = new ScriptWidget( _pppdata, tabWindow, isnewaccount, i18n("Edit Login Script")); tabWindow->addTab( script_w, i18n("Login Script") ); - ExecWidget *exec_w = new ExecWidget( tabWindow, isnewaccount, i18n("Execute Programs")); + ExecWidget *exec_w = new ExecWidget( _pppdata, tabWindow, isnewaccount, i18n("Execute Programs")); tabWindow->addTab( exec_w, i18n("Execute") ); // acct = new AccountingSelector( tabWindow, isnewaccount ); |