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/config.in4
-rw-r--r--noncore/settings/networksettings/wlan/infoimp.cpp5
-rw-r--r--noncore/settings/networksettings/wlan/wextensions.cpp9
-rw-r--r--noncore/settings/networksettings/wlan/wlan.pro3
-rw-r--r--noncore/settings/networksettings/wlan/wlanimp2.cpp26
-rw-r--r--noncore/settings/networksettings/wlan/wlanmodule.cpp2
6 files changed, 31 insertions, 18 deletions
diff --git a/noncore/settings/networksettings/wlan/config.in b/noncore/settings/networksettings/wlan/config.in
index d4661cb..233764e 100644
--- a/noncore/settings/networksettings/wlan/config.in
+++ b/noncore/settings/networksettings/wlan/config.in
@@ -1,6 +1,6 @@
1 config WLAN 1 config WLAN
2 boolean "opie-networksettingsplugin-wlan (wireless LAN module)" 2 boolean "opie-networksettingsplugin-wlan (wireless LAN module)"
3 default "n" if NETWORKSETUP 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2UI && NETWORKSETUP && NETWORKSETUP-CORE && INTERFACES && LIBOPIE2NET 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2UI && NETWORKSETUP && NETWORKSETUP-CORE && INTERFACES && LIBOPIE2NET
5 #comment "opie-networksettingsplugin-wlan needs libopie2ui, libopie2net and networksetup" 5 #comment "opie-networksettingsplugin-wlan needs libopie2ui, libopie2net and networksetup"
6 #depends !( LIBOPIE2NET && NETWORKSETUP) \ No newline at end of file 6 #depends !( LIBOPIE2NET && NETWORKSETUP)
diff --git a/noncore/settings/networksettings/wlan/infoimp.cpp b/noncore/settings/networksettings/wlan/infoimp.cpp
index c558f5e..273bed8 100644
--- a/noncore/settings/networksettings/wlan/infoimp.cpp
+++ b/noncore/settings/networksettings/wlan/infoimp.cpp
@@ -1,15 +1,20 @@
1#include "infoimp.h" 1#include "infoimp.h"
2#include "wextensions.h" 2#include "wextensions.h"
3 3
4/* OPIE */
5#include <opie2/odebug.h>
6using namespace Opie::Core;
7
8/* QT */
4#include <qtimer.h> 9#include <qtimer.h>
5#include <qprogressbar.h> 10#include <qprogressbar.h>
6#include <qlabel.h> 11#include <qlabel.h>
7 12
8/** 13/**
9 * Constructor. If wireless extensions are enabled on device name then 14 * Constructor. If wireless extensions are enabled on device name then
10 * start a timer that every second will update the information. 15 * start a timer that every second will update the information.
11 */ 16 */
12WlanInfoImp::WlanInfoImp( QWidget* parent, const char* name, WFlags fl): WlanInfo(parent, name, fl){ 17WlanInfoImp::WlanInfoImp( QWidget* parent, const char* name, WFlags fl): WlanInfo(parent, name, fl){
13 WExtensions *wExtensions = new WExtensions(name); 18 WExtensions *wExtensions = new WExtensions(name);
14 if(!wExtensions->doesHaveWirelessExtensions()){ 19 if(!wExtensions->doesHaveWirelessExtensions()){
15 delete wExtensions; 20 delete wExtensions;
diff --git a/noncore/settings/networksettings/wlan/wextensions.cpp b/noncore/settings/networksettings/wlan/wextensions.cpp
index 9c64323..fe21f02 100644
--- a/noncore/settings/networksettings/wlan/wextensions.cpp
+++ b/noncore/settings/networksettings/wlan/wextensions.cpp
@@ -1,27 +1,34 @@
1#include "wextensions.h" 1#include "wextensions.h"
2 2
3/* OPIE */
4#include <opie2/odebug.h>
5using namespace Opie::Core;
6
7/* QT */
3#include <qfile.h> 8#include <qfile.h>
4#include <qtextstream.h> 9#include <qtextstream.h>
5 10
11/* STD */
6#include <arpa/inet.h> 12#include <arpa/inet.h>
7#include <sys/socket.h> 13#include <sys/socket.h>
8#include <sys/ioctl.h> 14#include <sys/ioctl.h>
9
10#include <math.h> 15#include <math.h>
11 16
12#define PROCNETWIRELESS "/proc/net/wireless" 17#define PROCNETWIRELESS "/proc/net/wireless"
13#define IW_LOWER 0 18#define IW_LOWER 0
14#define IW_UPPER 256 19#define IW_UPPER 256
15 20
21#warning This is duplicated code. Use libopienet2!
22
16/** 23/**
17 * Constructor. Sets hasWirelessExtensions 24 * Constructor. Sets hasWirelessExtensions
18 */ 25 */
19WExtensions::WExtensions(QString interfaceName): hasWirelessExtensions(false), interface(interfaceName) { 26WExtensions::WExtensions(QString interfaceName): hasWirelessExtensions(false), interface(interfaceName) {
20 fd = socket( AF_INET, SOCK_DGRAM, 0 ); 27 fd = socket( AF_INET, SOCK_DGRAM, 0 );
21 if(fd == -1) 28 if(fd == -1)
22 return; 29 return;
23 30
24 const char* buffer[200]; 31 const char* buffer[200];
25 memset( &iwr, 0, sizeof( iwr ) ); 32 memset( &iwr, 0, sizeof( iwr ) );
26 iwr.u.essid.pointer = (caddr_t) buffer; 33 iwr.u.essid.pointer = (caddr_t) buffer;
27 iwr.u.essid.length = IW_ESSID_MAX_SIZE; 34 iwr.u.essid.length = IW_ESSID_MAX_SIZE;
diff --git a/noncore/settings/networksettings/wlan/wlan.pro b/noncore/settings/networksettings/wlan/wlan.pro
index 89867ae..c94dc0e 100644
--- a/noncore/settings/networksettings/wlan/wlan.pro
+++ b/noncore/settings/networksettings/wlan/wlan.pro
@@ -1,17 +1,14 @@
1#
2TEMPLATE = lib 1TEMPLATE = lib
3#TEMPLATE = app
4CONFIG += qt plugin warn_on 2CONFIG += qt plugin warn_on
5 #CONFIG += qt plugin warn_on
6DESTDIR = $(OPIEDIR)/plugins/networksettings 3DESTDIR = $(OPIEDIR)/plugins/networksettings
7 HEADERS = infoimp.h wlanmodule.h wextensions.h keyedit.h 4 HEADERS = infoimp.h wlanmodule.h wextensions.h keyedit.h
8 SOURCES = infoimp.cpp wlanmodule.cpp wextensions.cpp keyedit.cpp 5 SOURCES = infoimp.cpp wlanmodule.cpp wextensions.cpp keyedit.cpp
9 INCLUDEPATH+= $(OPIEDIR)/include ../ ../interfaces/ 6 INCLUDEPATH+= $(OPIEDIR)/include ../ ../interfaces/
10 DEPENDPATH+= $(OPIEDIR)/include 7 DEPENDPATH+= $(OPIEDIR)/include
11LIBS += -lqpe -L../interfaces/ -linterfaces -lopiecore2 -lopienet2 8LIBS += -lqpe -L../interfaces/ -linterfaces -lopiecore2 -lopienet2
12 INTERFACES= wlan.ui info.ui 9 INTERFACES= wlan.ui info.ui
13 TARGET = wlan 10 TARGET = wlan
14 VERSION = 1.0.0 11 VERSION = 1.0.0
15 12
16#CONFIG += wirelessopts 13#CONFIG += wirelessopts
17 14
diff --git a/noncore/settings/networksettings/wlan/wlanimp2.cpp b/noncore/settings/networksettings/wlan/wlanimp2.cpp
index e4aa2f9..4294b12 100644
--- a/noncore/settings/networksettings/wlan/wlanimp2.cpp
+++ b/noncore/settings/networksettings/wlan/wlanimp2.cpp
@@ -1,58 +1,60 @@
1#include "wlanimp2.h" 1#include "wlanimp2.h"
2#include "keyedit.h" 2#include "keyedit.h"
3#include "interfacesetupimp.h" 3#include "interfacesetupimp.h"
4
5#include "../interfaces/interface.h" 4#include "../interfaces/interface.h"
6 5
7#include <assert.h> 6#include <assert.h>
8#include <errno.h> 7#include <errno.h>
9#include <string.h> 8#include <string.h>
10 9
10/* OPIE */
11#include <opie2/odebug.h>
12#include <opie2/oprocess.h>
13#include <opie2/onetwork.h>
14#include <opie2/opcap.h>
15#include <qpe/resource.h>
16using namespace Opie::Core;
17using namespace Opie::Net;
18
19/* QT */
11#include <qapplication.h> 20#include <qapplication.h>
12#include <qfile.h> 21#include <qfile.h>
13#include <qdir.h> 22#include <qdir.h>
14#include <qdialog.h> 23#include <qdialog.h>
15#include <qtextstream.h> 24#include <qtextstream.h>
16#include <qmessagebox.h> 25#include <qmessagebox.h>
17#include <qlineedit.h> 26#include <qlineedit.h>
18#include <qlabel.h> 27#include <qlabel.h>
19#include <qspinbox.h> 28#include <qspinbox.h>
20#include <qradiobutton.h> 29#include <qradiobutton.h>
21#include <qpushbutton.h> 30#include <qpushbutton.h>
22#include <qcheckbox.h> 31#include <qcheckbox.h>
23#include <qtabwidget.h> 32#include <qtabwidget.h>
24#include <qcombobox.h> 33#include <qcombobox.h>
25#include <qlistview.h> 34#include <qlistview.h>
26#include <qvbox.h> 35#include <qvbox.h>
27#include <qprogressbar.h> 36#include <qprogressbar.h>
28 37
29#ifdef QWS 38/* STD */
30 #include <qpe/resource.h> 39#include <assert.h>
31 #include <opie2/oprocess.h> 40#include <errno.h>
32 #include <opie2/onetwork.h> 41#include <string.h>
33 #include <opie2/opcap.h>
34#else
35 #define OProcess KProcess
36 #include <kprocess.h>
37#endif
38 42
39#define WIRELESS_OPTS "/etc/pcmcia/wireless.opts" 43#define WIRELESS_OPTS "/etc/pcmcia/wireless.opts"
40#define PREUP "/etc/network/if-pre-up.d/wireless-tools" 44#define PREUP "/etc/network/if-pre-up.d/wireless-tools"
41 45
42/** 46/**
43 * Constructor, read in the wireless.opts file for parsing later. 47 * Constructor, read in the wireless.opts file for parsing later.
44 */ 48 */
45using namespace Opie::Net;
46using namespace Opie::Core;
47WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl) : WLAN(parent, name, modal, fl), interface(i), currentProfile("*") { 49WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl) : WLAN(parent, name, modal, fl), interface(i), currentProfile("*") {
48 interfaces = new Interfaces(); 50 interfaces = new Interfaces();
49 interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, interfaces); 51 interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, interfaces);
50 tabWidget->insertTab(interfaceSetup, "TCP/IP"); 52 tabWidget->insertTab(interfaceSetup, "TCP/IP");
51 53
52 // Check sanity - the existance of the wireless-tools if-pre-up script 54 // Check sanity - the existance of the wireless-tools if-pre-up script
53 QFile file(QString(PREUP)); 55 QFile file(QString(PREUP));
54 if (file.exists()) { 56 if (file.exists()) {
55 owarn << QString("WLANImp: Unable to open /etc/network/if-pre-up.d/wireless-tools") << oendl; 57 owarn << QString("WLANImp: Unable to open /etc/network/if-pre-up.d/wireless-tools") << oendl;
56 } 58 }
57 59
58 connect( rescanButton, SIGNAL( clicked() ), this, SLOT( rescanNeighbourhood() ) ); 60 connect( rescanButton, SIGNAL( clicked() ), this, SLOT( rescanNeighbourhood() ) );
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp
index 886af10..ba89fa4 100644
--- a/noncore/settings/networksettings/wlan/wlanmodule.cpp
+++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp
@@ -1,21 +1,23 @@
1 1
2#include "wlanmodule.h" 2#include "wlanmodule.h"
3#include "wlanimp2.h" 3#include "wlanimp2.h"
4#include "infoimp.h" 4#include "infoimp.h"
5#include "wextensions.h" 5#include "wextensions.h"
6#include "interfaceinformationimp.h" 6#include "interfaceinformationimp.h"
7 7
8/* OPIE */ 8/* OPIE */
9#include <opie2/odebug.h>
9#include <qpe/qpeapplication.h> 10#include <qpe/qpeapplication.h>
11using namespace Opie::Core;
10 12
11/* QT */ 13/* QT */
12#include <qcheckbox.h> 14#include <qcheckbox.h>
13#include <qcombobox.h> 15#include <qcombobox.h>
14#include <qlabel.h> 16#include <qlabel.h>
15#include <qlineedit.h> 17#include <qlineedit.h>
16#include <qprogressbar.h> 18#include <qprogressbar.h>
17#include <qspinbox.h> 19#include <qspinbox.h>
18#include <qtabwidget.h> 20#include <qtabwidget.h>
19 21
20 22
21/** 23/**