author | tille <tille> | 2003-05-25 14:25:23 (UTC) |
---|---|---|
committer | tille <tille> | 2003-05-25 14:25:23 (UTC) |
commit | 61c6231cdcde59f8a3ecff31b9fab37f7e9d8852 (patch) (side-by-side diff) | |
tree | 4724031209e2263c872ad6160ea61a793f09ed1e /noncore/settings/networksettings/ppp/pppmodule.cpp | |
parent | efa6dfa3428746451dd5a9b5e1ba57806ae96dba (diff) | |
download | opie-61c6231cdcde59f8a3ecff31b9fab37f7e9d8852.zip opie-61c6231cdcde59f8a3ecff31b9fab37f7e9d8852.tar.gz opie-61c6231cdcde59f8a3ecff31b9fab37f7e9d8852.tar.bz2 |
save device specific settings
Diffstat (limited to 'noncore/settings/networksettings/ppp/pppmodule.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/pppmodule.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/noncore/settings/networksettings/ppp/pppmodule.cpp b/noncore/settings/networksettings/ppp/pppmodule.cpp index fb2f3e5..3a97535 100644 --- a/noncore/settings/networksettings/ppp/pppmodule.cpp +++ b/noncore/settings/networksettings/ppp/pppmodule.cpp @@ -43,33 +43,34 @@ QString PPPModule::getPixmapName(Interface* ){ /** * Check to see if the interface i is owned by this module. * @param Interface* interface to check against * @return bool true if i is owned by this module, false otherwise. */ bool PPPModule::isOwner(Interface *i){ return list.find( i ) != -1; } /** * Create, and return the WLANConfigure Module * @return QWidget* pointer to this modules configure. */ QWidget *PPPModule::configure(Interface *i){ qDebug("return ModemWidget"); - PPPConfigWidget *pppconfig = new PPPConfigWidget( 0, "PPPConfig", false, + PPPConfigWidget *pppconfig = new PPPConfigWidget( i, 0, "PPPConfig", + false, Qt::WDestructiveClose ); return pppconfig; } /** * Create, and return the Information Module * @return QWidget* pointer to this modules info. */ QWidget *PPPModule::information(Interface *i){ // We don't have any advanced pppd information widget yet :-D // TODO ^ qDebug("return PPPModule::information"); InterfaceInformationImp *information = new InterfaceInformationImp(0, "InterfaceSetupImp", i); return information; } @@ -81,44 +82,45 @@ QWidget *PPPModule::information(Interface *i){ QList<Interface> PPPModule::getInterfaces(){ // List all of the files in the peer directory qDebug("PPPModule::getInterfaces"); return list; } /** * Attempt to add a new interface as defined by name * @param name the name of the type of interface that should be created given * by possibleNewInterfaces(); * @return Interface* NULL if it was unable to be created. */ Interface *PPPModule::addNewInterface(const QString &newInterface){ qDebug("try to add iface %s",newInterface.latin1()); - PPPConfigWidget imp(0, "PPPConfigImp", true); + Interface *iface; + iface = new Interface(); + PPPConfigWidget imp(iface, 0, "PPPConfigImp", true); imp.showMaximized(); if(imp.exec() == QDialog::Accepted ){ - qDebug("ACCEPTED"); - PPPData::data()->save(); - Interface *iface; - iface = new Interface( 0, PPPData::data()->modemDevice() ); - iface->setHardwareName( PPPData::data()->accname() ); + iface->setModuleOwner( this ); list.append( iface ); return iface; + }else { + delete iface; + iface = NULL; } - return NULL; + return iface; } /** * Attempts to remove the interface, doesn't delete i * @return bool true if successfull, false otherwise. */ bool PPPModule::remove(Interface*){ // Can't remove a hardware device, you can stop it though. return false; } void PPPModule::possibleNewInterfaces(QMap<QString, QString> &newIfaces) { newIfaces.insert(QObject::tr("PPP") , QObject::tr("generic ppp device")); } |