From a0f88d7d0fb0ffaf8d1aa7b753b0d48ee344e34f Mon Sep 17 00:00:00 2001 From: benmeyer Date: Mon, 30 Sep 2002 19:41:41 +0000 Subject: ui cleanup with groupboxes --- (limited to 'noncore') diff --git a/noncore/net/networksetup/interfaceadvanced.ui b/noncore/net/networksetup/interfaceadvanced.ui index 8ef0b29..7520abe 100644 --- a/noncore/net/networksetup/interfaceadvanced.ui +++ b/noncore/net/networksetup/interfaceadvanced.ui @@ -11,8 +11,8 @@ 0 0 - 197 - 253 + 188 + 277 @@ -99,41 +99,26 @@ Interface - - QLabel - - name - TextLabel9 - - - text - Lease Expires - - - + QLabel name - leaseExpiresLabel - - - frameShape - Panel + TextLabel4 - frameShadow - Sunken + enabled + true text - + Subnet Mask - + QLabel name - leaseObtainedLabel + ipAddressLabel frameShape @@ -145,25 +130,14 @@ text - - - - - QLabel - - name - TextLabel8 - - - text - Lease Obtained + 0.0.0.0 - + QLabel name - dhcpServerLabel + subnetMaskLabel frameShape @@ -175,36 +149,25 @@ text - 255.255.255.255 - - - - QLabel - - name - TextLabel6 - - - text - DHCP Server + 0.0.0.0 - + QLabel name - TextLabel4 + TextLabel2 text - Subnet Mask + Broadcast - + QLabel name - ipAddressLabel + broadcastLabel frameShape @@ -214,31 +177,119 @@ frameShadow Sunken - - text - 0.0.0.0 - - - QLabel + + QGroupBox name - subnetMaskLabel - - - frameShape - Panel - - - frameShadow - Sunken - - - text - 0.0.0.0 - + GroupBox2 + + + title + DHCP Information + + + + margin + 11 + + + spacing + 6 + + + QLabel + + name + TextLabel6 + + + text + DHCP Server + + + + QLabel + + name + leaseExpiresLabel + + + frameShape + Panel + + + frameShadow + Sunken + + + text + + + + + QLabel + + name + leaseObtainedLabel + + + frameShape + Panel + + + frameShadow + Sunken + + + text + + + + + QLabel + + name + TextLabel9 + + + text + Lease Expires + + + + QLabel + + name + TextLabel8 + + + text + Lease Obtained + + + + QLabel + + name + dhcpServerLabel + + + frameShape + Panel + + + frameShadow + Sunken + + + text + + + + - + name Spacer2 @@ -259,43 +310,6 @@ - - QLabel - - name - TextLabel2 - - - text - Broadcast - - - - QLabel - - name - broadcastLabel - - - frameShape - Panel - - - frameShadow - Sunken - - - - Line - - name - Line2 - - - orientation - Horizontal - - @@ -317,7 +331,7 @@ image0 - 789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523250004143a55a6b2e0026630c4f + 789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758 diff --git a/noncore/net/networksetup/interfaceinformation.ui b/noncore/net/networksetup/interfaceinformation.ui index 2a9b3fb..8b6280d 100644 --- a/noncore/net/networksetup/interfaceinformation.ui +++ b/noncore/net/networksetup/interfaceinformation.ui @@ -11,8 +11,8 @@ 0 0 - 191 - 241 + 203 + 244 @@ -100,76 +100,6 @@ Horizontal - - - name - Spacer18 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLayoutWidget - - name - Layout2 - - - - margin - 0 - - - spacing - 6 - - - - name - Spacer10 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QPushButton - - name - advancedButton - - - text - View Advanced Information - - - - QLabel @@ -210,6 +140,14 @@ TextLabel24 + frameShape + MShape + + + frameShadow + MShadow + + text Broadcast @@ -290,6 +228,87 @@ 0.0.0.0 + + + name + Spacer18 + + + orientation + Vertical + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + QLayoutWidget + + name + Layout2 + + + + margin + 0 + + + spacing + 6 + + + + name + Spacer10 + + + orientation + Horizontal + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + QPushButton + + name + advancedButton + + + text + View Advanced Information + + + + + + Line + + name + Line5 + + + orientation + Horizontal + + @@ -314,4 +333,6 @@ 789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758 + + diff --git a/noncore/net/networksetup/interfacesetup.ui b/noncore/net/networksetup/interfacesetup.ui index 698422c..ff9810e 100644 --- a/noncore/net/networksetup/interfacesetup.ui +++ b/noncore/net/networksetup/interfacesetup.ui @@ -11,8 +11,8 @@ 0 0 - 193 - 310 + 177 + 320 @@ -39,17 +39,6 @@ Horizontal - - QLabel - - name - TextLabel4 - - - text - IP Address - - QCheckBox @@ -74,28 +63,6 @@ profileCombo - - QGroupBox - - name - staticGroupBox - - - enabled - false - - - title - Static Ip Configuration - - - - QLineEdit - - name - ipAddressEdit - - QLabel @@ -122,17 +89,6 @@ true - - QLabel - - name - TextLabel5 - - - text - Subnet Mask - - QLabel @@ -167,7 +123,7 @@ 24 - + name Spacer9 @@ -188,66 +144,120 @@ - - QLineEdit - - name - secondDNSLineEdit - - - - QLabel - - name - TextLabel3 - - - text - Second DNS - - - - QLabel - - name - TextLabel2 - - - text - First DNS - - - - QLineEdit - - name - firstDNSLineEdit - - - - QLabel + + QGroupBox name - TextLabel1_2 - - - text - Gateway + staticGroupBox - - - QLineEdit - name - subnetMaskEdit + enabled + false - - - QLineEdit - name - gatewayEdit + title + Static Ip Configuration + + + margin + 11 + + + spacing + 6 + + + QLineEdit + + name + firstDNSLineEdit + + + + QLabel + + name + TextLabel5 + + + text + Subnet Mask + + + + QLineEdit + + name + gatewayEdit + + + + QLineEdit + + name + subnetMaskEdit + + + + QLineEdit + + name + ipAddressEdit + + + + QLabel + + name + TextLabel2 + + + text + First DNS + + + + QLineEdit + + name + secondDNSLineEdit + + + + QLabel + + name + TextLabel4 + + + text + IP Address + + + + QLabel + + name + TextLabel1_2 + + + text + Gateway + + + + QLabel + + name + TextLabel3 + + + text + Second DNS + + + diff --git a/noncore/net/networksetup/mainwindow.ui b/noncore/net/networksetup/mainwindow.ui index f7efe99..c1fa101 100644 --- a/noncore/net/networksetup/mainwindow.ui +++ b/noncore/net/networksetup/mainwindow.ui @@ -271,7 +271,7 @@ text - Set Current + &Set Current diff --git a/noncore/net/networksetup/mainwindowimp.cpp b/noncore/net/networksetup/mainwindowimp.cpp index 2f821a9..0f48a4b 100644 --- a/noncore/net/networksetup/mainwindowimp.cpp +++ b/noncore/net/networksetup/mainwindowimp.cpp @@ -2,10 +2,10 @@ #include "addserviceimp.h" #include "interfaceinformationimp.h" #include "interfacesetupimp.h" -#include "interface.h" #include "kprocess.h" #include "module.h" + #include #include #include @@ -31,11 +31,6 @@ #define TEMP_ALL "/tmp/ifconfig-a" #define TEMP_UP "/tmp/ifconfig" -#define NO_SELECT_ERROR_AND_RETURN { \ - QMessageBox::information(this, "Error","Please select an interface.", "Ok"); \ - return; \ -} - MainWindowImp::MainWindowImp(QWidget *parent, const char *name) : MainWindow(parent, name, true) { connect(addServiceButton, SIGNAL(clicked()), this, SLOT(addClicked())); connect(removeServiceButton, SIGNAL(clicked()), this, SLOT(removeClicked())); @@ -81,6 +76,24 @@ MainWindowImp::~MainWindowImp(){ } void MainWindowImp::loadModules(QString path){ + qDebug(path.latin1()); + QDir d; + d.setPath(path); + if(!d.exists()){ + qDebug("MainWindowImp:: Path doesn't exists"); + return; + } + d.setFilter( QDir::Files | QDir::NoSymLinks ); + const QFileInfoList *list = d.entryInfoList(); + QFileInfoListIterator it( *list ); + QFileInfo *fi; + while ( (fi=it.current()) ) { + if(fi->fileName().contains(".so")){ + qDebug("Found"); + Module *foo = loadPlugin(path + "/" + fi->fileName()); + } + ++it; + } } /** @@ -90,7 +103,7 @@ void MainWindowImp::loadModules(QString path){ * @return pointer to the function with name resolveString or NULL */ Module* MainWindowImp::loadPlugin(QString pluginFileName, QString resolveString){ - //qDebug(pluginFileName.latin1()); + qDebug(pluginFileName.latin1()); QLibrary *lib = new QLibrary(pluginFileName); void *functionPointer = lib->resolve(resolveString); if( !functionPointer ){ @@ -112,34 +125,6 @@ Module* MainWindowImp::loadPlugin(QString pluginFileName, QString resolveString) return object; } -/* -QList MainWindowImp::retrieveUnloadedPluginList(){ - QString DirStr = QDir::homeDirPath() + "/.networksetup/" ; - QString path = DirStr + "plugins"; - QDir d(path); - d.setFilter( QDir::Files | QDir::Hidden ); - - QMap::Iterator libraryIt; - QList rlist; - rlist.setAutoDelete(false); - - const QFileInfoList *list = d.entryInfoList(); - QFileInfoListIterator it( *list ); - QFileInfo *fi; - while ( (fi=it.current()) ) { - if(fi->fileName().contains(".so")){ - for( libraryIt = libraries.begin(); libraryIt != libraries.end(); ++libraryIt ) - if((path + "/" + fi->fileName()) != (libraryIt.data())->library()){ - QString *s = new QString(path + "/" + fi->fileName()); - rlist.append(s); - } - } - ++it; - } - return rlist; -} -*/ - /** * The Add button was clicked. Bring up the add dialog and if OK is hit * load the plugin and append it to the list @@ -161,7 +146,10 @@ void MainWindowImp::addClicked(){ */ void MainWindowImp::removeClicked(){ QListViewItem *item = serviceList->currentItem(); - if(item == NULL) NO_SELECT_ERROR_AND_RETURN + if(item == NULL) { + QMessageBox::information(this, "Error","Please select an interface.", "Ok"); + return; + } if(modules.find(interfaceItems[item]) == modules.end()){ QMessageBox::information(this, "Can't remove interface.", "Interface is built in.", "Ok"); @@ -178,7 +166,10 @@ void MainWindowImp::removeClicked(){ */ void MainWindowImp::configureClicked(){ QListViewItem *item = serviceList->currentItem(); - if(item == NULL) NO_SELECT_ERROR_AND_RETURN + if(item == NULL){ + QMessageBox::information(this, "Error","Please select an interface.", "Ok"); + return; + } if(modules.find(interfaceItems[item]) == modules.end()){ InterfaceSetupImp *conf = new InterfaceSetupImp(0, "InterfaceConfiguration", interfaceItems[item]); @@ -197,8 +188,11 @@ void MainWindowImp::configureClicked(){ */ void MainWindowImp::informationClicked(){ QListViewItem *item = serviceList->currentItem(); - if(item == NULL)NO_SELECT_ERROR_AND_RETURN - + if(item == NULL){ + QMessageBox::information(this, "Error","Please select an interface.", "Ok"); + return; + } + if(modules.find(interfaceItems[item]) == modules.end()){ InterfaceInformationImp *i = new InterfaceInformationImp(0, "InterfaceInformationImp", interfaceItems[item]); i->showMaximized(); @@ -311,6 +305,10 @@ void MainWindowImp::updateInterface(Interface *i){ QString typeName = "lan"; if(i->getHardwareName().contains("Local Loopback")) typeName = "lo"; + if(i->getInterfaceName().contains("irda")) + typeName = "irda"; + if(i->getInterfaceName().contains("wlan")) + typeName = "wlan"; QPixmap type = (Resource::loadPixmap(typeName)); item->setPixmap(1, type); diff --git a/noncore/net/networksetup/module.h b/noncore/net/networksetup/module.h index f146d8c..13fd523 100644 --- a/noncore/net/networksetup/module.h +++ b/noncore/net/networksetup/module.h @@ -1,5 +1,5 @@ -#ifndef MODULE_H -#define MODULE_H +#ifndef NETCONF_MODULE_H +#define NETCONF_MODULE_H #include #include diff --git a/noncore/net/networksetup/networksetup.pro b/noncore/net/networksetup/networksetup.pro index 7d9918b..a01b050 100644 --- a/noncore/net/networksetup/networksetup.pro +++ b/noncore/net/networksetup/networksetup.pro @@ -3,8 +3,8 @@ CONFIG = qt warn_on debug #CONFIG = qt warn_on release HEADERS = mainwindowimp.h addserviceimp.h interface.h interfaceinformationimp.h interfacesetupimp.h interfaces.h defaultmodule.h kprocctrl.h module.h kprocess.h SOURCES = main.cpp mainwindowimp.cpp addserviceimp.cpp interface.cpp interfaceinformationimp.cpp interfacesetupimp.cpp kprocctrl.cpp kprocess.cpp interfaces.cpp -INCLUDEPATH += $(QPEDIR)/include -DEPENDPATH += $(QPEDIR)/include +#INCLUDEPATH += $(QPEDIR)/include +#DEPENDPATH += $(QPEDIR)/include LIBS += -lqpe INTERFACES = mainwindow.ui addservice.ui interfaceinformation.ui interfaceadvanced.ui interfacesetup.ui TARGET = networksetup diff --git a/noncore/settings/networksettings/interfaceadvanced.ui b/noncore/settings/networksettings/interfaceadvanced.ui index 8ef0b29..7520abe 100644 --- a/noncore/settings/networksettings/interfaceadvanced.ui +++ b/noncore/settings/networksettings/interfaceadvanced.ui @@ -11,8 +11,8 @@ 0 0 - 197 - 253 + 188 + 277 @@ -99,41 +99,26 @@ Interface - - QLabel - - name - TextLabel9 - - - text - Lease Expires - - - + QLabel name - leaseExpiresLabel - - - frameShape - Panel + TextLabel4 - frameShadow - Sunken + enabled + true text - + Subnet Mask - + QLabel name - leaseObtainedLabel + ipAddressLabel frameShape @@ -145,25 +130,14 @@ text - - - - - QLabel - - name - TextLabel8 - - - text - Lease Obtained + 0.0.0.0 - + QLabel name - dhcpServerLabel + subnetMaskLabel frameShape @@ -175,36 +149,25 @@ text - 255.255.255.255 - - - - QLabel - - name - TextLabel6 - - - text - DHCP Server + 0.0.0.0 - + QLabel name - TextLabel4 + TextLabel2 text - Subnet Mask + Broadcast - + QLabel name - ipAddressLabel + broadcastLabel frameShape @@ -214,31 +177,119 @@ frameShadow Sunken - - text - 0.0.0.0 - - - QLabel + + QGroupBox name - subnetMaskLabel - - - frameShape - Panel - - - frameShadow - Sunken - - - text - 0.0.0.0 - + GroupBox2 + + + title + DHCP Information + + + + margin + 11 + + + spacing + 6 + + + QLabel + + name + TextLabel6 + + + text + DHCP Server + + + + QLabel + + name + leaseExpiresLabel + + + frameShape + Panel + + + frameShadow + Sunken + + + text + + + + + QLabel + + name + leaseObtainedLabel + + + frameShape + Panel + + + frameShadow + Sunken + + + text + + + + + QLabel + + name + TextLabel9 + + + text + Lease Expires + + + + QLabel + + name + TextLabel8 + + + text + Lease Obtained + + + + QLabel + + name + dhcpServerLabel + + + frameShape + Panel + + + frameShadow + Sunken + + + text + + + + - + name Spacer2 @@ -259,43 +310,6 @@ - - QLabel - - name - TextLabel2 - - - text - Broadcast - - - - QLabel - - name - broadcastLabel - - - frameShape - Panel - - - frameShadow - Sunken - - - - Line - - name - Line2 - - - orientation - Horizontal - - @@ -317,7 +331,7 @@ image0 - 789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523250004143a55a6b2e0026630c4f + 789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758 diff --git a/noncore/settings/networksettings/interfaceinformation.ui b/noncore/settings/networksettings/interfaceinformation.ui index 2a9b3fb..8b6280d 100644 --- a/noncore/settings/networksettings/interfaceinformation.ui +++ b/noncore/settings/networksettings/interfaceinformation.ui @@ -11,8 +11,8 @@ 0 0 - 191 - 241 + 203 + 244 @@ -100,76 +100,6 @@ Horizontal - - - name - Spacer18 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLayoutWidget - - name - Layout2 - - - - margin - 0 - - - spacing - 6 - - - - name - Spacer10 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QPushButton - - name - advancedButton - - - text - View Advanced Information - - - - QLabel @@ -210,6 +140,14 @@ TextLabel24 + frameShape + MShape + + + frameShadow + MShadow + + text Broadcast @@ -290,6 +228,87 @@ 0.0.0.0 + + + name + Spacer18 + + + orientation + Vertical + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + QLayoutWidget + + name + Layout2 + + + + margin + 0 + + + spacing + 6 + + + + name + Spacer10 + + + orientation + Horizontal + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + QPushButton + + name + advancedButton + + + text + View Advanced Information + + + + + + Line + + name + Line5 + + + orientation + Horizontal + + @@ -314,4 +333,6 @@ 789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758 + + diff --git a/noncore/settings/networksettings/interfacesetup.ui b/noncore/settings/networksettings/interfacesetup.ui index 698422c..ff9810e 100644 --- a/noncore/settings/networksettings/interfacesetup.ui +++ b/noncore/settings/networksettings/interfacesetup.ui @@ -11,8 +11,8 @@ 0 0 - 193 - 310 + 177 + 320 @@ -39,17 +39,6 @@ Horizontal - - QLabel - - name - TextLabel4 - - - text - IP Address - - QCheckBox @@ -74,28 +63,6 @@ profileCombo - - QGroupBox - - name - staticGroupBox - - - enabled - false - - - title - Static Ip Configuration - - - - QLineEdit - - name - ipAddressEdit - - QLabel @@ -122,17 +89,6 @@ true - - QLabel - - name - TextLabel5 - - - text - Subnet Mask - - QLabel @@ -167,7 +123,7 @@ 24 - + name Spacer9 @@ -188,66 +144,120 @@ - - QLineEdit - - name - secondDNSLineEdit - - - - QLabel - - name - TextLabel3 - - - text - Second DNS - - - - QLabel - - name - TextLabel2 - - - text - First DNS - - - - QLineEdit - - name - firstDNSLineEdit - - - - QLabel + + QGroupBox name - TextLabel1_2 - - - text - Gateway + staticGroupBox - - - QLineEdit - name - subnetMaskEdit + enabled + false - - - QLineEdit - name - gatewayEdit + title + Static Ip Configuration + + + margin + 11 + + + spacing + 6 + + + QLineEdit + + name + firstDNSLineEdit + + + + QLabel + + name + TextLabel5 + + + text + Subnet Mask + + + + QLineEdit + + name + gatewayEdit + + + + QLineEdit + + name + subnetMaskEdit + + + + QLineEdit + + name + ipAddressEdit + + + + QLabel + + name + TextLabel2 + + + text + First DNS + + + + QLineEdit + + name + secondDNSLineEdit + + + + QLabel + + name + TextLabel4 + + + text + IP Address + + + + QLabel + + name + TextLabel1_2 + + + text + Gateway + + + + QLabel + + name + TextLabel3 + + + text + Second DNS + + + diff --git a/noncore/settings/networksettings/mainwindow.ui b/noncore/settings/networksettings/mainwindow.ui index f7efe99..c1fa101 100644 --- a/noncore/settings/networksettings/mainwindow.ui +++ b/noncore/settings/networksettings/mainwindow.ui @@ -271,7 +271,7 @@ text - Set Current + &Set Current diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp index 2f821a9..0f48a4b 100644 --- a/noncore/settings/networksettings/mainwindowimp.cpp +++ b/noncore/settings/networksettings/mainwindowimp.cpp @@ -2,10 +2,10 @@ #include "addserviceimp.h" #include "interfaceinformationimp.h" #include "interfacesetupimp.h" -#include "interface.h" #include "kprocess.h" #include "module.h" + #include #include #include @@ -31,11 +31,6 @@ #define TEMP_ALL "/tmp/ifconfig-a" #define TEMP_UP "/tmp/ifconfig" -#define NO_SELECT_ERROR_AND_RETURN { \ - QMessageBox::information(this, "Error","Please select an interface.", "Ok"); \ - return; \ -} - MainWindowImp::MainWindowImp(QWidget *parent, const char *name) : MainWindow(parent, name, true) { connect(addServiceButton, SIGNAL(clicked()), this, SLOT(addClicked())); connect(removeServiceButton, SIGNAL(clicked()), this, SLOT(removeClicked())); @@ -81,6 +76,24 @@ MainWindowImp::~MainWindowImp(){ } void MainWindowImp::loadModules(QString path){ + qDebug(path.latin1()); + QDir d; + d.setPath(path); + if(!d.exists()){ + qDebug("MainWindowImp:: Path doesn't exists"); + return; + } + d.setFilter( QDir::Files | QDir::NoSymLinks ); + const QFileInfoList *list = d.entryInfoList(); + QFileInfoListIterator it( *list ); + QFileInfo *fi; + while ( (fi=it.current()) ) { + if(fi->fileName().contains(".so")){ + qDebug("Found"); + Module *foo = loadPlugin(path + "/" + fi->fileName()); + } + ++it; + } } /** @@ -90,7 +103,7 @@ void MainWindowImp::loadModules(QString path){ * @return pointer to the function with name resolveString or NULL */ Module* MainWindowImp::loadPlugin(QString pluginFileName, QString resolveString){ - //qDebug(pluginFileName.latin1()); + qDebug(pluginFileName.latin1()); QLibrary *lib = new QLibrary(pluginFileName); void *functionPointer = lib->resolve(resolveString); if( !functionPointer ){ @@ -112,34 +125,6 @@ Module* MainWindowImp::loadPlugin(QString pluginFileName, QString resolveString) return object; } -/* -QList MainWindowImp::retrieveUnloadedPluginList(){ - QString DirStr = QDir::homeDirPath() + "/.networksetup/" ; - QString path = DirStr + "plugins"; - QDir d(path); - d.setFilter( QDir::Files | QDir::Hidden ); - - QMap::Iterator libraryIt; - QList rlist; - rlist.setAutoDelete(false); - - const QFileInfoList *list = d.entryInfoList(); - QFileInfoListIterator it( *list ); - QFileInfo *fi; - while ( (fi=it.current()) ) { - if(fi->fileName().contains(".so")){ - for( libraryIt = libraries.begin(); libraryIt != libraries.end(); ++libraryIt ) - if((path + "/" + fi->fileName()) != (libraryIt.data())->library()){ - QString *s = new QString(path + "/" + fi->fileName()); - rlist.append(s); - } - } - ++it; - } - return rlist; -} -*/ - /** * The Add button was clicked. Bring up the add dialog and if OK is hit * load the plugin and append it to the list @@ -161,7 +146,10 @@ void MainWindowImp::addClicked(){ */ void MainWindowImp::removeClicked(){ QListViewItem *item = serviceList->currentItem(); - if(item == NULL) NO_SELECT_ERROR_AND_RETURN + if(item == NULL) { + QMessageBox::information(this, "Error","Please select an interface.", "Ok"); + return; + } if(modules.find(interfaceItems[item]) == modules.end()){ QMessageBox::information(this, "Can't remove interface.", "Interface is built in.", "Ok"); @@ -178,7 +166,10 @@ void MainWindowImp::removeClicked(){ */ void MainWindowImp::configureClicked(){ QListViewItem *item = serviceList->currentItem(); - if(item == NULL) NO_SELECT_ERROR_AND_RETURN + if(item == NULL){ + QMessageBox::information(this, "Error","Please select an interface.", "Ok"); + return; + } if(modules.find(interfaceItems[item]) == modules.end()){ InterfaceSetupImp *conf = new InterfaceSetupImp(0, "InterfaceConfiguration", interfaceItems[item]); @@ -197,8 +188,11 @@ void MainWindowImp::configureClicked(){ */ void MainWindowImp::informationClicked(){ QListViewItem *item = serviceList->currentItem(); - if(item == NULL)NO_SELECT_ERROR_AND_RETURN - + if(item == NULL){ + QMessageBox::information(this, "Error","Please select an interface.", "Ok"); + return; + } + if(modules.find(interfaceItems[item]) == modules.end()){ InterfaceInformationImp *i = new InterfaceInformationImp(0, "InterfaceInformationImp", interfaceItems[item]); i->showMaximized(); @@ -311,6 +305,10 @@ void MainWindowImp::updateInterface(Interface *i){ QString typeName = "lan"; if(i->getHardwareName().contains("Local Loopback")) typeName = "lo"; + if(i->getInterfaceName().contains("irda")) + typeName = "irda"; + if(i->getInterfaceName().contains("wlan")) + typeName = "wlan"; QPixmap type = (Resource::loadPixmap(typeName)); item->setPixmap(1, type); diff --git a/noncore/settings/networksettings/module.h b/noncore/settings/networksettings/module.h index f146d8c..13fd523 100644 --- a/noncore/settings/networksettings/module.h +++ b/noncore/settings/networksettings/module.h @@ -1,5 +1,5 @@ -#ifndef MODULE_H -#define MODULE_H +#ifndef NETCONF_MODULE_H +#define NETCONF_MODULE_H #include #include diff --git a/noncore/settings/networksettings/networksetup.pro b/noncore/settings/networksettings/networksetup.pro index 7d9918b..a01b050 100644 --- a/noncore/settings/networksettings/networksetup.pro +++ b/noncore/settings/networksettings/networksetup.pro @@ -3,8 +3,8 @@ CONFIG = qt warn_on debug #CONFIG = qt warn_on release HEADERS = mainwindowimp.h addserviceimp.h interface.h interfaceinformationimp.h interfacesetupimp.h interfaces.h defaultmodule.h kprocctrl.h module.h kprocess.h SOURCES = main.cpp mainwindowimp.cpp addserviceimp.cpp interface.cpp interfaceinformationimp.cpp interfacesetupimp.cpp kprocctrl.cpp kprocess.cpp interfaces.cpp -INCLUDEPATH += $(QPEDIR)/include -DEPENDPATH += $(QPEDIR)/include +#INCLUDEPATH += $(QPEDIR)/include +#DEPENDPATH += $(QPEDIR)/include LIBS += -lqpe INTERFACES = mainwindow.ui addservice.ui interfaceinformation.ui interfaceadvanced.ui interfacesetup.ui TARGET = networksetup -- cgit v0.9.0.2