summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/wlan
authorbenmeyer <benmeyer>2002-10-25 19:34:32 (UTC)
committer benmeyer <benmeyer>2002-10-25 19:34:32 (UTC)
commitf16dd7fc272f3f8354dc696fcc881dfe74755a21 (patch) (side-by-side diff)
treeedaab125b322744d8684e6aee4d2c5955b68689b /noncore/settings/networksettings/wlan
parent77347ba522a5913ff17561e6fd2c15981d42e86b (diff)
downloadopie-f16dd7fc272f3f8354dc696fcc881dfe74755a21.zip
opie-f16dd7fc272f3f8354dc696fcc881dfe74755a21.tar.gz
opie-f16dd7fc272f3f8354dc696fcc881dfe74755a21.tar.bz2
Moved Interfaces into a library
Diffstat (limited to 'noncore/settings/networksettings/wlan') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/wlan/wextensions.cpp6
-rw-r--r--noncore/settings/networksettings/wlan/wlan.pro4
-rw-r--r--noncore/settings/networksettings/wlan/wlanimp.cpp14
-rw-r--r--noncore/settings/networksettings/wlan/wlanimp.h8
-rw-r--r--noncore/settings/networksettings/wlan/wlanmodule.cpp22
-rw-r--r--noncore/settings/networksettings/wlan/wlanmodule.h4
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
@@ -16,9 +16,11 @@
/**
* 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];
memset( &iwr, 0, sizeof( iwr ) );
@@ -35,8 +37,6 @@ WExtensions::WExtensions(QString interfaceName){
strcpy( iwr.ifr_ifrn.ifrn_name, (const char *)iname );
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
@@ -4,9 +4,9 @@ CONFIG += qt warn_on release
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
VERSION = 1.0.0
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
@@ -15,10 +15,18 @@
#include <qradiobutton.h>
#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();
+
}
WLANImp::~WLANImp( ){
@@ -109,8 +117,10 @@ bool WLANImp::writeConfig()
*/
void WLANImp::accept()
{
- if ( writeConfig() )
+ if ( writeConfig() ){
+ interfaceSetup->saveChanges();
QDialog::accept();
+ }
}
bool WLANImp::writeWirelessOpts( QString scheme )
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
@@ -3,13 +3,15 @@
#include "wlan.h"
-#include <qpe/config.h>
+class InterfaceSetupImp;
+class Interface;
+class Config;
class WLANImp : public WLAN {
Q_OBJECT
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( );
protected:
@@ -21,6 +23,8 @@ private:
bool writeWirelessOpts( QString scheme = "*" );
bool writeWlanngOpts( QString scheme = "*" );
Config* config;
+ InterfaceSetupImp *interfaceSetup;
+
};
#endif
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
@@ -2,9 +2,11 @@
#include "wlanimp.h"
#include "infoimp.h"
#include "wextensions.h"
+#include "interfaceinformationimp.h"
#include <qlabel.h>
#include <qprogressbar.h>
+#include <qtabwidget.h>
/**
* Constructor, find all of the possible interfaces
@@ -53,28 +55,26 @@ 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())
return NULL;
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
@@ -14,8 +14,8 @@ 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> &){};
virtual Interface *addNewInterface(QString name);