author | benmeyer <benmeyer> | 2002-10-25 19:34:32 (UTC) |
---|---|---|
committer | benmeyer <benmeyer> | 2002-10-25 19:34:32 (UTC) |
commit | f16dd7fc272f3f8354dc696fcc881dfe74755a21 (patch) (unidiff) | |
tree | edaab125b322744d8684e6aee4d2c5955b68689b /noncore/net/networksetup/wlan | |
parent | 77347ba522a5913ff17561e6fd2c15981d42e86b (diff) | |
download | opie-f16dd7fc272f3f8354dc696fcc881dfe74755a21.zip opie-f16dd7fc272f3f8354dc696fcc881dfe74755a21.tar.gz opie-f16dd7fc272f3f8354dc696fcc881dfe74755a21.tar.bz2 |
Moved Interfaces into a library
-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 | |||
@@ -18,5 +18,7 @@ | |||
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 | ||
@@ -37,4 +39,2 @@ WExtensions::WExtensions(QString interfaceName){ | |||
37 | hasWirelessExtensions = true; | 39 | hasWirelessExtensions = true; |
38 | else | ||
39 | hasWirelessExtensions = false; | ||
40 | } | 40 | } |
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 | |||
@@ -6,5 +6,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 |
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 | |||
@@ -17,6 +17,14 @@ | |||
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 | } |
@@ -111,5 +119,7 @@ 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 | ||
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 | |||
@@ -5,3 +5,5 @@ | |||
5 | 5 | ||
6 | #include <qpe/config.h> | 6 | class InterfaceSetupImp; |
7 | class Interface; | ||
8 | class Config; | ||
7 | 9 | ||
@@ -11,3 +13,3 @@ class WLANImp : public WLAN { | |||
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( ); |
@@ -23,2 +25,4 @@ private: | |||
23 | Config* config; | 25 | Config* config; |
26 | InterfaceSetupImp *interfaceSetup; | ||
27 | |||
24 | }; | 28 | }; |
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 | |||
@@ -4,2 +4,3 @@ | |||
4 | #include "wextensions.h" | 4 | #include "wextensions.h" |
5 | #include "interfaceinformationimp.h" | ||
5 | 6 | ||
@@ -7,2 +8,3 @@ | |||
7 | #include <qprogressbar.h> | 8 | #include <qprogressbar.h> |
9 | #include <qtabwidget.h> | ||
8 | 10 | ||
@@ -55,9 +57,7 @@ bool WLANModule::isOwner(Interface *i){ | |||
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; |
@@ -66,7 +66,6 @@ QWidget *WLANModule::configure(Interface *, QTabWidget **tabWidget){ | |||
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()); |
@@ -76,3 +75,4 @@ QWidget *WLANModule::information(Interface *i, QTabWidget **tabWidget){ | |||
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; |
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 | |||
@@ -16,4 +16,4 @@ public: | |||
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(); |