17 files changed, 306 insertions, 149 deletions
diff --git a/noncore/settings/networksettings/ppp/TODO b/noncore/settings/networksettings/ppp/TODO index 5635438..80fc5a6 100644 --- a/noncore/settings/networksettings/ppp/TODO +++ b/noncore/settings/networksettings/ppp/TODO @@ -1,7 +1,9 @@ -- add possibility to input username and password ;) -- impl. PPPData::copyaccount & PPPData::deleteAccount +- ask for password is non is set + +- stop pppd, i.e. fix interfaceinformationppp + - update modem attribute inputs when modem has changed -- fix layout of edit account, i.e. get it shown maximised -- popup configure modem with the correct account prselected - not quite shure why it does not work... IMHO it should work +- impl. PPPData::copyaccount & PPPData::deleteAccount +- check if the same interface device combination allready exists +- fix layout of edit account, i.e. get it shown maximised diff --git a/noncore/settings/networksettings/ppp/accounts.cpp b/noncore/settings/networksettings/ppp/accounts.cpp index f704c84..7760d5e 100644 --- a/noncore/settings/networksettings/ppp/accounts.cpp +++ b/noncore/settings/networksettings/ppp/accounts.cpp @@ -39,4 +39,5 @@ -#include "pppdata.h" #include "accounts.h" +#include "authwidget.h" +#include "pppdata.h" #include "edit.h" @@ -46,4 +47,5 @@ void parseargs(char* buf, char** args); AccountWidget::AccountWidget( PPPData *pd, QWidget *parent, const char *name ) - : QWidget( parent, name ), _pppdata(pd) + : QWidget( parent, name )//, _pppdata(pd) { + _pppdata = pd; QVBoxLayout *l1 = new QVBoxLayout(this, 10, 10); @@ -88,2 +90,5 @@ AccountWidget::AccountWidget( PPPData *pd, QWidget *parent, const char *name ) + int currAccId = _pppdata->currentAccountID(); + qDebug("currentAccountID %i", currAccId); + //load up account list from gppdata to the list box @@ -95,3 +100,3 @@ AccountWidget::AccountWidget( PPPData *pd, QWidget *parent, const char *name ) } - + _pppdata->setAccountbyIndex( currAccId ); @@ -114,3 +119,2 @@ void AccountWidget::slotListBoxSelect(int idx) { _pppdata->setAccountbyIndex(accountlist_l->currentItem()); - // _pppdata->setAccount(account); } @@ -118,34 +122,2 @@ void AccountWidget::slotListBoxSelect(int idx) { - -// void AccountWidget::viewLogClicked(){ - -// QApplication::flushX(); -// if(fork() == 0) { -// setgid(getgid()); -// setuid(getuid()); -// system("kppplogview -kppp"); -// _exit(0); -// } -// } - - -// void AccountWidget::resetClicked(){ -// if(accountlist_l->currentItem() == -1) -// return; - -// // QueryReset dlg(this); -// // int what = dlg.exec(); - -// // if(what && QueryReset::COSTS) { -// // emit resetCosts(accountlist_l->text(accountlist_l->currentItem())); -// // costedit->setText("0"); -// // } - -// // if(what && QueryReset::VOLUME) { -// // emit resetVolume(accountlist_l->text(accountlist_l->currentItem())); -// // voledit->setText(prettyPrintVolume(0)); -// // } -// } - - void AccountWidget::editaccount() { @@ -251,2 +223,6 @@ int AccountWidget::doTab(){ +// // AUTH WIDGET + auth_w = new AuthWidget( _pppdata, tabWindow, isnewaccount, tr("Edit Login Script")); + tabWindow->addTab( auth_w, tr("Authentication") ); + // // IP WIDGET @@ -263,6 +239,2 @@ int AccountWidget::doTab(){ -// // SCRIPT WIDGET - script_w = new ScriptWidget( _pppdata, tabWindow, isnewaccount, tr("Edit Login Script")); - tabWindow->addTab( script_w, tr("Login Script") ); - // // EXECUTE WIDGET @@ -280,4 +252,3 @@ int AccountWidget::doTab(){ if(result == QDialog::Accepted) { - if (!script_w->check()){ - QMessageBox::critical(this, "error", tr("<qt>Login script has unbalanced loop Start/End<qt>")); + if (!auth_w->check()){ ok = false; @@ -290,3 +261,3 @@ int AccountWidget::doTab(){ gateway_w->save(); - script_w->save(); + auth_w->save(); exec_w->save(); diff --git a/noncore/settings/networksettings/ppp/accounts.h b/noncore/settings/networksettings/ppp/accounts.h index eae3922..8c16a7c 100644 --- a/noncore/settings/networksettings/ppp/accounts.h +++ b/noncore/settings/networksettings/ppp/accounts.h @@ -40,3 +40,3 @@ class QTabWidget; class DialWidget; -class ScriptWidget; +class AuthWidget; class IPWidget; @@ -74,3 +74,3 @@ private: GatewayWidget *gateway_w; - ScriptWidget *script_w; + AuthWidget *auth_w; @@ -84,16 +84,2 @@ private: -// class QueryReset : public QDialog { -// Q_OBJECT -// public: -// QueryReset(QWidget *parent); - -// enum {COSTS=1, VOLUME=2}; - -// private slots: -// void accepted(); - -// private: -// QCheckBox *costs, *volume; -// }; - #endif diff --git a/noncore/settings/networksettings/ppp/authwidget.cpp b/noncore/settings/networksettings/ppp/authwidget.cpp new file mode 100644 index 0000000..86bea98 --- a/dev/null +++ b/noncore/settings/networksettings/ppp/authwidget.cpp @@ -0,0 +1,195 @@ + +#include <qlayout.h> +#include <qmessagebox.h> +#include <qtoolbutton.h> +#include <qwhatsthis.h> + +#include "auth.h" +#include "authwidget.h" +#include "edit.h" +#include "pppdata.h" + + +static const char* const image0_data[] = { +"16 16 2 1", +". c None", +"# c #000000", +"................", +"...#...###...##.", +"..#.#..#..#.##..", +"..###..###.##...", +".#...#.#..##....", +".#...#.#.##.....", +"........##.#..#.", +"..##...##...##..", +".#..#.###...##..", +".#...##..#.#..#.", +".#..##..........", +".#.##.#..#.#..#.", +"..##...##...##..", +".##....##...##..", +".#....#..#.#..#.", +"................"}; + + +AuthWidget::AuthWidget(PPPData *pd, QWidget *parent, bool isnewaccount, const char *name ) + : QWidget( parent, name), + scriptWidget(0), + _pppdata(pd), + isNewAccount(isnewaccount) +{ + layout = new QGridLayout(this); + + auth_l = new QLabel(tr("Authentication: "), this); + layout->addWidget(auth_l, 0, 0); + + auth = new QComboBox(this); + auth->insertItem(tr("Script-based")); + auth->insertItem(tr("PAP")); + auth->insertItem(tr("Terminal-based")); + auth->insertItem(tr("CHAP")); + auth->insertItem(tr("PAP/CHAP")); + layout->addWidget(auth, 0, 1); + + connect( auth, SIGNAL(activated(const QString&)), + SLOT(authChanged(const QString&))); + + QString tmp = tr("<p>Specifies the method used to identify yourself to\n" + "the PPP server. Most universities still use\n" + "<b>Terminal</b>- or <b>Script</b>-based authentication,\n" + "while most ISP use <b>PAP</b> and/or <b>CHAP</b>. If\n" + "unsure, contact your ISP.\n" + "\n" + "If you can choose between PAP and CHAP,\n" + "choose CHAP, because it's much safer. If you don't know\n" + "whether PAP or CHAP is right, choose PAP/CHAP."); + + QWhatsThis::add(auth_l,tmp); + QWhatsThis::add(auth,tmp); + + user_l = new QLabel( tr("Username: "), this); + layout->addWidget( user_l, 1, 0 ); + userName = new QLineEdit( this, "usernameEdit" ); + layout->addWidget( userName, 1, 1 ); + tmp = tr("Enter your username here..."); + QWhatsThis::add( user_l, tmp ); + QWhatsThis::add( userName, tmp ); + + pw_l = new QLabel( tr("Password: "), this); + layout->addWidget( pw_l, 2, 0 ); + passWord = new QLineEdit( this, "pw" ); + passWord->setAutoMask( true ); + passWord->setEchoMode( QLineEdit::Password ); + layout->addWidget( passWord, 2, 1 ); + hidePw = new QToolButton( this ); + hidePw->setPixmap( QPixmap( ( const char** ) image0_data ) ); + hidePw->setToggleButton( true ); + layout->addWidget( hidePw, 2, 2 ); + + connect(hidePw, SIGNAL(toggled(bool)), SLOT(toggleEchoMode(bool))); + + tmp = tr("Enter your password here"); + QWhatsThis::add( pw_l, tmp ); + QWhatsThis::add( passWord, tmp ); + + store_password = new QCheckBox(tr("Store password"), this); + layout->addMultiCellWidget(store_password, 3, 3, 0, 1, AlignRight); + QWhatsThis::add(store_password, + tr("<p>When this is turned on, your ISP password\n" + "will be saved in <i>kppp</i>'s config file, so\n" + "you do not need to type it in every time.\n" + "\n" + "<b><font color=\"red\">Warning:</font> your password will be stored as\n" + "plain text in the config file, which is\n" + "readable only to you. Make sure nobody\n" + "gains access to this file!")); + + if (isNewAccount){ + // select PAP/CHAP as default + auth->setCurrentItem(AUTH_PAPCHAP); + store_password->setChecked(true); + }else{ + auth->setCurrentItem(_pppdata->authMethod()); + authChanged( auth->currentText() ); + userName->setText( _pppdata->storedUsername() ); + store_password->setChecked(_pppdata->storePassword()); + if (store_password->isChecked()) + passWord->setText( _pppdata->storedPassword() ); + } +} + +bool AuthWidget::check() +{ + bool ret = true; + if (scriptWidget){ + if (!scriptWidget->check()){ + QMessageBox::critical(this, tr("error"), tr("<qt>Login script has unbalanced loop Start/End<qt>")); + ret = false; + } + } + return ret; +} + +void AuthWidget::save() +{ + _pppdata->setAuthMethod(auth->currentItem()); + if (scriptWidget) scriptWidget->save(); + _pppdata->setStoredUsername( userName->text() ); + _pppdata->setStorePassword(store_password->isChecked()); + if (store_password->isChecked()) + _pppdata->setStoredPassword( passWord->text() ); +} + +void AuthWidget::authChanged( const QString &authStr ) +{ + qDebug("AuthWidget::authChanged( %s )", authStr.latin1() ); + if ( authStr.contains( tr("Script-based") ) ){ + showUsernamePassword( false ); + showScriptWindow( true ); + } else if ( authStr.contains( tr("PAP") ) || + authStr.contains( tr("CHAP") ) ){ + showUsernamePassword( true ); + showScriptWindow( false ); + } else { + qDebug("do not really know how to handle"); + showUsernamePassword( false ); + showScriptWindow( false ); + } +} + + +void AuthWidget::showUsernamePassword( bool show ) +{ + if (show){ + user_l->show(); + userName->show(); + pw_l->show(); + passWord->show(); + store_password->show(); + }else{//!show + user_l->hide(); + userName->hide(); + pw_l->hide(); + passWord->hide(); + store_password->hide(); + } +} + +void AuthWidget::showScriptWindow( bool show ) +{ + if (show){ + if (!scriptWidget){ + scriptWidget = new ScriptWidget( _pppdata, this, isNewAccount, "scriptWid"); + layout->addMultiCellWidget( scriptWidget, 1, 4, 0, 1 ); + } + scriptWidget->show(); + }else{ // !show + if (scriptWidget) scriptWidget->hide(); + } +} + +void AuthWidget::toggleEchoMode( bool t ) +{ + passWord->setEchoMode( t ? QLineEdit::Normal : QLineEdit::Password ); +} + diff --git a/noncore/settings/networksettings/ppp/authwidget.h b/noncore/settings/networksettings/ppp/authwidget.h new file mode 100644 index 0000000..33ec4c2 --- a/dev/null +++ b/noncore/settings/networksettings/ppp/authwidget.h @@ -0,0 +1,46 @@ +#ifndef _AUTHWIDGET_H +#define _AUTHWIDGET_H + +#include <qwidget.h> + +class ScriptWidget; +class PPPData; +class QCheckBox; +class QComboBox; +class QLabel; +class QGridLayout; +class QLineEdit; +class QToolButton; + +class AuthWidget : public QWidget { + Q_OBJECT +public: + AuthWidget(PPPData*, QWidget *parent=0, bool isnewaccount = true, const char *name=0 ); + ~AuthWidget() {}; + +public slots: + bool check(); + void save(); + +private slots: + void authChanged(const QString&); + void showUsernamePassword(bool); + void showScriptWindow(bool); + void toggleEchoMode(bool); + +private: + ScriptWidget *scriptWidget; + PPPData *_pppdata; + bool isNewAccount; + QGridLayout *layout; + QComboBox *auth; + QLabel *auth_l; + QLabel *user_l; + QLineEdit *userName; + QLabel *pw_l; + QLineEdit *passWord; + QToolButton *hidePw; + QCheckBox *store_password; +}; + +#endif diff --git a/noncore/settings/networksettings/ppp/connect.cpp b/noncore/settings/networksettings/ppp/connect.cpp index 89d9930..a93f93d 100644 --- a/noncore/settings/networksettings/ppp/connect.cpp +++ b/noncore/settings/networksettings/ppp/connect.cpp @@ -126,2 +126,3 @@ ConnectWidget::ConnectWidget(InterfacePPP *ifp, QWidget *parent, const char *nam debug->setToggleButton(true); + debug->setEnabled( false ); // FIXME: disable the log button connect(debug, SIGNAL(clicked()), SIGNAL(toggleDebugWindow())); diff --git a/noncore/settings/networksettings/ppp/edit.cpp b/noncore/settings/networksettings/ppp/edit.cpp index 45d6e4f..b880978 100644 --- a/noncore/settings/networksettings/ppp/edit.cpp +++ b/noncore/settings/networksettings/ppp/edit.cpp @@ -36,2 +36,3 @@ #include <qdialog.h> +#include <qpe/resource.h> @@ -48,3 +49,3 @@ DialWidget::DialWidget( PPPData *pd, QWidget *parent, bool isnewaccount - QGridLayout *tl = new QGridLayout(this, GRIDROWS, 2, 0 );//, KDialog::spacingHint()); + QGridLayout *tl = new QGridLayout(this, GRIDROWS, 2, 0 ); @@ -77,7 +78,5 @@ DialWidget::DialWidget( PPPData *pd, QWidget *parent, bool isnewaccount up = new QPushButton(this); -//FIXME: QPixmap pm = BarIcon("up"); -// up->setPixmap(pm); + up->setPixmap( Resource::loadPixmap("inline/up") ); down = new QPushButton(this); -//FIXME: pm = BarIcon("down"); -// down->setPixmap(pm); + down->setPixmap( Resource::loadPixmap("inline/down") ); lpn1->addWidget(add); @@ -110,38 +109,2 @@ DialWidget::DialWidget( PPPData *pd, QWidget *parent, bool isnewaccount - auth_l = new QLabel(tr("Authentication:"), this); - tl->addWidget(auth_l, 3, 0); - - auth = new QComboBox(this); - auth->insertItem(tr("Script-based")); - auth->insertItem(tr("PAP")); - auth->insertItem(tr("Terminal-based")); - auth->insertItem(tr("CHAP")); - auth->insertItem(tr("PAP/CHAP")); - tl->addWidget(auth, 3, 1); - tmp = tr("<p>Specifies the method used to identify yourself to\n" - "the PPP server. Most universities still use\n" - "<b>Terminal</b>- or <b>Script</b>-based authentication,\n" - "while most ISP use <b>PAP</b> and/or <b>CHAP</b>. If\n" - "unsure, contact your ISP.\n" - "\n" - "If you can choose between PAP and CHAP,\n" - "choose CHAP, because it's much safer. If you don't know\n" - "whether PAP or CHAP is right, choose PAP/CHAP."); - - QWhatsThis::add(auth_l,tmp); - QWhatsThis::add(auth,tmp); - - store_password = new QCheckBox(tr("Store password"), this); - store_password->setChecked(true); - tl->addMultiCellWidget(store_password, 4, 4, 0, 1, AlignRight); - QWhatsThis::add(store_password, - tr("<p>When this is turned on, your ISP password\n" - "will be saved in <i>kppp</i>'s config file, so\n" - "you do not need to type it in every time.\n" - "\n" - "<b><font color=\"red\">Warning:</font> your password will be stored as\n" - "plain text in the config file, which is\n" - "readable only to you. Make sure nobody\n" - "gains access to this file!")); - pppdargs = new QPushButton(tr("Customize pppd Arguments..."), this); @@ -170,7 +133,2 @@ DialWidget::DialWidget( PPPData *pd, QWidget *parent, bool isnewaccount - auth->setCurrentItem(_pppdata->authMethod()); - store_password->setChecked(_pppdata->storePassword()); - } else { - // select PAP/CHAP as default - auth->setCurrentItem(AUTH_PAPCHAP); } @@ -197,4 +155,2 @@ bool DialWidget::save() { _pppdata->setPhonenumber(number); - _pppdata->setAuthMethod(auth->currentItem()); - _pppdata->setStorePassword(store_password->isChecked()); return true; diff --git a/noncore/settings/networksettings/ppp/edit.h b/noncore/settings/networksettings/ppp/edit.h index 2cc0fed..8b5ec03 100644 --- a/noncore/settings/networksettings/ppp/edit.h +++ b/noncore/settings/networksettings/ppp/edit.h @@ -72,5 +72,2 @@ private: QPushButton *pppdargs; - QComboBox *auth; - QLabel *auth_l; - QCheckBox *store_password; diff --git a/noncore/settings/networksettings/ppp/interfaceinformationppp.cpp b/noncore/settings/networksettings/ppp/interfaceinformationppp.cpp index 3cf1167..553daa2 100644 --- a/noncore/settings/networksettings/ppp/interfaceinformationppp.cpp +++ b/noncore/settings/networksettings/ppp/interfaceinformationppp.cpp @@ -7,2 +7,3 @@ #include <qmessagebox.h> +#include <qabstractlayout.h> @@ -25,4 +26,8 @@ InterfaceInformationPPP::InterfaceInformationPPP(QWidget *parent, const char *na con = new ConnectWidget( (InterfacePPP*)i, this, "con" ); - // InterfaceInformationLayout->addMultiCellWidget( con, 7, 7, 0, 1 ); - InterfaceInformationLayout->addWidget( con, 7, 0 ); + con->setSizePolicy( QSizePolicy(QSizePolicy::MinimumExpanding, + QSizePolicy::Fixed) ); + QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + InterfaceInformationLayout->addItem( spacer, 7, 0 ); + InterfaceInformationLayout->addMultiCellWidget( con, 8, 8, 0, 1 ); + // InterfaceInformationLayout->addWidget( con, 7, 0 ); connect(i, SIGNAL(begin_connect()),con, SLOT(preinit())); diff --git a/noncore/settings/networksettings/ppp/interfaceppp.cpp b/noncore/settings/networksettings/ppp/interfaceppp.cpp index dc24824..98bb4da 100644 --- a/noncore/settings/networksettings/ppp/interfaceppp.cpp +++ b/noncore/settings/networksettings/ppp/interfaceppp.cpp @@ -47,8 +47,6 @@ void InterfacePPP::start() qDebug("InterfacePPP::start"); - if (data()->storedPassword() != "" ){ - data()->setPassword(data()->storedPassword()); - }else{ - //FIXME: + if (data()->password().isEmpty() ){ +//FIXME: ask for password qDebug("using dummy password"); - data()->setPassword( "dummy" ); + QMessageBox::critical( 0, "no password", "you should be prompted for a password, but you are not! ;-)"); } @@ -98,3 +96,3 @@ void InterfacePPP::start() data()->authMethod() == AUTH_PAPCHAP ) { - if(false){ //ID_Edit->text().isEmpty()) { + if(false){ //FIXME: ID_Edit->text().isEmpty()) { QMessageBox::warning(0,tr("Error"), @@ -122,9 +120,5 @@ void InterfacePPP::start() -// this->hide(); - - QString tit = i18n("Connecting to: %1").arg(data()->accname()); -// con->setCaption(tit); - -// con->show(); - + // SEGFAULTS: +// setStatus( true ); +// emit updateInterface((Interface*) this); @@ -141 +135,6 @@ void InterfacePPP::stop() +void InterfacePPP::save() +{ + data()->save(); + emit updateInterface((Interface*) this); +} diff --git a/noncore/settings/networksettings/ppp/interfaceppp.h b/noncore/settings/networksettings/ppp/interfaceppp.h index 06a4dbf..6eb6a69 100644 --- a/noncore/settings/networksettings/ppp/interfaceppp.h +++ b/noncore/settings/networksettings/ppp/interfaceppp.h @@ -25,2 +25,3 @@ public slots: virtual void stop(); + void save(); diff --git a/noncore/settings/networksettings/ppp/kpppwidget.cpp b/noncore/settings/networksettings/ppp/kpppwidget.cpp index 289e9f5..7b5c74d 100644 --- a/noncore/settings/networksettings/ppp/kpppwidget.cpp +++ b/noncore/settings/networksettings/ppp/kpppwidget.cpp @@ -602,3 +602,3 @@ void KPPPWidget::beginConnect() { i18n("You have selected the authentication method PAP or CHAP. This requires that you supply a username and a password!")); -// FIXME: return; + return; } else { diff --git a/noncore/settings/networksettings/ppp/ppp.pro b/noncore/settings/networksettings/ppp/ppp.pro index 483aa58..56a7ace 100644 --- a/noncore/settings/networksettings/ppp/ppp.pro +++ b/noncore/settings/networksettings/ppp/ppp.pro @@ -6,6 +6,4 @@ CONFIG += qt warn_on debug DESTDIR = $(OPIEDIR)/plugins/networksettings -HEADERS = pppmodule.h devices.h modem.h modeminfo.h pppdata.h kpppconfig.h pppdata.h runtests.h general.h modemcmds.h conwindow.h accounts.h connect.h edit.h scriptedit.h pppdargs.h iplined.h pwentry.h pppconfig.h interfaceinformationppp.h interfaceppp.h -# kpppwidget.h -SOURCES = pppmodule.cpp modem.cpp modeminfo.cpp pppdata.cpp runtests.cpp general.cpp modemcmds.cpp conwindow.cpp accounts.cpp connect.cpp edit.cpp scriptedit.cpp pppdargs.cpp iplined.cpp pwentry.cpp pppconfig.cpp interfaceinformationppp.cpp interfaceppp.cpp -# kpppwidget.cpp +HEADERS = pppmodule.h devices.h modem.h modeminfo.h pppdata.h kpppconfig.h pppdata.h runtests.h general.h modemcmds.h conwindow.h accounts.h connect.h edit.h scriptedit.h pppdargs.h iplined.h pwentry.h pppconfig.h interfaceinformationppp.h interfaceppp.h authwidget.h +SOURCES = pppmodule.cpp modem.cpp modeminfo.cpp pppdata.cpp runtests.cpp general.cpp modemcmds.cpp conwindow.cpp accounts.cpp connect.cpp edit.cpp scriptedit.cpp pppdargs.cpp iplined.cpp pwentry.cpp pppconfig.cpp interfaceinformationppp.cpp interfaceppp.cpp authwidget.cpp INCLUDEPATH += $(OPIEDIR)/include ../ ../interfaces/ diff --git a/noncore/settings/networksettings/ppp/pppconfig.cpp b/noncore/settings/networksettings/ppp/pppconfig.cpp index 63f9335..5fa7d3f 100644 --- a/noncore/settings/networksettings/ppp/pppconfig.cpp +++ b/noncore/settings/networksettings/ppp/pppconfig.cpp @@ -44,4 +44,2 @@ PPPConfigWidget::PPPConfigWidget( InterfacePPP* iface, QWidget *parent, tabWindow->addTab( modem2, tr("&Modem") ); -// graph = new GraphSetup( tabWindow->addPage( tr("&Graph"), tr("Throughput Graph" ) ) ); -// general = new GeneralWidget( tabWindow->addPage( tr("M&isc"), tr("Miscellaneous Settings") ) ); @@ -62,3 +60,3 @@ void PPPConfigWidget::accept() interface->setHardwareName( interface->data()->accname() ); - interface->data()->save(); + interface->save(); QDialog::accept(); diff --git a/noncore/settings/networksettings/ppp/pppdata.cpp b/noncore/settings/networksettings/ppp/pppdata.cpp index 23db409..8f066ff 100644 --- a/noncore/settings/networksettings/ppp/pppdata.cpp +++ b/noncore/settings/networksettings/ppp/pppdata.cpp @@ -45,2 +45,3 @@ PPPData::PPPData() : modemDeviceGroup(-1), + passwd(""), highcount(-1), // start out with no entries @@ -219,4 +220,5 @@ void PPPData::writeListConfig(const QString &group, const QString &key, // -QString PPPData::password() const { - return passwd; +QString PPPData::password(){ + if ( storePassword() ) return storedPassword(); + else return passwd; } @@ -755,3 +757,3 @@ bool PPPData::isUniqueAccname(const QString &n) { bool PPPData::deleteAccount() { - //FIXME: + //FIXME: PPPData::deleteAccount // if(caccount < 0) @@ -828,3 +830,3 @@ int PPPData::newaccount() { int PPPData::copyaccount(int i) { -// FIXME +// FIXME: PPPData::copyaccount // if(highcount >= MAX_ACCOUNTS) @@ -1278,8 +1280,10 @@ void PPPData::setConfiguredInterfaces( QMap<QString,QString> ifaces ) Config cfg = config(); - for( it = ifaces.begin(); it != ifaces.end(); ++it, ++i ){ - cfg.setGroup(QString("%1_%1").arg(ACCLIST_GRP).arg(i)); + for( it = ifaces.begin(); it != ifaces.end(); ++it ){ + cfg.setGroup(QString("%1_%1").arg(ACCLIST_GRP).arg(i++)); cfg.writeEntry( ACOUNTS_DEV, it.key() ); cfg.writeEntry( ACOUNTS_ACC, it.data() ); + qDebug("I %i",i); } cfg.setGroup( ACCLIST_GRP ); + qDebug("saved %i account settings", i); cfg.writeEntry( ACCOUNTS_COUNT, i ); diff --git a/noncore/settings/networksettings/ppp/pppdata.h b/noncore/settings/networksettings/ppp/pppdata.h index c9cd482..6e1379d 100644 --- a/noncore/settings/networksettings/ppp/pppdata.h +++ b/noncore/settings/networksettings/ppp/pppdata.h @@ -183,3 +183,3 @@ public: // functions to set/get general kppp info - QString password() const; + QString password(); void setPassword(const QString &); diff --git a/noncore/settings/networksettings/ppp/pppmodule.cpp b/noncore/settings/networksettings/ppp/pppmodule.cpp index 8c401a9..d4c137b 100644 --- a/noncore/settings/networksettings/ppp/pppmodule.cpp +++ b/noncore/settings/networksettings/ppp/pppmodule.cpp @@ -82,6 +82,4 @@ QWidget *PPPModule::information(Interface *i){ // TODO ^ - qDebug("return PPPModule::information"); -// InterfaceInformationImp *information = new InterfaceInformationImp( 0, "InterfaceSetupImp", i); - InterfaceInformationPPP *information = new InterfaceInformationPPP( 0, "InterfaceInformationPPP", i ); - return information; + + return new InterfaceInformationPPP( 0, "InterfaceInformationPPP", i ); } |