summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/mainwindowimp.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings/mainwindowimp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/mainwindowimp.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp
index 36f12e0..24af1ec 100644
--- a/noncore/settings/networksettings/mainwindowimp.cpp
+++ b/noncore/settings/networksettings/mainwindowimp.cpp
@@ -1,10 +1,12 @@
1#include "mainwindowimp.h" 1#include "mainwindowimp.h"
2#include "addconnectionimp.h" 2#include "addconnectionimp.h"
3#include "interfaceinformationimp.h" 3#include "interfaceinformationimp.h"
4#include "interfacesetupimp.h" 4#include "interfacesetupimp.h"
5#include "interfaces.h"
6
5#include "module.h" 7#include "module.h"
6 8
7#include "kprocess.h" 9#include "kprocess.h"
8 10
9#include <qpushbutton.h> 11#include <qpushbutton.h>
10#include <qtabwidget.h> 12#include <qtabwidget.h>
@@ -329,12 +331,29 @@ void MainWindowImp::jobDone(KProcess *process){
329 interfaceNames.insert(i->getInterfaceName(), i); 331 interfaceNames.insert(i->getInterfaceName(), i);
330 updateInterface(i); 332 updateInterface(i);
331 } 333 }
332 } 334 }
333 file.close(); 335 file.close();
334 QFile::remove(fileName); 336 QFile::remove(fileName);
337 if(threads.count() == 0){
338 Interfaces i;
339 QStringList list = i.getInterfaceList();
340 QMap<QString, Interface*>::Iterator it;
341 for ( QStringList::Iterator ni = list.begin(); ni != list.end(); ++ni ) {
342 for( it = interfaceNames.begin(); it != interfaceNames.end(); ++it ){
343 if(it.key() == (*ni)){
344 Interface *i = new Interface(*ni, false);
345 i->setAttached(false);
346 i->setHardwareName(QString("Disconnected (%1)").arg(*ni));
347 i->setInterfaceName(*ni);
348 interfaceNames.insert(i->getInterfaceName(), i);
349 updateInterface(i);
350 }
351 }
352 }
353 }
335} 354}
336 355
337/** 356/**
338 * Update this interface. If no QListViewItem exists create one. 357 * Update this interface. If no QListViewItem exists create one.
339 * @param Interface* pointer to the interface that needs to be updated. 358 * @param Interface* pointer to the interface that needs to be updated.
340 */ 359 */
@@ -363,12 +382,15 @@ void MainWindowImp::updateInterface(Interface *i){
363 if(i->getHardwareName().contains("Local Loopback")) 382 if(i->getHardwareName().contains("Local Loopback"))
364 typeName = "lo"; 383 typeName = "lo";
365 if(i->getInterfaceName().contains("irda")) 384 if(i->getInterfaceName().contains("irda"))
366 typeName = "irda"; 385 typeName = "irda";
367 if(i->getInterfaceName().contains("wlan")) 386 if(i->getInterfaceName().contains("wlan"))
368 typeName = "wlan"; 387 typeName = "wlan";
388
389 if(!i->isAttached())
390 typeName = "connect_no";
369 // Actually try to use the Module 391 // Actually try to use the Module
370 if(i->getModuleOwner() != NULL) 392 if(i->getModuleOwner() != NULL)
371 typeName = i->getModuleOwner()->getPixmapName(i); 393 typeName = i->getModuleOwner()->getPixmapName(i);
372 394
373 item->setPixmap(1, (Resource::loadPixmap(typeName))); 395 item->setPixmap(1, (Resource::loadPixmap(typeName)));
374 item->setText(2, i->getHardwareName()); 396 item->setText(2, i->getHardwareName());