-rw-r--r-- | noncore/settings/networksettings/ppp/accounts.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/noncore/settings/networksettings/ppp/accounts.cpp b/noncore/settings/networksettings/ppp/accounts.cpp index 04905e8..fa1c43b 100644 --- a/noncore/settings/networksettings/ppp/accounts.cpp +++ b/noncore/settings/networksettings/ppp/accounts.cpp @@ -137,97 +137,99 @@ void AccountWidget::newaccount() { if(accountlist_l->count() == MAX_ACCOUNTS) { QMessageBox::information(this, "sorry", tr("Maximum number of accounts reached.")); return; } int result; if (_pppdata->newaccount() == -1){ qDebug("_pppdata->newaccount() == -1"); return; } result = doTab(); if(result == QDialog::Accepted) { accountlist_l->insertItem(_pppdata->accname()); accountlist_l->setSelected(accountlist_l->findItem(_pppdata->accname()),true); _pppdata->save(); } else _pppdata->deleteAccount(); } void AccountWidget::copyaccount() { if(accountlist_l->count() == MAX_ACCOUNTS) { QMessageBox::information(this, "sorry", tr("Maximum number of accounts reached.")); return; } if(accountlist_l->currentItem()<0) { QMessageBox::information(this, "sorry", tr("No account selected.")); return; } _pppdata->copyaccount(accountlist_l->currentItem()); accountlist_l->insertItem(_pppdata->accname()); // emit resetaccounts(); _pppdata->save(); } void AccountWidget::deleteaccount() { QString s = tr("Are you sure you want to delete\nthe account \"%1\"?") .arg(accountlist_l->text(accountlist_l->currentItem())); - if(QMessageBox::warning(this, s, tr("Confirm")) != QMessageBox::Yes) + if(QMessageBox::warning(this,tr("Confirm"),s, + QMessageBox::Yes,QMessageBox::No + ) != QMessageBox::Yes) return; if(_pppdata->deleteAccount(accountlist_l->text(accountlist_l->currentItem()))) accountlist_l->removeItem(accountlist_l->currentItem()); emit resetaccounts(); _pppdata->save(); slotListBoxSelect(accountlist_l->currentItem()); } int AccountWidget::doTab(){ QDialog *dlg = new QDialog( 0, "newAccount", true ); QVBoxLayout *layout = new QVBoxLayout( dlg ); layout->setSpacing( 0 ); layout->setMargin( 1 ); tabWindow = new QTabWidget( dlg, "tabWindow" ); layout->addWidget( tabWindow ); bool isnewaccount; if(_pppdata->accname().isEmpty()) { dlg->setCaption(tr("New Account")); isnewaccount = true; } else { QString tit = tr("Edit Account: "); tit += _pppdata->accname(); dlg->setCaption(tit); isnewaccount = false; } // // DIAL WIDGET dial_w = new DialWidget( _pppdata, tabWindow, isnewaccount, "Dial Setup"); tabWindow->addTab( dial_w, tr("Dial") ); // // AUTH WIDGET auth_w = new AuthWidget( _pppdata, tabWindow, isnewaccount, tr("Edit Login Script")); tabWindow->addTab( auth_w, tr("Authentication") ); // // IP WIDGET ip_w = new IPWidget( _pppdata, tabWindow, isnewaccount, tr("IP Setup")); tabWindow->addTab( ip_w, tr("IP") ); // // GATEWAY WIDGET gateway_w = new GatewayWidget( _pppdata, tabWindow, isnewaccount, tr("Gateway Setup")); |