author | tille <tille> | 2003-06-16 17:07:09 (UTC) |
---|---|---|
committer | tille <tille> | 2003-06-16 17:07:09 (UTC) |
commit | 020c6d76b3faad399164ba196c51804221a259e1 (patch) (side-by-side diff) | |
tree | 7b9aef94a9ec3fad7a16201d56c4a4b32ac39a09 | |
parent | 3508149e0c894e53bc31ee7b66d98a195cdb8d70 (diff) | |
download | opie-020c6d76b3faad399164ba196c51804221a259e1.zip opie-020c6d76b3faad399164ba196c51804221a259e1.tar.gz opie-020c6d76b3faad399164ba196c51804221a259e1.tar.bz2 |
remove qFatal in case of unknow interface.
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanmodule.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp index e34f0ce..371b689 100644 --- a/noncore/settings/networksettings/wlan/wlanmodule.cpp +++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp @@ -85,129 +85,131 @@ QWidget *WLANModule::information(Interface *i){ return NULL; return getInfo( i ); } /** * Get all active (up or down) interfaces * @return QList<Interface> A list of interfaces that exsist that havn't * been called by isOwner() */ QList<Interface> WLANModule::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 *WLANModule::addNewInterface(const QString &){ // We can't add a 802.11 interface, either the hardware will be there // or it wont. return NULL; } /** * Attempts to remove the interface, doesn't delete i * @return bool true if successfull, false otherwise. */ bool WLANModule::remove(Interface*){ // Can't remove a hardware device, you can stop it though. return false; } void WLANModule::receive(const QCString ¶m, const QByteArray &arg) { qDebug("WLANModule::receive "+param); QStringList params = QStringList::split(",",param); int count = params.count(); qDebug("WLANModule got %i params", count ); if (count < 2){ qDebug("Erorr less than 2 parameter"); qDebug("RETURNING"); return; } QDataStream stream(arg,IO_ReadOnly); QString interface; QString action; while (! stream.atEnd() ){ stream >> interface; stream >> action; qDebug("WLANModule got interface %s and acion %s", interface.latin1(), action.latin1()); // find interfaces Interface *ifa=0; for ( Interface *i=list.first(); i != 0; i=list.next() ){ if (i->getInterfaceName() == interface){ qDebug("WLANModule found interface %s",interface.latin1()); ifa = i; } } if (ifa == 0){ - qFatal("WLANModule Did not find %s",interface.latin1()); + qDebug("WLANModule Did not find %s",interface.latin1()); + qDebug("returning"); + return; } if (count == 2){ // those should call the interface directly QWidget *info = getInfo( ifa ); info->showMaximized(); if ( action.contains("start" ) ){ ifa->start(); } else if ( action.contains("restart" ) ){ ifa->restart(); } else if ( action.contains("stop" ) ){ ifa->stop(); }else if ( action.contains("refresh" ) ){ ifa->refresh(); } }else if (count == 3){ QString value; if (!wlanconfigWiget){ //FIXME: what if it got closed meanwhile? wlanconfigWiget = (WLANImp*) configure(ifa); } wlanconfigWiget->showMaximized(); stream >> value; qDebug("WLANModule is setting %s of %s to %s", action.latin1(), interface.latin1(), value.latin1() ); if ( action.contains("ESSID") ){ QComboBox *combo = wlanconfigWiget->essid; bool found = false; for ( int i = 0; i < combo->count(); i++) if ( combo->text( i ) == value ){ combo->setCurrentItem( i ); found = true; } if (!found) combo->insertItem( value, 0 ); }else if ( action.contains("Mode") ){ QComboBox *combo = wlanconfigWiget->mode; for ( int i = 0; i < combo->count(); i++) if ( combo->text( i ) == value ){ combo->setCurrentItem( i ); } }else if (action.contains("Channel")){ wlanconfigWiget->specifyChan->setChecked( true ); wlanconfigWiget->networkChannel->setValue( value.toInt() ); }else if (action.contains("MacAddr")){ wlanconfigWiget->specifyAp->setChecked( true ); wlanconfigWiget->macEdit->setText( value ); }else qDebug("wlan plugin has no clue"); } }// while stream } QWidget *WLANModule::getInfo( Interface *i) { qDebug("WLANModule::getInfo start"); WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose); InterfaceInformationImp *information = new InterfaceInformationImp(info->tabWidget, "InterfaceSetupImp", i); info->tabWidget->insertTab(information, "TCP/IP", 0); qDebug("WLANModule::getInfo return"); return info; } |