Diffstat (limited to 'noncore/settings/networksettings/ppp/accounts.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/accounts.cpp | 80 |
1 files changed, 53 insertions, 27 deletions
diff --git a/noncore/settings/networksettings/ppp/accounts.cpp b/noncore/settings/networksettings/ppp/accounts.cpp index 28d8732..b8a1925a 100644 --- a/noncore/settings/networksettings/ppp/accounts.cpp +++ b/noncore/settings/networksettings/ppp/accounts.cpp @@ -26,4 +26,12 @@ +#include "accounts.h" +#include "authwidget.h" +#include "pppdata.h" +#include "edit.h" + +/* OPIE */ +#include <qpe/qpeapplication.h> + +/* QT */ #include <qdir.h> -#include <stdlib.h> #include <qlayout.h> @@ -33,3 +41,2 @@ #include <qmessagebox.h> - #include <qapplication.h> @@ -39,6 +46,4 @@ -#include "accounts.h" -#include "authwidget.h" -#include "pppdata.h" -#include "edit.h" +/* STD */ +#include <stdlib.h> @@ -70,3 +75,4 @@ AccountWidget::AccountWidget( PPPData *pd, QWidget *parent, const char *name, WF - for (uint i = 0; i < listListbox->count(); i++){ + for (uint i = 0; i < listListbox->count(); i++) + { if ( listListbox->text(i) == _pppdata->accname() ) @@ -78,3 +84,4 @@ AccountWidget::AccountWidget( PPPData *pd, QWidget *parent, const char *name, WF -void AccountWidget::slotListBoxSelect(int idx) { +void AccountWidget::slotListBoxSelect(int idx) +{ bool ok = _pppdata->setAccount( listListbox->text(idx) ); @@ -86,3 +93,4 @@ void AccountWidget::slotListBoxSelect(int idx) { -void AccountWidget::edit() { +void AccountWidget::edit() +{ _pppdata->setAccount(listListbox->text(listListbox->currentItem())); @@ -91,3 +99,4 @@ void AccountWidget::edit() { - if(result == QDialog::Accepted) { + if(result == QDialog::Accepted) + { listListbox->changeItem(_pppdata->accname(),listListbox->currentItem()); @@ -99,3 +108,4 @@ void AccountWidget::edit() { -void AccountWidget::create() { +void AccountWidget::create() +{ @@ -108,3 +118,4 @@ void AccountWidget::create() { int result; - if (_pppdata->newaccount() == -1){ + if (_pppdata->newaccount() == -1) + { qDebug("_pppdata->newaccount() == -1"); @@ -114,3 +125,4 @@ void AccountWidget::create() { - if(result == QDialog::Accepted) { + if(result == QDialog::Accepted) + { listListbox->insertItem(_pppdata->accname()); @@ -119,3 +131,4 @@ void AccountWidget::create() { _pppdata->save(); - } else + } + else _pppdata->deleteAccount(); @@ -124,3 +137,4 @@ void AccountWidget::create() { -void AccountWidget::copy() { +void AccountWidget::copy() +{ // if(listListbox->count() == MAX_ACCOUNTS) { @@ -130,3 +144,4 @@ void AccountWidget::copy() { - if(listListbox->currentItem()<0) { + if(listListbox->currentItem()<0) + { QMessageBox::information(this, "sorry", tr("No account selected.")); @@ -143,3 +158,4 @@ void AccountWidget::copy() { -void AccountWidget::remove() { +void AccountWidget::remove() +{ @@ -166,3 +182,4 @@ void AccountWidget::remove() { -int AccountWidget::doTab(){ +int AccountWidget::doTab() +{ QDialog *dlg = new QDialog( 0, "newAccount", true, Qt::WStyle_ContextHelp ); @@ -177,6 +194,9 @@ int AccountWidget::doTab(){ - if(_pppdata->accname().isEmpty()) { + if(_pppdata->accname().isEmpty()) + { dlg->setCaption(tr("New Account")); isnewaccount = true; - } else { + } + else + { QString tit = tr("Edit Account: "); @@ -214,14 +234,20 @@ int AccountWidget::doTab(){ - while (!ok){ - dlg->showMaximized(); - result = dlg->exec(); + while (!ok) + { + result = QPEApplication::execDialog( dlg ); ok = true; - if(result == QDialog::Accepted) { - if (!auth_w->check()){ + if(result == QDialog::Accepted) + { + if (!auth_w->check()) + { ok = false; - } else if(!dial_w->save()) { + } + else if(!dial_w->save()) + { QMessageBox::critical(this, "error", tr( "You must enter a unique account name")); ok = false; - }else{ + } + else + { ip_w->save(); |