-rw-r--r-- | noncore/net/networksetup/wlan/wextensions.cpp | 6 | ||||
-rw-r--r-- | noncore/net/networksetup/wlan/wlan.pro | 4 | ||||
-rw-r--r-- | noncore/net/networksetup/wlan/wlanimp.cpp | 14 | ||||
-rw-r--r-- | noncore/net/networksetup/wlan/wlanimp.h | 8 | ||||
-rw-r--r-- | noncore/net/networksetup/wlan/wlanmodule.cpp | 22 | ||||
-rw-r--r-- | noncore/net/networksetup/wlan/wlanmodule.h | 4 |
6 files changed, 36 insertions, 22 deletions
diff --git a/noncore/net/networksetup/wlan/wextensions.cpp b/noncore/net/networksetup/wlan/wextensions.cpp index e545bd1..eb6fc42 100644 --- a/noncore/net/networksetup/wlan/wextensions.cpp +++ b/noncore/net/networksetup/wlan/wextensions.cpp | |||
@@ -17,7 +17,9 @@ | |||
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]; |
@@ -36,6 +38,4 @@ WExtensions::WExtensions(QString interfaceName){ | |||
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 | ||
diff --git a/noncore/net/networksetup/wlan/wlan.pro b/noncore/net/networksetup/wlan/wlan.pro index f28feb2..23fc39a 100644 --- a/noncore/net/networksetup/wlan/wlan.pro +++ b/noncore/net/networksetup/wlan/wlan.pro | |||
@@ -5,7 +5,7 @@ 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 |
diff --git a/noncore/net/networksetup/wlan/wlanimp.cpp b/noncore/net/networksetup/wlan/wlanimp.cpp index 45952b9..7c902e0 100644 --- a/noncore/net/networksetup/wlan/wlanimp.cpp +++ b/noncore/net/networksetup/wlan/wlanimp.cpp | |||
@@ -16,8 +16,16 @@ | |||
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 | ||
@@ -110,7 +118,9 @@ bool WLANImp::writeConfig() | |||
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(); |
114 | } | 123 | } |
124 | } | ||
115 | 125 | ||
116 | bool WLANImp::writeWirelessOpts( QString scheme ) | 126 | bool WLANImp::writeWirelessOpts( QString scheme ) |
diff --git a/noncore/net/networksetup/wlan/wlanimp.h b/noncore/net/networksetup/wlan/wlanimp.h index 59b7c59..608d681 100644 --- a/noncore/net/networksetup/wlan/wlanimp.h +++ b/noncore/net/networksetup/wlan/wlanimp.h | |||
@@ -4,5 +4,7 @@ | |||
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 { |
@@ -10,5 +12,5 @@ class WLANImp : public WLAN { | |||
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 | ||
@@ -22,4 +24,6 @@ private: | |||
22 | bool writeWlanngOpts( QString scheme = "*" ); | 24 | bool writeWlanngOpts( QString scheme = "*" ); |
23 | Config* config; | 25 | Config* config; |
26 | InterfaceSetupImp *interfaceSetup; | ||
27 | |||
24 | }; | 28 | }; |
25 | 29 | ||
diff --git a/noncore/net/networksetup/wlan/wlanmodule.cpp b/noncore/net/networksetup/wlan/wlanmodule.cpp index 9ab3b76..c8becb0 100644 --- a/noncore/net/networksetup/wlan/wlanmodule.cpp +++ b/noncore/net/networksetup/wlan/wlanmodule.cpp | |||
@@ -3,7 +3,9 @@ | |||
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 | /** |
@@ -54,20 +56,17 @@ bool WLANModule::isOwner(Interface *i){ | |||
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()) |
@@ -75,5 +74,6 @@ QWidget *WLANModule::information(Interface *i, QTabWidget **tabWidget){ | |||
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 | } |
diff --git a/noncore/net/networksetup/wlan/wlanmodule.h b/noncore/net/networksetup/wlan/wlanmodule.h index 1418ce8..a81ccff 100644 --- a/noncore/net/networksetup/wlan/wlanmodule.h +++ b/noncore/net/networksetup/wlan/wlanmodule.h | |||
@@ -15,6 +15,6 @@ public: | |||
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> &){}; |