author | benmeyer <benmeyer> | 2002-10-17 15:03:35 (UTC) |
---|---|---|
committer | benmeyer <benmeyer> | 2002-10-17 15:03:35 (UTC) |
commit | 1fa7ebd9512ac0497c3ede198621899a10e961af (patch) (side-by-side diff) | |
tree | 45be4e45b5408f46c3f2e59b1241aebf9a9bf869 /noncore/net/networksetup/mainwindowimp.cpp | |
parent | 6c8ae3c8af454c87f5f467fe17cbdffe4c8f5494 (diff) | |
download | opie-1fa7ebd9512ac0497c3ede198621899a10e961af.zip opie-1fa7ebd9512ac0497c3ede198621899a10e961af.tar.gz opie-1fa7ebd9512ac0497c3ede198621899a10e961af.tar.bz2 |
added interface listing
Diffstat (limited to 'noncore/net/networksetup/mainwindowimp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/networksetup/mainwindowimp.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/noncore/net/networksetup/mainwindowimp.cpp b/noncore/net/networksetup/mainwindowimp.cpp index 36f12e0..24af1ec 100644 --- a/noncore/net/networksetup/mainwindowimp.cpp +++ b/noncore/net/networksetup/mainwindowimp.cpp @@ -1,10 +1,12 @@ #include "mainwindowimp.h"
#include "addconnectionimp.h"
#include "interfaceinformationimp.h"
#include "interfacesetupimp.h"
+#include "interfaces.h"
+
#include "module.h"
#include "kprocess.h"
#include <qpushbutton.h>
#include <qtabwidget.h>
@@ -329,12 +331,29 @@ void MainWindowImp::jobDone(KProcess *process){ interfaceNames.insert(i->getInterfaceName(), i);
updateInterface(i);
}
}
file.close();
QFile::remove(fileName);
+ if(threads.count() == 0){
+ Interfaces i;
+ QStringList list = i.getInterfaceList();
+ QMap<QString, Interface*>::Iterator it;
+ for ( QStringList::Iterator ni = list.begin(); ni != list.end(); ++ni ) {
+ for( it = interfaceNames.begin(); it != interfaceNames.end(); ++it ){
+ if(it.key() == (*ni)){
+ Interface *i = new Interface(*ni, false);
+ i->setAttached(false);
+ i->setHardwareName(QString("Disconnected (%1)").arg(*ni));
+ i->setInterfaceName(*ni);
+ interfaceNames.insert(i->getInterfaceName(), i);
+ updateInterface(i);
+ }
+ }
+ }
+ }
}
/**
* Update this interface. If no QListViewItem exists create one.
* @param Interface* pointer to the interface that needs to be updated.
*/
@@ -363,12 +382,15 @@ void MainWindowImp::updateInterface(Interface *i){ if(i->getHardwareName().contains("Local Loopback"))
typeName = "lo";
if(i->getInterfaceName().contains("irda"))
typeName = "irda";
if(i->getInterfaceName().contains("wlan"))
typeName = "wlan";
+
+ if(!i->isAttached())
+ typeName = "connect_no";
// Actually try to use the Module
if(i->getModuleOwner() != NULL)
typeName = i->getModuleOwner()->getPixmapName(i);
item->setPixmap(1, (Resource::loadPixmap(typeName)));
item->setText(2, i->getHardwareName());
|