summaryrefslogtreecommitdiff
authorkergoth <kergoth>2003-04-09 18:10:11 (UTC)
committer kergoth <kergoth>2003-04-09 18:10:11 (UTC)
commitbacff63f1e4915c683a409e81b18ffcf5aeceda3 (patch) (unidiff)
treea1b898223bd132a29964ec28a89c0756fa9828cf
parentdc219288ae070e0fe91e2d7da768d620f8b91592 (diff)
downloadopie-bacff63f1e4915c683a409e81b18ffcf5aeceda3.zip
opie-bacff63f1e4915c683a409e81b18ffcf5aeceda3.tar.gz
opie-bacff63f1e4915c683a409e81b18ffcf5aeceda3.tar.bz2
Make networksettings actually compile again. Fix the ifdef on non-kde to actually work, and killed off more references to qt3 widget flags.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp2
-rw-r--r--noncore/settings/networksettings/mainwindowimp.cpp20
-rw-r--r--noncore/settings/networksettings/mainwindowimp.h4
-rw-r--r--noncore/settings/networksettings/wlan/wlanimp.cpp2
4 files changed, 14 insertions, 14 deletions
diff --git a/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp b/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp
index 15293fd..e00dcce 100644
--- a/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp
+++ b/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp
@@ -1,33 +1,33 @@
1#include "interfaceinformationimp.h" 1#include "interfaceinformationimp.h"
2#include "interfaceadvanced.h" 2#include "interfaceadvanced.h"
3 3
4#include <qpushbutton.h> 4#include <qpushbutton.h>
5#include <qlabel.h> 5#include <qlabel.h>
6#include <qgroupbox.h> 6#include <qgroupbox.h>
7#include <qmessagebox.h> 7#include <qmessagebox.h>
8 8
9#ifdef QTE_VERSION 9#ifdef QWS
10#else 10#else
11 #define showMaximized show 11 #define showMaximized show
12#endif 12#endif
13 13
14/** 14/**
15 * Constructor for the InterfaceInformationImp class. This class pretty much 15 * Constructor for the InterfaceInformationImp class. This class pretty much
16 * just display's information about the interface that is passed to it. 16 * just display's information about the interface that is passed to it.
17 */ 17 */
18InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *name, Interface *i, WFlags f):InterfaceInformation(parent, name, f), interface(i){ 18InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *name, Interface *i, WFlags f):InterfaceInformation(parent, name, f), interface(i){
19 connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *))); 19 connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *)));
20 connect(i, SIGNAL(updateMessage(const QString &)), this, SLOT(showMessage(const QString &))); 20 connect(i, SIGNAL(updateMessage(const QString &)), this, SLOT(showMessage(const QString &)));
21 updateInterface(interface); 21 updateInterface(interface);
22 connect(startButton, SIGNAL(clicked()), interface, SLOT(start())); 22 connect(startButton, SIGNAL(clicked()), interface, SLOT(start()));
23 connect(stopButton, SIGNAL(clicked()), interface, SLOT(stop())); 23 connect(stopButton, SIGNAL(clicked()), interface, SLOT(stop()));
24 connect(restartButton, SIGNAL(clicked()), interface, SLOT(restart())); 24 connect(restartButton, SIGNAL(clicked()), interface, SLOT(restart()));
25 connect(refreshButton, SIGNAL(clicked()), interface, SLOT(refresh())); 25 connect(refreshButton, SIGNAL(clicked()), interface, SLOT(refresh()));
26 connect(advancedButton, SIGNAL(clicked()), this, SLOT(advanced())); 26 connect(advancedButton, SIGNAL(clicked()), this, SLOT(advanced()));
27} 27}
28 28
29/** 29/**
30 * Update the interface information and buttons. 30 * Update the interface information and buttons.
31 * @param Intarface *i the interface to update (should be the one we already 31 * @param Intarface *i the interface to update (should be the one we already
32 * know about). 32 * know about).
33 */ 33 */
diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp
index d6b708b..581b7e3 100644
--- a/noncore/settings/networksettings/mainwindowimp.cpp
+++ b/noncore/settings/networksettings/mainwindowimp.cpp
@@ -1,87 +1,87 @@
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" 5#include "interfaces.h"
6#include "module.h" 6#include "module.h"
7 7
8#include <qpushbutton.h> 8#include <qpushbutton.h>
9#include <qlistbox.h> 9#include <qlistbox.h>
10#include <qlineedit.h> 10#include <qlineedit.h>
11#include <qlistview.h> 11#include <qlistview.h>
12#include <qheader.h> 12#include <qheader.h>
13#include <qlabel.h> 13#include <qlabel.h>
14 14
15#include <qmessagebox.h> 15#include <qmessagebox.h>
16 16
17#ifdef QTE_VERSION 17#ifdef QWS
18 #include <qpe/config.h> 18 #include <qpe/config.h>
19 #include <qpe/qlibrary.h> 19 #include <qpe/qlibrary.h>
20 #include <qpe/resource.h> 20 #include <qpe/resource.h>
21 #include <qpe/qpeapplication.h> 21 #include <qpe/qpeapplication.h>
22 #define QLibrary 22// #define QLibrary Library
23#else 23#else
24 #include <klibloader.h> 24 #include <klibloader.h>
25 #define QLibrary KLibrary 25 #define QLibrary KLibrary
26 #include <kconfig.h> 26 #include <kconfig.h>
27 #define Config KConfig 27 #define Config KConfig
28 #include <kapplication.h> 28 #include <kapplication.h>
29 #include <kstandarddirs.h> 29 #include <kstandarddirs.h>
30 #include <kiconloader.h> 30 #include <kiconloader.h>
31 #define showMaximized show 31 #define showMaximized show
32#endif 32#endif
33 33
34#if QT_VERSION < 300 34#if QT_VERSION < 300
35#include <qlist.h> 35#include <qlist.h>
36#else 36#else
37#include <qptrlist.h> 37#include <qptrlist.h>
38#endif 38#endif
39#include <qdir.h> 39#include <qdir.h>
40#include <qfile.h> 40#include <qfile.h>
41#include <qtextstream.h> 41#include <qtextstream.h>
42#include <qregexp.h> 42#include <qregexp.h>
43 43
44#include <net/if.h> 44#include <net/if.h>
45#include <sys/ioctl.h> 45#include <sys/ioctl.h>
46 46
47#define DEFAULT_SCHEME "/var/lib/pcmcia/scheme" 47#define DEFAULT_SCHEME "/var/lib/pcmcia/scheme"
48 48
49MainWindowImp::MainWindowImp(QWidget *parent, const char *name) : MainWindow(parent, name), advancedUserMode(true), scheme(DEFAULT_SCHEME){ 49MainWindowImp::MainWindowImp(QWidget *parent, const char *name) : MainWindow(parent, name), advancedUserMode(true), scheme(DEFAULT_SCHEME){
50 connect(addConnectionButton, SIGNAL(clicked()), this, SLOT(addClicked())); 50 connect(addConnectionButton, SIGNAL(clicked()), this, SLOT(addClicked()));
51 connect(removeConnectionButton, SIGNAL(clicked()), this, SLOT(removeClicked())); 51 connect(removeConnectionButton, SIGNAL(clicked()), this, SLOT(removeClicked()));
52 connect(informationConnectionButton, SIGNAL(clicked()), this, SLOT(informationClicked())); 52 connect(informationConnectionButton, SIGNAL(clicked()), this, SLOT(informationClicked()));
53 connect(configureConnectionButton, SIGNAL(clicked()), this, SLOT(configureClicked())); 53 connect(configureConnectionButton, SIGNAL(clicked()), this, SLOT(configureClicked()));
54 54
55 connect(newProfileButton, SIGNAL(clicked()), this, SLOT(addProfile())); 55 connect(newProfileButton, SIGNAL(clicked()), this, SLOT(addProfile()));
56 connect(removeProfileButton, SIGNAL(clicked()), this, SLOT(removeProfile())); 56 connect(removeProfileButton, SIGNAL(clicked()), this, SLOT(removeProfile()));
57 connect(setCurrentProfileButton, SIGNAL(clicked()), this, SLOT(changeProfile())); 57 connect(setCurrentProfileButton, SIGNAL(clicked()), this, SLOT(changeProfile()));
58 58
59 connect(newProfile, SIGNAL(textChanged(const QString&)), this, SLOT(newProfileChanged(const QString&))); 59 connect(newProfile, SIGNAL(textChanged(const QString&)), this, SLOT(newProfileChanged(const QString&)));
60 // Load connections. 60 // Load connections.
61 // /usr/local/kde/lib/libinterfaces.la 61 // /usr/local/kde/lib/libinterfaces.la
62#ifdef QTE_VERSION 62#ifdef QWS
63 loadModules(QPEApplication::kdeDir() + "/plugins/networksettings"); 63 loadModules(QPEApplication::qpeDir() + "/plugins/networksettings");
64#else 64#else
65 loader = KLibLoader::self(); 65 loader = KLibLoader::self();
66 loadModules(QString("/usr/")+KStandardDirs::kde_default("lib")); 66 loadModules(QString("/usr/")+KStandardDirs::kde_default("lib"));
67#endif 67#endif
68 getAllInterfaces(); 68 getAllInterfaces();
69 69
70 Interfaces i; 70 Interfaces i;
71 QStringList list = i.getInterfaceList(); 71 QStringList list = i.getInterfaceList();
72 QMap<QString, Interface*>::Iterator it; 72 QMap<QString, Interface*>::Iterator it;
73 for ( QStringList::Iterator ni = list.begin(); ni != list.end(); ++ni ) { 73 for ( QStringList::Iterator ni = list.begin(); ni != list.end(); ++ni ) {
74 bool found = false; 74 bool found = false;
75 for( it = interfaceNames.begin(); it != interfaceNames.end(); ++it ){ 75 for( it = interfaceNames.begin(); it != interfaceNames.end(); ++it ){
76 if(it.key() == (*ni)) 76 if(it.key() == (*ni))
77 found = true; 77 found = true;
78 } 78 }
79 if(!found){ 79 if(!found){
80 if(!(*ni).contains("_")){ 80 if(!(*ni).contains("_")){
81 Interface *i = new Interface(this, *ni, false); 81 Interface *i = new Interface(this, *ni, false);
82 i->setAttached(false); 82 i->setAttached(false);
83 i->setHardwareName("Disconnected"); 83 i->setHardwareName("Disconnected");
84 interfaceNames.insert(i->getInterfaceName(), i); 84 interfaceNames.insert(i->getInterfaceName(), i);
85 updateInterface(i); 85 updateInterface(i);
86 connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *))); 86 connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *)));
87 } 87 }
@@ -109,49 +109,49 @@ MainWindowImp::MainWindowImp(QWidget *parent, const char *name) : MainWindow(par
109 currentProfileLabel->setText(line); 109 currentProfileLabel->setText(line);
110 break; 110 break;
111 } 111 }
112 } 112 }
113 file.close(); 113 file.close();
114 } 114 }
115} 115}
116 116
117/** 117/**
118 * Deconstructor. Save profiles. Delete loaded libraries. 118 * Deconstructor. Save profiles. Delete loaded libraries.
119 */ 119 */
120MainWindowImp::~MainWindowImp(){ 120MainWindowImp::~MainWindowImp(){
121 // Save profiles. 121 // Save profiles.
122 Config cfg("NetworkSetup"); 122 Config cfg("NetworkSetup");
123 cfg.setGroup("General"); 123 cfg.setGroup("General");
124 cfg.writeEntry("Profiles", profiles.join(" ")); 124 cfg.writeEntry("Profiles", profiles.join(" "));
125 125
126 // Delete all interfaces that don't have owners. 126 // Delete all interfaces that don't have owners.
127 QMap<Interface*, QListViewItem*>::Iterator iIt; 127 QMap<Interface*, QListViewItem*>::Iterator iIt;
128 for( iIt = items.begin(); iIt != items.end(); ++iIt ){ 128 for( iIt = items.begin(); iIt != items.end(); ++iIt ){
129 if(iIt.key()->getModuleOwner() == NULL) 129 if(iIt.key()->getModuleOwner() == NULL)
130 delete iIt.key(); 130 delete iIt.key();
131 } 131 }
132 132
133#ifdef QTE_VERSION 133#ifdef QWS
134 // Delete Modules and Libraries 134 // Delete Modules and Libraries
135 QMap<Module*, QLibrary*>::Iterator it; 135 QMap<Module*, QLibrary*>::Iterator it;
136 for( it = libraries.begin(); it != libraries.end(); ++it ){ 136 for( it = libraries.begin(); it != libraries.end(); ++it ){
137 delete it.key(); 137 delete it.key();
138 // I wonder why I can't delete the libraries 138 // I wonder why I can't delete the libraries
139 // What fucking shit this is. 139 // What fucking shit this is.
140 //delete it.data(); 140 //delete it.data();
141 } 141 }
142#else 142#else
143 // klibloader automaticly deletes the libraries for us... 143 // klibloader automaticly deletes the libraries for us...
144#endif 144#endif
145} 145}
146 146
147/** 147/**
148 * Query the kernel for all of the interfaces. 148 * Query the kernel for all of the interfaces.
149 */ 149 */
150void MainWindowImp::getAllInterfaces(){ 150void MainWindowImp::getAllInterfaces(){
151 int sockfd = socket(AF_INET, SOCK_DGRAM, 0); 151 int sockfd = socket(AF_INET, SOCK_DGRAM, 0);
152 if(sockfd == -1) 152 if(sockfd == -1)
153 return; 153 return;
154 154
155 char buf[8*1024]; 155 char buf[8*1024];
156 struct ifconf ifc; 156 struct ifconf ifc;
157 ifc.ifc_len = sizeof(buf); 157 ifc.ifc_len = sizeof(buf);
@@ -225,49 +225,49 @@ void MainWindowImp::loadModules(const QString &path){
225 225
226 // Don't want sym links 226 // Don't want sym links
227 d.setFilter( QDir::Files | QDir::NoSymLinks ); 227 d.setFilter( QDir::Files | QDir::NoSymLinks );
228 const QFileInfoList *list = d.entryInfoList(); 228 const QFileInfoList *list = d.entryInfoList();
229 QFileInfoListIterator it( *list ); 229 QFileInfoListIterator it( *list );
230 QFileInfo *fi; 230 QFileInfo *fi;
231 while ( (fi=it.current()) ) { 231 while ( (fi=it.current()) ) {
232 if(fi->fileName().contains(".so") && fi->fileName().contains("networksettings_")){ 232 if(fi->fileName().contains(".so") && fi->fileName().contains("networksettings_")){
233 loadPlugin(path + "/" + fi->fileName()); 233 loadPlugin(path + "/" + fi->fileName());
234 } 234 }
235 ++it; 235 ++it;
236 } 236 }
237} 237}
238 238
239/** 239/**
240 * Attempt to load a function and resolve a function. 240 * Attempt to load a function and resolve a function.
241 * @param pluginFileName - the name of the file in which to attempt to load 241 * @param pluginFileName - the name of the file in which to attempt to load
242 * @param resolveString - function pointer to resolve 242 * @param resolveString - function pointer to resolve
243 * @return pointer to the function with name resolveString or NULL 243 * @return pointer to the function with name resolveString or NULL
244 */ 244 */
245Module* MainWindowImp::loadPlugin(const QString &pluginFileName, const QString &resolveString){ 245Module* MainWindowImp::loadPlugin(const QString &pluginFileName, const QString &resolveString){
246#ifdef DEBUG 246#ifdef DEBUG
247 qDebug("MainWindowImp::loadPlugin: %s", pluginFileName.latin1()); 247 qDebug("MainWindowImp::loadPlugin: %s", pluginFileName.latin1());
248#endif 248#endif
249#ifdef QTE_VERSION 249#ifdef QWS
250 QLibrary *lib = new QLibrary(pluginFileName); 250 QLibrary *lib = new QLibrary(pluginFileName);
251 void *functionPointer = lib->resolve(resolveString); 251 void *functionPointer = lib->resolve(resolveString);
252 if( !functionPointer ){ 252 if( !functionPointer ){
253#ifdef DEBUG 253#ifdef DEBUG
254 qDebug("MainWindowImp::loadPlugin: File: %s is not a plugin, but though was.", pluginFileName.latin1()); 254 qDebug("MainWindowImp::loadPlugin: File: %s is not a plugin, but though was.", pluginFileName.latin1());
255#endif 255#endif
256 delete lib; 256 delete lib;
257 return NULL; 257 return NULL;
258 } 258 }
259 // Try to get an object. 259 // Try to get an object.
260 Module *object = ((Module* (*)()) functionPointer)(); 260 Module *object = ((Module* (*)()) functionPointer)();
261 if(object == NULL){ 261 if(object == NULL){
262#ifdef DEBUG 262#ifdef DEBUG
263 qDebug("MainWindowImp: Couldn't create object, but did load library!"); 263 qDebug("MainWindowImp: Couldn't create object, but did load library!");
264#endif 264#endif
265 delete lib; 265 delete lib;
266 return NULL; 266 return NULL;
267 } 267 }
268 268
269 // Store for deletion later 269 // Store for deletion later
270 libraries.insert(object, lib); 270 libraries.insert(object, lib);
271 return object; 271 return object;
272 272
273#else 273#else
@@ -361,139 +361,139 @@ void MainWindowImp::removeClicked(){
361 } 361 }
362} 362}
363 363
364/** 364/**
365 * Pull up the configure about the currently selected interface. 365 * Pull up the configure about the currently selected interface.
366 * Report an error if no interface is selected. 366 * Report an error if no interface is selected.
367 * If the interface has a module owner then request its configure. 367 * If the interface has a module owner then request its configure.
368 */ 368 */
369void MainWindowImp::configureClicked(){ 369void MainWindowImp::configureClicked(){
370 QListViewItem *item = connectionList->currentItem(); 370 QListViewItem *item = connectionList->currentItem();
371 if(!item){ 371 if(!item){
372 QMessageBox::information(this, "Sorry","Please select an interface first.", QMessageBox::Ok); 372 QMessageBox::information(this, "Sorry","Please select an interface first.", QMessageBox::Ok);
373 return; 373 return;
374 } 374 }
375 375
376 Interface *i = interfaceItems[item]; 376 Interface *i = interfaceItems[item];
377 if(i->getModuleOwner()){ 377 if(i->getModuleOwner()){
378 QWidget *moduleConfigure = i->getModuleOwner()->configure(i); 378 QWidget *moduleConfigure = i->getModuleOwner()->configure(i);
379 if(moduleConfigure != NULL){ 379 if(moduleConfigure != NULL){
380 moduleConfigure->showMaximized(); 380 moduleConfigure->showMaximized();
381 return; 381 return;
382 } 382 }
383 } 383 }
384 384
385 InterfaceSetupImpDialog *configure = new InterfaceSetupImpDialog(this, "InterfaceSetupImp", i, true, Qt::WShowModal | Qt::WDestructiveClose | Qt::WType_Dialog); 385 InterfaceSetupImpDialog *configure = new InterfaceSetupImpDialog(this, "InterfaceSetupImp", i, true, Qt::WType_Modal | Qt::WDestructiveClose | Qt::WStyle_Dialog);
386 QString currentProfileText = currentProfileLabel->text(); 386 QString currentProfileText = currentProfileLabel->text();
387 if(currentProfileText.upper() == "ALL"); 387 if(currentProfileText.upper() == "ALL");
388 currentProfileText = ""; 388 currentProfileText = "";
389 configure->setProfile(currentProfileText); 389 configure->setProfile(currentProfileText);
390 configure->showMaximized(); 390 configure->showMaximized();
391} 391}
392 392
393/** 393/**
394 * Pull up the information about the currently selected interface. 394 * Pull up the information about the currently selected interface.
395 * Report an error if no interface is selected. 395 * Report an error if no interface is selected.
396 * If the interface has a module owner then request its configure. 396 * If the interface has a module owner then request its configure.
397 */ 397 */
398void MainWindowImp::informationClicked(){ 398void MainWindowImp::informationClicked(){
399 QListViewItem *item = connectionList->currentItem(); 399 QListViewItem *item = connectionList->currentItem();
400 if(!item){ 400 if(!item){
401 QMessageBox::information(this, "Sorry","Please select an interface First.", QMessageBox::Ok); 401 QMessageBox::information(this, "Sorry","Please select an interface First.", QMessageBox::Ok);
402 return; 402 return;
403 } 403 }
404 404
405 Interface *i = interfaceItems[item]; 405 Interface *i = interfaceItems[item];
406 if(!i->isAttached()){ 406 if(!i->isAttached()){
407 QMessageBox::information(this, "Sorry","No information about\na disconnected interface.", QMessageBox::Ok); 407 QMessageBox::information(this, "Sorry","No information about\na disconnected interface.", QMessageBox::Ok);
408 return; 408 return;
409 } 409 }
410 410
411 if(i->getModuleOwner()){ 411 if(i->getModuleOwner()){
412 QWidget *moduleInformation = i->getModuleOwner()->information(i); 412 QWidget *moduleInformation = i->getModuleOwner()->information(i);
413 if(moduleInformation != NULL){ 413 if(moduleInformation != NULL){
414 moduleInformation->showMaximized(); 414 moduleInformation->showMaximized();
415#ifdef DEBUG 415#ifdef DEBUG
416 qDebug("MainWindowImp::informationClicked:: Module owner has created, we showed."); 416 qDebug("MainWindowImp::informationClicked:: Module owner has created, we showed.");
417#endif 417#endif
418 return; 418 return;
419 } 419 }
420 } 420 }
421 InterfaceInformationImp *information = new InterfaceInformationImp(this, "InterfaceSetupImp", i, Qt::WShowModal | Qt::WDestructiveClose | Qt::WType_Dialog); 421 InterfaceInformationImp *information = new InterfaceInformationImp(this, "InterfaceSetupImp", i, Qt::WType_Modal | Qt::WDestructiveClose | Qt::WStyle_Dialog);
422 information->showMaximized(); 422 information->showMaximized();
423} 423}
424 424
425/** 425/**
426 * Update this interface. If no QListViewItem exists create one. 426 * Update this interface. If no QListViewItem exists create one.
427 * @param Interface* pointer to the interface that needs to be updated. 427 * @param Interface* pointer to the interface that needs to be updated.
428 */ 428 */
429void MainWindowImp::updateInterface(Interface *i){ 429void MainWindowImp::updateInterface(Interface *i){
430 if(!advancedUserMode){ 430 if(!advancedUserMode){
431 if(i->getInterfaceName() == "lo") 431 if(i->getInterfaceName() == "lo")
432 return; 432 return;
433 } 433 }
434 434
435 QListViewItem *item = NULL; 435 QListViewItem *item = NULL;
436 436
437 // Find the interface, making it if needed. 437 // Find the interface, making it if needed.
438 if(items.find(i) == items.end()){ 438 if(items.find(i) == items.end()){
439 item = new QListViewItem(connectionList, "", "", ""); 439 item = new QListViewItem(connectionList, "", "", "");
440 // See if you can't find a module owner for this interface 440 // See if you can't find a module owner for this interface
441 QMap<Module*, QLibrary*>::Iterator it; 441 QMap<Module*, QLibrary*>::Iterator it;
442 for( it = libraries.begin(); it != libraries.end(); ++it ){ 442 for( it = libraries.begin(); it != libraries.end(); ++it ){
443 if(it.key()->isOwner(i)) 443 if(it.key()->isOwner(i))
444 i->setModuleOwner(it.key()); 444 i->setModuleOwner(it.key());
445 } 445 }
446 items.insert(i, item); 446 items.insert(i, item);
447 interfaceItems.insert(item, i); 447 interfaceItems.insert(item, i);
448 } 448 }
449 else 449 else
450 item = items[i]; 450 item = items[i];
451 451
452 // Update the icons and information 452 // Update the icons and information
453#ifdef QTE_VERSION 453#ifdef QWS
454 item->setPixmap(0, (Resource::loadPixmap(i->getStatus() ? "up": "down"))); 454 item->setPixmap(0, (Resource::loadPixmap(i->getStatus() ? "up": "down")));
455#else 455#else
456 item->setPixmap(0, (SmallIcon(i->getStatus() ? "up": "down"))); 456 item->setPixmap(0, (SmallIcon(i->getStatus() ? "up": "down")));
457#endif 457#endif
458 458
459 QString typeName = "lan"; 459 QString typeName = "lan";
460 if(i->getHardwareName().contains("Local Loopback")) 460 if(i->getHardwareName().contains("Local Loopback"))
461 typeName = "lo"; 461 typeName = "lo";
462 if(i->getInterfaceName().contains("irda")) 462 if(i->getInterfaceName().contains("irda"))
463 typeName = "irda"; 463 typeName = "irda";
464 if(i->getInterfaceName().contains("wlan")) 464 if(i->getInterfaceName().contains("wlan"))
465 typeName = "wlan"; 465 typeName = "wlan";
466 if(i->getInterfaceName().contains("usb")) 466 if(i->getInterfaceName().contains("usb"))
467 typeName = "usb"; 467 typeName = "usb";
468 468
469 if(!i->isAttached()) 469 if(!i->isAttached())
470 typeName = "connect_no"; 470 typeName = "connect_no";
471 // Actually try to use the Module 471 // Actually try to use the Module
472 if(i->getModuleOwner() != NULL) 472 if(i->getModuleOwner() != NULL)
473 typeName = i->getModuleOwner()->getPixmapName(i); 473 typeName = i->getModuleOwner()->getPixmapName(i);
474 474
475#ifdef QTE_VERSION 475#ifdef QWS
476 item->setPixmap(1, (Resource::loadPixmap(QString("networksettings/") + typeName))); 476 item->setPixmap(1, (Resource::loadPixmap(QString("networksettings/") + typeName)));
477#else 477#else
478 item->setPixmap(1, (SmallIcon(typeName))); 478 item->setPixmap(1, (SmallIcon(typeName)));
479#endif 479#endif
480 item->setText(2, i->getHardwareName()); 480 item->setText(2, i->getHardwareName());
481 item->setText(3, QString("(%1)").arg(i->getInterfaceName())); 481 item->setText(3, QString("(%1)").arg(i->getInterfaceName()));
482 item->setText(4, (i->getStatus()) ? i->getIp() : QString("")); 482 item->setText(4, (i->getStatus()) ? i->getIp() : QString(""));
483} 483}
484 484
485void MainWindowImp::newProfileChanged(const QString& newText){ 485void MainWindowImp::newProfileChanged(const QString& newText){
486 if(newText.length() > 0) 486 if(newText.length() > 0)
487 newProfileButton->setEnabled(true); 487 newProfileButton->setEnabled(true);
488 else 488 else
489 newProfileButton->setEnabled(false); 489 newProfileButton->setEnabled(false);
490} 490}
491 491
492/** 492/**
493 * Adds a new profile to the list of profiles. 493 * Adds a new profile to the list of profiles.
494 * Don't add profiles that already exists. 494 * Don't add profiles that already exists.
495 * Appends to the list and QStringList 495 * Appends to the list and QStringList
496 */ 496 */
497void MainWindowImp::addProfile(){ 497void MainWindowImp::addProfile(){
498 QString newProfileName = newProfile->text(); 498 QString newProfileName = newProfile->text();
499 if(profiles.grep(newProfileName).count() > 0){ 499 if(profiles.grep(newProfileName).count() > 0){
diff --git a/noncore/settings/networksettings/mainwindowimp.h b/noncore/settings/networksettings/mainwindowimp.h
index 2ebf304..49f3eea 100644
--- a/noncore/settings/networksettings/mainwindowimp.h
+++ b/noncore/settings/networksettings/mainwindowimp.h
@@ -1,69 +1,69 @@
1#ifndef MAINWINOWIMP_H 1#ifndef MAINWINOWIMP_H
2#define MAINWINOWIMP_H 2#define MAINWINOWIMP_H
3 3
4#include "mainwindow.h" 4#include "mainwindow.h"
5#include <qmap.h> 5#include <qmap.h>
6#include <qstringlist.h> 6#include <qstringlist.h>
7 7
8class Module; 8class Module;
9class Interface; 9class Interface;
10class QLibrary; 10class QLibrary;
11class KProcess; 11class KProcess;
12#ifdef QTE_VERSION 12#ifdef QWS
13class QLibrary; 13class QLibrary;
14#else 14#else
15class KLibrary; 15class KLibrary;
16class KLibLoader; 16class KLibLoader;
17#define QLibrary KLibrary 17#define QLibrary KLibrary
18#endif 18#endif
19 19
20 20
21class MainWindowImp : public MainWindow { 21class MainWindowImp : public MainWindow {
22 Q_OBJECT 22 Q_OBJECT
23 23
24public: 24public:
25 MainWindowImp(QWidget *parent=0, const char *name=0); 25 MainWindowImp(QWidget *parent=0, const char *name=0);
26 ~MainWindowImp(); 26 ~MainWindowImp();
27 27
28private slots: 28private slots:
29 void getAllInterfaces(); 29 void getAllInterfaces();
30 30
31 void addClicked(); 31 void addClicked();
32 void removeClicked(); 32 void removeClicked();
33 void configureClicked(); 33 void configureClicked();
34 void informationClicked(); 34 void informationClicked();
35 35
36 void addProfile(); 36 void addProfile();
37 void removeProfile(); 37 void removeProfile();
38 void changeProfile(); 38 void changeProfile();
39 39
40 void updateInterface(Interface *i); 40 void updateInterface(Interface *i);
41 void newProfileChanged(const QString& newText); 41 void newProfileChanged(const QString& newText);
42 42
43private: 43private:
44 void loadModules(const QString &path); 44 void loadModules(const QString &path);
45 45
46 Module* loadPlugin(const QString &pluginFileName, 46 Module* loadPlugin(const QString &pluginFileName,
47 const QString &resolveString = "create_plugin"); 47 const QString &resolveString = "create_plugin");
48 48
49 // For our local list of names 49 // For our local list of names
50 QMap<QString, Interface*> interfaceNames; 50 QMap<QString, Interface*> interfaceNames;
51 51
52 QMap<Module*, QLibrary*> libraries; 52 QMap<Module*, QLibrary*> libraries;
53 QMap<Interface*, QListViewItem*> items; 53 QMap<Interface*, QListViewItem*> items;
54 QMap<QListViewItem*, Interface*> interfaceItems; 54 QMap<QListViewItem*, Interface*> interfaceItems;
55 55
56 QMap<KProcess*, QString> threads; 56 QMap<KProcess*, QString> threads;
57 QStringList profiles; 57 QStringList profiles;
58 58
59 bool advancedUserMode; 59 bool advancedUserMode;
60 QString scheme; 60 QString scheme;
61#ifndef QTE_VERSION 61#ifndef QWS
62 KLibLoader *loader; 62 KLibLoader *loader;
63#endif 63#endif
64}; 64};
65 65
66#endif 66#endif
67 67
68// mainwindowimp.h 68// mainwindowimp.h
69 69
diff --git a/noncore/settings/networksettings/wlan/wlanimp.cpp b/noncore/settings/networksettings/wlan/wlanimp.cpp
index 57266bb..8bf004f 100644
--- a/noncore/settings/networksettings/wlan/wlanimp.cpp
+++ b/noncore/settings/networksettings/wlan/wlanimp.cpp
@@ -1,40 +1,40 @@
1#include "wlanimp.h" 1#include "wlanimp.h"
2#include "interfacesetupimp.h" 2#include "interfacesetupimp.h"
3 3
4#include <qfile.h> 4#include <qfile.h>
5#include <qdir.h> 5#include <qdir.h>
6#include <qtextstream.h> 6#include <qtextstream.h>
7#include <qmessagebox.h> 7#include <qmessagebox.h>
8#include <qlineedit.h> 8#include <qlineedit.h>
9#include <qlabel.h> 9#include <qlabel.h>
10#include <qspinbox.h> 10#include <qspinbox.h>
11#include <qradiobutton.h> 11#include <qradiobutton.h>
12#include <qcheckbox.h> 12#include <qcheckbox.h>
13#include <qtabwidget.h> 13#include <qtabwidget.h>
14#include <qcombobox.h> 14#include <qcombobox.h>
15 15
16#ifdef QTE_VERSION 16#ifdef QWS
17 #include <opie/oprocess.h> 17 #include <opie/oprocess.h>
18#else 18#else
19 #define OProcess KProcess 19 #define OProcess KProcess
20 #include <kprocess.h> 20 #include <kprocess.h>
21#endif 21#endif
22 22
23#define WIRELESS_OPTS "/etc/pcmcia/wireless.opts" 23#define WIRELESS_OPTS "/etc/pcmcia/wireless.opts"
24 24
25/** 25/**
26 * Constructor, read in the wireless.opts file for parsing later. 26 * Constructor, read in the wireless.opts file for parsing later.
27 */ 27 */
28WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl):WLAN(parent, name, modal, fl), currentProfile("*") { 28WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl):WLAN(parent, name, modal, fl), currentProfile("*") {
29 interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i); 29 interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i);
30 tabWidget->insertTab(interfaceSetup, "TCP/IP"); 30 tabWidget->insertTab(interfaceSetup, "TCP/IP");
31 31
32 // Read in the config file. 32 // Read in the config file.
33 QString wlanFile = WIRELESS_OPTS; 33 QString wlanFile = WIRELESS_OPTS;
34 QFile file(wlanFile); 34 QFile file(wlanFile);
35 if (file.open(IO_ReadOnly)){ 35 if (file.open(IO_ReadOnly)){
36 QTextStream stream( &file ); 36 QTextStream stream( &file );
37 QString line = ""; 37 QString line = "";
38 while ( !stream.eof() ) { 38 while ( !stream.eof() ) {
39 line += stream.readLine(); 39 line += stream.readLine();
40 line += "\n"; 40 line += "\n";