summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/wlan
Unidiff
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
@@ -13,15 +13,17 @@
13#define IW_LOWER 0 13#define IW_LOWER 0
14#define IW_UPPER 256 14#define IW_UPPER 256
15 15
16/** 16/**
17 * Constructor. Sets hasWirelessExtensions 17 * Constructor. Sets hasWirelessExtensions
18 */ 18 */
19WExtensions::WExtensions(QString interfaceName){ 19WExtensions::WExtensions(QString interfaceName): hasWirelessExtensions(false){
20 interface = interfaceName; 20 interface = interfaceName;
21 fd = socket( AF_INET, SOCK_DGRAM, 0 ); 21 fd = socket( AF_INET, SOCK_DGRAM, 0 );
22 if(fd == -1)
23 return;
22 24
23 const char* buffer[200]; 25 const char* buffer[200];
24 memset( &iwr, 0, sizeof( iwr ) ); 26 memset( &iwr, 0, sizeof( iwr ) );
25 iwr.u.essid.pointer = (caddr_t) buffer; 27 iwr.u.essid.pointer = (caddr_t) buffer;
26 iwr.u.essid.length = IW_ESSID_MAX_SIZE; 28 iwr.u.essid.length = IW_ESSID_MAX_SIZE;
27 iwr.u.essid.flags = 0; 29 iwr.u.essid.flags = 0;
@@ -32,14 +34,12 @@ WExtensions::WExtensions(QString interfaceName){
32 // (see IEEE 802.11 for more information) 34 // (see IEEE 802.11 for more information)
33 35
34 const char* iname = interface.latin1(); 36 const char* iname = interface.latin1();
35 strcpy( iwr.ifr_ifrn.ifrn_name, (const char *)iname ); 37 strcpy( iwr.ifr_ifrn.ifrn_name, (const char *)iname );
36 if ( 0 == ioctl( fd, SIOCGIWESSID, &iwr ) ) 38 if ( 0 == ioctl( fd, SIOCGIWESSID, &iwr ) )
37 hasWirelessExtensions = true; 39 hasWirelessExtensions = true;
38 else
39 hasWirelessExtensions = false;
40} 40}
41 41
42/** 42/**
43 * @return QString the station name of the access point. 43 * @return QString the station name of the access point.
44 */ 44 */
45QString WExtensions::station(){ 45QString WExtensions::station(){
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
@@ -1,12 +1,12 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release
3 #CONFIG += qt warn_on debug 3 #CONFIG += qt warn_on debug
4DESTDIR = $(OPIEDIR)/plugins/networksetup 4DESTDIR = $(OPIEDIR)/plugins/networksetup
5 HEADERS = wlanimp.h infoimp.h wlanmodule.h wextensions.h 5 HEADERS = wlanimp.h infoimp.h wlanmodule.h wextensions.h
6 SOURCES = wlanimp.cpp infoimp.cpp wlanmodule.cpp wextensions.cpp 6 SOURCES = wlanimp.cpp infoimp.cpp wlanmodule.cpp wextensions.cpp
7 INCLUDEPATH+= $(OPIEDIR)/include ../ 7 INCLUDEPATH+= $(OPIEDIR)/include ../ ../interfaces/
8 DEPENDPATH+= $(OPIEDIR)/include 8 DEPENDPATH+= $(OPIEDIR)/include
9LIBS += -lqpe 9LIBS += -lqpe -L../interfaces/ -linterfaces
10 INTERFACES= wlan.ui info.ui 10 INTERFACES= wlan.ui info.ui
11 TARGET = wlanplugin 11 TARGET = wlanplugin
12 VERSION = 1.0.0 12 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
@@ -12,16 +12,24 @@
12#include <qmessagebox.h> 12#include <qmessagebox.h>
13#include <qlineedit.h> 13#include <qlineedit.h>
14#include <qspinbox.h> 14#include <qspinbox.h>
15#include <qradiobutton.h> 15#include <qradiobutton.h>
16#include <qcheckbox.h> 16#include <qcheckbox.h>
17#include <qregexp.h> 17#include <qregexp.h>
18#include <qpe/config.h>
19#include <qtabwidget.h>
20#include "interfacesetupimp.h"
18 21
19WLANImp::WLANImp( QWidget* parent, const char* name, bool modal, WFlags fl):WLAN(parent, name, modal, fl){ 22WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl):WLAN(parent, name, modal, fl){
20 config = new Config("wireless"); 23 config = new Config("wireless");
24 interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i);//, Qt::WDestructiveClose);
25 //configure->setProfile(currentProfile);
26 tabWidget->insertTab(interfaceSetup, "TCP/IP");
27
21 readConfig(); 28 readConfig();
29
22} 30}
23 31
24WLANImp::~WLANImp( ){ 32WLANImp::~WLANImp( ){
25 delete config; 33 delete config;
26} 34}
27 35
@@ -106,14 +114,16 @@ bool WLANImp::writeConfig()
106} 114}
107 115
108/** 116/**
109 */ 117 */
110void WLANImp::accept() 118void WLANImp::accept()
111{ 119{
112 if ( writeConfig() ) 120 if ( writeConfig() ){
121 interfaceSetup->saveChanges();
113 QDialog::accept(); 122 QDialog::accept();
123 }
114} 124}
115 125
116bool WLANImp::writeWirelessOpts( QString scheme ) 126bool WLANImp::writeWirelessOpts( QString scheme )
117{ 127{
118 qWarning( "WLANImp::writeWirelessOpts entered." ); 128 qWarning( "WLANImp::writeWirelessOpts entered." );
119 QString prev = "/etc/pcmcia/wireless.opts"; 129 QString prev = "/etc/pcmcia/wireless.opts";
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
@@ -1,27 +1,31 @@
1#ifndef WLANIMP_H 1#ifndef WLANIMP_H
2#define WLANIMP_H 2#define WLANIMP_H
3 3
4#include "wlan.h" 4#include "wlan.h"
5 5
6#include <qpe/config.h> 6class InterfaceSetupImp;
7class Interface;
8class Config;
7 9
8class WLANImp : public WLAN { 10class WLANImp : public WLAN {
9 Q_OBJECT 11 Q_OBJECT
10 12
11public: 13public:
12 WLANImp( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); 14 WLANImp( QWidget* parent = 0, const char* name = 0, Interface *i=0, bool modal = FALSE, WFlags fl = 0 );
13 ~WLANImp( ); 15 ~WLANImp( );
14 16
15protected: 17protected:
16 void accept(); 18 void accept();
17 19
18private: 20private:
19 void readConfig(); 21 void readConfig();
20 bool writeConfig(); 22 bool writeConfig();
21 bool writeWirelessOpts( QString scheme = "*" ); 23 bool writeWirelessOpts( QString scheme = "*" );
22 bool writeWlanngOpts( QString scheme = "*" ); 24 bool writeWlanngOpts( QString scheme = "*" );
23 Config* config; 25 Config* config;
26 InterfaceSetupImp *interfaceSetup;
27
24}; 28};
25 29
26#endif 30#endif
27 31
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
@@ -1,13 +1,15 @@
1#include "wlanmodule.h" 1#include "wlanmodule.h"
2#include "wlanimp.h" 2#include "wlanimp.h"
3#include "infoimp.h" 3#include "infoimp.h"
4#include "wextensions.h" 4#include "wextensions.h"
5#include "interfaceinformationimp.h"
5 6
6#include <qlabel.h> 7#include <qlabel.h>
7#include <qprogressbar.h> 8#include <qprogressbar.h>
9#include <qtabwidget.h>
8 10
9/** 11/**
10 * Constructor, find all of the possible interfaces 12 * Constructor, find all of the possible interfaces
11 */ 13 */
12WLANModule::WLANModule() : Module() { 14WLANModule::WLANModule() : Module() {
13} 15}
@@ -50,34 +52,32 @@ bool WLANModule::isOwner(Interface *i){
50 i->setHardwareName("802.11b"); 52 i->setHardwareName("802.11b");
51 list.append(i); 53 list.append(i);
52 return true; 54 return true;
53} 55}
54 56
55/** 57/**
56 * Create, set tabWiget and return the WLANConfigure Module 58 * Create, and return the WLANConfigure Module
57 * @param tabWidget a pointer to the tab widget that this configure has. 59 * @return QWidget* pointer to this modules configure.
58 * @return QWidget* pointer to the tab widget in this modules configure.
59 */ 60 */
60QWidget *WLANModule::configure(Interface *, QTabWidget **tabWidget){ 61QWidget *WLANModule::configure(Interface *i){
61 WLANImp *wlanconfig = new WLANImp(0, "WlanConfig", false, Qt::WDestructiveClose); 62 WLANImp *wlanconfig = new WLANImp(0, "WlanConfig", i, false, Qt::WDestructiveClose);
62 (*tabWidget) = wlanconfig->tabWidget;
63 return wlanconfig; 63 return wlanconfig;
64} 64}
65 65
66/** 66/**
67 * Create, set tabWiget and return the Information Module 67 * Create, and return the Information Module
68 * @param tabWidget a pointer to the tab widget that this information has. 68 * @return QWidget* pointer to this modules info.
69 * @return QWidget* pointer to the tab widget in this modules info.
70 */ 69 */
71QWidget *WLANModule::information(Interface *i, QTabWidget **tabWidget){ 70QWidget *WLANModule::information(Interface *i){
72 WExtensions we(i->getInterfaceName()); 71 WExtensions we(i->getInterfaceName());
73 if(!we.doesHaveWirelessExtensions()) 72 if(!we.doesHaveWirelessExtensions())
74 return NULL; 73 return NULL;
75 74
76 WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose); 75 WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose);
77 (*tabWidget) = info->tabWidget; 76 InterfaceInformationImp *information = new InterfaceInformationImp(info->tabWidget, "InterfaceSetupImp", i);
77 info->tabWidget->insertTab(information, "TCP/IP");
78 return info; 78 return info;
79} 79}
80 80
81/** 81/**
82 * Get all active (up or down) interfaces 82 * Get all active (up or down) interfaces
83 * @return QList<Interface> A list of interfaces that exsist that havn't 83 * @return QList<Interface> A list of interfaces that exsist that havn't
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
@@ -11,14 +11,14 @@ signals:
11public: 11public:
12 WLANModule(); 12 WLANModule();
13 ~WLANModule(); 13 ~WLANModule();
14 14
15 virtual void setProfile(QString newProfile); 15 virtual void setProfile(QString newProfile);
16 virtual bool isOwner(Interface *); 16 virtual bool isOwner(Interface *);
17 virtual QWidget *configure(Interface *i, QTabWidget **tabWidget); 17 virtual QWidget *configure(Interface *i);
18 virtual QWidget *information(Interface *i, QTabWidget **tabWidget); 18 virtual QWidget *information(Interface *i);
19 virtual QList<Interface> getInterfaces(); 19 virtual QList<Interface> getInterfaces();
20 virtual void possibleNewInterfaces(QMap<QString, QString> &){}; 20 virtual void possibleNewInterfaces(QMap<QString, QString> &){};
21 virtual Interface *addNewInterface(QString name); 21 virtual Interface *addNewInterface(QString name);
22 virtual bool remove(Interface* i); 22 virtual bool remove(Interface* i);
23 virtual QString getPixmapName(Interface* i); 23 virtual QString getPixmapName(Interface* i);
24 24