Diffstat (limited to 'noncore/settings/networksettings/wlan') (more/less context) (ignore whitespace changes)
6 files changed, 36 insertions, 22 deletions
diff --git a/noncore/settings/networksettings/wlan/wextensions.cpp b/noncore/settings/networksettings/wlan/wextensions.cpp index e545bd1..eb6fc42 100644 --- a/noncore/settings/networksettings/wlan/wextensions.cpp +++ b/noncore/settings/networksettings/wlan/wextensions.cpp @@ -17,7 +17,9 @@ * Constructor. Sets hasWirelessExtensions */ -WExtensions::WExtensions(QString interfaceName){ +WExtensions::WExtensions(QString interfaceName): hasWirelessExtensions(false){ interface = interfaceName; fd = socket( AF_INET, SOCK_DGRAM, 0 ); + if(fd == -1) + return; const char* buffer[200]; @@ -36,6 +38,4 @@ WExtensions::WExtensions(QString interfaceName){ if ( 0 == ioctl( fd, SIOCGIWESSID, &iwr ) ) hasWirelessExtensions = true; - else - hasWirelessExtensions = false; } diff --git a/noncore/settings/networksettings/wlan/wlan.pro b/noncore/settings/networksettings/wlan/wlan.pro index f28feb2..23fc39a 100644 --- a/noncore/settings/networksettings/wlan/wlan.pro +++ b/noncore/settings/networksettings/wlan/wlan.pro @@ -5,7 +5,7 @@ DESTDIR = $(OPIEDIR)/plugins/networksetup HEADERS = wlanimp.h infoimp.h wlanmodule.h wextensions.h SOURCES = wlanimp.cpp infoimp.cpp wlanmodule.cpp wextensions.cpp -INCLUDEPATH += $(OPIEDIR)/include ../ +INCLUDEPATH += $(OPIEDIR)/include ../ ../interfaces/ DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe +LIBS += -lqpe -L../interfaces/ -linterfaces INTERFACES = wlan.ui info.ui TARGET = wlanplugin diff --git a/noncore/settings/networksettings/wlan/wlanimp.cpp b/noncore/settings/networksettings/wlan/wlanimp.cpp index 45952b9..7c902e0 100644 --- a/noncore/settings/networksettings/wlan/wlanimp.cpp +++ b/noncore/settings/networksettings/wlan/wlanimp.cpp @@ -16,8 +16,16 @@ #include <qcheckbox.h> #include <qregexp.h> +#include <qpe/config.h> +#include <qtabwidget.h> +#include "interfacesetupimp.h" -WLANImp::WLANImp( QWidget* parent, const char* name, bool modal, WFlags fl):WLAN(parent, name, modal, fl){ +WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl):WLAN(parent, name, modal, fl){ config = new Config("wireless"); + interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i);//, Qt::WDestructiveClose); + //configure->setProfile(currentProfile); + tabWidget->insertTab(interfaceSetup, "TCP/IP"); + readConfig(); + } @@ -110,6 +118,8 @@ bool WLANImp::writeConfig() void WLANImp::accept() { - if ( writeConfig() ) + if ( writeConfig() ){ + interfaceSetup->saveChanges(); QDialog::accept(); + } } diff --git a/noncore/settings/networksettings/wlan/wlanimp.h b/noncore/settings/networksettings/wlan/wlanimp.h index 59b7c59..608d681 100644 --- a/noncore/settings/networksettings/wlan/wlanimp.h +++ b/noncore/settings/networksettings/wlan/wlanimp.h @@ -4,5 +4,7 @@ #include "wlan.h" -#include <qpe/config.h> +class InterfaceSetupImp; +class Interface; +class Config; class WLANImp : public WLAN { @@ -10,5 +12,5 @@ class WLANImp : public WLAN { public: - WLANImp( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + WLANImp( QWidget* parent = 0, const char* name = 0, Interface *i=0, bool modal = FALSE, WFlags fl = 0 ); ~WLANImp( ); @@ -22,4 +24,6 @@ private: bool writeWlanngOpts( QString scheme = "*" ); Config* config; + InterfaceSetupImp *interfaceSetup; + }; diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp index 9ab3b76..c8becb0 100644 --- a/noncore/settings/networksettings/wlan/wlanmodule.cpp +++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp @@ -3,7 +3,9 @@ #include "infoimp.h" #include "wextensions.h" +#include "interfaceinformationimp.h" #include <qlabel.h> #include <qprogressbar.h> +#include <qtabwidget.h> /** @@ -54,20 +56,17 @@ bool WLANModule::isOwner(Interface *i){ /** - * Create, set tabWiget and return the WLANConfigure Module - * @param tabWidget a pointer to the tab widget that this configure has. - * @return QWidget* pointer to the tab widget in this modules configure. + * Create, and return the WLANConfigure Module + * @return QWidget* pointer to this modules configure. */ -QWidget *WLANModule::configure(Interface *, QTabWidget **tabWidget){ - WLANImp *wlanconfig = new WLANImp(0, "WlanConfig", false, Qt::WDestructiveClose); - (*tabWidget) = wlanconfig->tabWidget; +QWidget *WLANModule::configure(Interface *i){ + WLANImp *wlanconfig = new WLANImp(0, "WlanConfig", i, false, Qt::WDestructiveClose); return wlanconfig; } /** - * Create, set tabWiget and return the Information Module - * @param tabWidget a pointer to the tab widget that this information has. - * @return QWidget* pointer to the tab widget in this modules info. + * Create, and return the Information Module + * @return QWidget* pointer to this modules info. */ -QWidget *WLANModule::information(Interface *i, QTabWidget **tabWidget){ +QWidget *WLANModule::information(Interface *i){ WExtensions we(i->getInterfaceName()); if(!we.doesHaveWirelessExtensions()) @@ -75,5 +74,6 @@ QWidget *WLANModule::information(Interface *i, QTabWidget **tabWidget){ WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose); - (*tabWidget) = info->tabWidget; + InterfaceInformationImp *information = new InterfaceInformationImp(info->tabWidget, "InterfaceSetupImp", i); + info->tabWidget->insertTab(information, "TCP/IP"); return info; } diff --git a/noncore/settings/networksettings/wlan/wlanmodule.h b/noncore/settings/networksettings/wlan/wlanmodule.h index 1418ce8..a81ccff 100644 --- a/noncore/settings/networksettings/wlan/wlanmodule.h +++ b/noncore/settings/networksettings/wlan/wlanmodule.h @@ -15,6 +15,6 @@ public: virtual void setProfile(QString newProfile); virtual bool isOwner(Interface *); - virtual QWidget *configure(Interface *i, QTabWidget **tabWidget); - virtual QWidget *information(Interface *i, QTabWidget **tabWidget); + virtual QWidget *configure(Interface *i); + virtual QWidget *information(Interface *i); virtual QList<Interface> getInterfaces(); virtual void possibleNewInterfaces(QMap<QString, QString> &){}; |