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 | |||
@@ -16,9 +16,11 @@ | |||
16 | /** | 16 | /** |
17 | * Constructor. Sets hasWirelessExtensions | 17 | * Constructor. Sets hasWirelessExtensions |
18 | */ | 18 | */ |
19 | WExtensions::WExtensions(QString interfaceName){ | 19 | WExtensions::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 ) ); |
@@ -35,8 +37,6 @@ WExtensions::WExtensions(QString interfaceName){ | |||
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 | /** |
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 | |||
4 | DESTDIR = $(OPIEDIR)/plugins/networksetup | 4 | DESTDIR = $(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 |
9 | LIBS += -lqpe | 9 | LIBS += -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 | |||
@@ -15,10 +15,18 @@ | |||
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 | ||
19 | WLANImp::WLANImp( QWidget* parent, const char* name, bool modal, WFlags fl):WLAN(parent, name, modal, fl){ | 22 | WLANImp::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 | ||
24 | WLANImp::~WLANImp( ){ | 32 | WLANImp::~WLANImp( ){ |
@@ -109,8 +117,10 @@ bool WLANImp::writeConfig() | |||
109 | */ | 117 | */ |
110 | void WLANImp::accept() | 118 | void WLANImp::accept() |
111 | { | 119 | { |
112 | if ( writeConfig() ) | 120 | if ( writeConfig() ){ |
121 | interfaceSetup->saveChanges(); | ||
113 | QDialog::accept(); | 122 | QDialog::accept(); |
123 | } | ||
114 | } | 124 | } |
115 | 125 | ||
116 | bool WLANImp::writeWirelessOpts( QString scheme ) | 126 | 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 @@ | |||
3 | 3 | ||
4 | #include "wlan.h" | 4 | #include "wlan.h" |
5 | 5 | ||
6 | #include <qpe/config.h> | 6 | class InterfaceSetupImp; |
7 | class Interface; | ||
8 | class Config; | ||
7 | 9 | ||
8 | class WLANImp : public WLAN { | 10 | class WLANImp : public WLAN { |
9 | Q_OBJECT | 11 | Q_OBJECT |
10 | 12 | ||
11 | public: | 13 | public: |
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 | ||
15 | protected: | 17 | protected: |
@@ -21,6 +23,8 @@ private: | |||
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 |
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 @@ | |||
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 |
@@ -53,28 +55,26 @@ bool WLANModule::isOwner(Interface *i){ | |||
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 | */ |
60 | QWidget *WLANModule::configure(Interface *, QTabWidget **tabWidget){ | 61 | QWidget *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 | */ |
71 | QWidget *WLANModule::information(Interface *i, QTabWidget **tabWidget){ | 70 | QWidget *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 | ||
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: | |||
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); |