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
Diffstat (limited to 'noncore/net/networksetup/wlan') (more/less context) (ignore whitespace changes)
-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 | |||
@@ -1,63 +1,63 @@ | |||
1 | #include "wextensions.h" | 1 | #include "wextensions.h" |
2 | 2 | ||
3 | #include <qfile.h> | 3 | #include <qfile.h> |
4 | #include <qtextstream.h> | 4 | #include <qtextstream.h> |
5 | 5 | ||
6 | #include <arpa/inet.h> | 6 | #include <arpa/inet.h> |
7 | #include <sys/socket.h> | 7 | #include <sys/socket.h> |
8 | #include <sys/ioctl.h> | 8 | #include <sys/ioctl.h> |
9 | 9 | ||
10 | #include <math.h> | 10 | #include <math.h> |
11 | 11 | ||
12 | #define PROCNETWIRELESS "/proc/net/wireless" | 12 | #define PROCNETWIRELESS "/proc/net/wireless" |
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 | */ |
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 ) ); |
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; |
28 | 30 | ||
29 | // check if it is an IEEE 802.11 standard conform | 31 | // check if it is an IEEE 802.11 standard conform |
30 | // wireless device by sending SIOCGIWESSID | 32 | // wireless device by sending SIOCGIWESSID |
31 | // which also gives back the Extended Service Set ID | 33 | // which also gives back the Extended Service Set ID |
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 | */ |
45 | QString WExtensions::station(){ | 45 | QString WExtensions::station(){ |
46 | if(!hasWirelessExtensions) | 46 | if(!hasWirelessExtensions) |
47 | return QString(); | 47 | return QString(); |
48 | const char* buffer[200]; | 48 | const char* buffer[200]; |
49 | iwr.u.data.pointer = (caddr_t) buffer; | 49 | iwr.u.data.pointer = (caddr_t) buffer; |
50 | iwr.u.data.length = IW_ESSID_MAX_SIZE; | 50 | iwr.u.data.length = IW_ESSID_MAX_SIZE; |
51 | iwr.u.data.flags = 0; | 51 | iwr.u.data.flags = 0; |
52 | if ( 0 == ioctl( fd, SIOCGIWNICKN, &iwr )){ | 52 | if ( 0 == ioctl( fd, SIOCGIWNICKN, &iwr )){ |
53 | iwr.u.data.pointer[(unsigned int) iwr.u.data.length-1] = '\0'; | 53 | iwr.u.data.pointer[(unsigned int) iwr.u.data.length-1] = '\0'; |
54 | return QString(iwr.u.data.pointer); | 54 | return QString(iwr.u.data.pointer); |
55 | } | 55 | } |
56 | return QString(); | 56 | return QString(); |
57 | } | 57 | } |
58 | 58 | ||
59 | /** | 59 | /** |
60 | * @return QString the essid of the host 802.11 access point. | 60 | * @return QString the essid of the host 802.11 access point. |
61 | */ | 61 | */ |
62 | QString WExtensions::essid(){ | 62 | QString WExtensions::essid(){ |
63 | if(!hasWirelessExtensions) | 63 | if(!hasWirelessExtensions) |
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 | |||
@@ -1,12 +1,12 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt warn_on release | 2 | CONFIG += qt warn_on release |
3 | #CONFIG += qt warn_on debug | 3 | #CONFIG += qt warn_on debug |
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/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 | |||
@@ -1,45 +1,53 @@ | |||
1 | #include "wlanimp.h" | 1 | #include "wlanimp.h" |
2 | 2 | ||
3 | /* Config class */ | 3 | /* Config class */ |
4 | #include <qpe/config.h> | 4 | #include <qpe/config.h> |
5 | /* Global namespace */ | 5 | /* Global namespace */ |
6 | #include <qpe/global.h> | 6 | #include <qpe/global.h> |
7 | /* system() */ | 7 | /* system() */ |
8 | #include <stdlib.h> | 8 | #include <stdlib.h> |
9 | #include <qfile.h> | 9 | #include <qfile.h> |
10 | #include <qdir.h> | 10 | #include <qdir.h> |
11 | #include <qtextstream.h> | 11 | #include <qtextstream.h> |
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 | ||
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( ){ |
25 | delete config; | 33 | delete config; |
26 | } | 34 | } |
27 | 35 | ||
28 | void WLANImp::readConfig() | 36 | void WLANImp::readConfig() |
29 | { | 37 | { |
30 | qWarning( "WLANImp::readConfig() called." ); | 38 | qWarning( "WLANImp::readConfig() called." ); |
31 | config->setGroup( "Properties" ); | 39 | config->setGroup( "Properties" ); |
32 | QString ssid = config->readEntry( "SSID", "any" ); | 40 | QString ssid = config->readEntry( "SSID", "any" ); |
33 | if( ssid == "any" || ssid == "ANY" ){ | 41 | if( ssid == "any" || ssid == "ANY" ){ |
34 | essNon->setChecked( true ); | 42 | essNon->setChecked( true ); |
35 | } else { | 43 | } else { |
36 | essSpecific->setChecked( true ); | 44 | essSpecific->setChecked( true ); |
37 | essSpecificLineEdit->setText( ssid ); | 45 | essSpecificLineEdit->setText( ssid ); |
38 | } | 46 | } |
39 | QString mode = config->readEntry( "Mode", "Managed" ); | 47 | QString mode = config->readEntry( "Mode", "Managed" ); |
40 | if( mode == "adhoc" ) { | 48 | if( mode == "adhoc" ) { |
41 | network802->setChecked( true ); | 49 | network802->setChecked( true ); |
42 | } else { | 50 | } else { |
43 | networkInfrastructure->setChecked( true ); | 51 | networkInfrastructure->setChecked( true ); |
44 | } | 52 | } |
45 | networkChannel->setValue( config->readNumEntry( "CHANNEL", 1 ) ); | 53 | networkChannel->setValue( config->readNumEntry( "CHANNEL", 1 ) ); |
@@ -88,50 +96,52 @@ bool WLANImp::writeConfig() | |||
88 | wepEnabled->isChecked() ? config->writeEntry( "dot11PrivacyInvoked", "true" ) : config->writeEntry( "dot11PrivacyInvoked", "false" ); | 96 | wepEnabled->isChecked() ? config->writeEntry( "dot11PrivacyInvoked", "true" ) : config->writeEntry( "dot11PrivacyInvoked", "false" ); |
89 | authOpen->isChecked() ? config->writeEntry( "AuthType", "opensystem" ) : config->writeEntry( "AuthType", "sharedkey" ); | 97 | authOpen->isChecked() ? config->writeEntry( "AuthType", "opensystem" ) : config->writeEntry( "AuthType", "sharedkey" ); |
90 | key40->isChecked() ? config->writeEntry( "PRIV_KEY128", "false" ) : config->writeEntry( "PRIV_KEY128", "true" ); | 98 | key40->isChecked() ? config->writeEntry( "PRIV_KEY128", "false" ) : config->writeEntry( "PRIV_KEY128", "true" ); |
91 | if( keyRadio0->isChecked() ){ | 99 | if( keyRadio0->isChecked() ){ |
92 | config->writeEntry( "dot11WEPDefaultKeyID", 0 ); | 100 | config->writeEntry( "dot11WEPDefaultKeyID", 0 ); |
93 | } else if( keyRadio1->isChecked() ){ | 101 | } else if( keyRadio1->isChecked() ){ |
94 | config->writeEntry( "dot11WEPDefaultKeyID", 1 ); | 102 | config->writeEntry( "dot11WEPDefaultKeyID", 1 ); |
95 | } else if( keyRadio2->isChecked() ){ | 103 | } else if( keyRadio2->isChecked() ){ |
96 | config->writeEntry( "dot11WEPDefaultKeyID", 2 ); | 104 | config->writeEntry( "dot11WEPDefaultKeyID", 2 ); |
97 | } else if( keyRadio3->isChecked() ){ | 105 | } else if( keyRadio3->isChecked() ){ |
98 | config->writeEntry( "dot11WEPDefaultKeyID", 3 ); | 106 | config->writeEntry( "dot11WEPDefaultKeyID", 3 ); |
99 | } | 107 | } |
100 | config->writeEntry( "dot11WEPDefaultKey0", keyLineEdit0->text() ); | 108 | config->writeEntry( "dot11WEPDefaultKey0", keyLineEdit0->text() ); |
101 | config->writeEntry( "dot11WEPDefaultKey1", keyLineEdit1->text() ); | 109 | config->writeEntry( "dot11WEPDefaultKey1", keyLineEdit1->text() ); |
102 | config->writeEntry( "dot11WEPDefaultKey2", keyLineEdit2->text() ); | 110 | config->writeEntry( "dot11WEPDefaultKey2", keyLineEdit2->text() ); |
103 | config->writeEntry( "dot11WEPDefaultKey3", keyLineEdit3->text() ); | 111 | config->writeEntry( "dot11WEPDefaultKey3", keyLineEdit3->text() ); |
104 | return true; | 112 | return true; |
105 | return writeWirelessOpts( ); | 113 | return writeWirelessOpts( ); |
106 | } | 114 | } |
107 | 115 | ||
108 | /** | 116 | /** |
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 ) |
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"; |
120 | QFile prevFile(prev); | 130 | QFile prevFile(prev); |
121 | if ( !prevFile.open( IO_ReadOnly ) ) | 131 | if ( !prevFile.open( IO_ReadOnly ) ) |
122 | return false; | 132 | return false; |
123 | 133 | ||
124 | QString tmp = "/etc/pcmcia/wireless.opts-qpe-new"; | 134 | QString tmp = "/etc/pcmcia/wireless.opts-qpe-new"; |
125 | QFile tmpFile(tmp); | 135 | QFile tmpFile(tmp); |
126 | if ( !tmpFile.open( IO_WriteOnly ) ) | 136 | if ( !tmpFile.open( IO_WriteOnly ) ) |
127 | return false; | 137 | return false; |
128 | 138 | ||
129 | bool retval = true; | 139 | bool retval = true; |
130 | 140 | ||
131 | QTextStream in( &prevFile ); | 141 | QTextStream in( &prevFile ); |
132 | QTextStream out( &tmpFile ); | 142 | QTextStream out( &tmpFile ); |
133 | 143 | ||
134 | config->setGroup("Properties"); | 144 | config->setGroup("Properties"); |
135 | 145 | ||
136 | QString line; | 146 | QString line; |
137 | bool found=false; | 147 | bool found=false; |
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 | |||
@@ -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> | 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: |
16 | void accept(); | 18 | void accept(); |
17 | 19 | ||
18 | private: | 20 | private: |
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/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 | |||
@@ -1,101 +1,101 @@ | |||
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 | */ |
12 | WLANModule::WLANModule() : Module() { | 14 | WLANModule::WLANModule() : Module() { |
13 | } | 15 | } |
14 | 16 | ||
15 | /** | 17 | /** |
16 | * Delete any interfaces that we own. | 18 | * Delete any interfaces that we own. |
17 | */ | 19 | */ |
18 | WLANModule::~WLANModule(){ | 20 | WLANModule::~WLANModule(){ |
19 | Interface *i; | 21 | Interface *i; |
20 | for ( i=list.first(); i != 0; i=list.next() ) | 22 | for ( i=list.first(); i != 0; i=list.next() ) |
21 | delete i; | 23 | delete i; |
22 | } | 24 | } |
23 | 25 | ||
24 | /** | 26 | /** |
25 | * Change the current profile | 27 | * Change the current profile |
26 | */ | 28 | */ |
27 | void WLANModule::setProfile(QString newProfile){ | 29 | void WLANModule::setProfile(QString newProfile){ |
28 | profile = newProfile; | 30 | profile = newProfile; |
29 | } | 31 | } |
30 | 32 | ||
31 | /** | 33 | /** |
32 | * get the icon name for this device. | 34 | * get the icon name for this device. |
33 | * @param Interface* can be used in determining the icon. | 35 | * @param Interface* can be used in determining the icon. |
34 | * @return QString the icon name (minus .png, .gif etc) | 36 | * @return QString the icon name (minus .png, .gif etc) |
35 | */ | 37 | */ |
36 | QString WLANModule::getPixmapName(Interface* ){ | 38 | QString WLANModule::getPixmapName(Interface* ){ |
37 | return "wlan"; | 39 | return "wlan"; |
38 | } | 40 | } |
39 | 41 | ||
40 | /** | 42 | /** |
41 | * Check to see if the interface i is owned by this module. | 43 | * Check to see if the interface i is owned by this module. |
42 | * @param Interface* interface to check against | 44 | * @param Interface* interface to check against |
43 | * @return bool true if i is owned by this module, false otherwise. | 45 | * @return bool true if i is owned by this module, false otherwise. |
44 | */ | 46 | */ |
45 | bool WLANModule::isOwner(Interface *i){ | 47 | bool WLANModule::isOwner(Interface *i){ |
46 | WExtensions we(i->getInterfaceName()); | 48 | WExtensions we(i->getInterfaceName()); |
47 | if(!we.doesHaveWirelessExtensions()) | 49 | if(!we.doesHaveWirelessExtensions()) |
48 | return false; | 50 | return false; |
49 | 51 | ||
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 | */ |
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 | ||
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 |
84 | * been called by isOwner() | 84 | * been called by isOwner() |
85 | */ | 85 | */ |
86 | QList<Interface> WLANModule::getInterfaces(){ | 86 | QList<Interface> WLANModule::getInterfaces(){ |
87 | return list; | 87 | return list; |
88 | } | 88 | } |
89 | 89 | ||
90 | /** | 90 | /** |
91 | * Attempt to add a new interface as defined by name | 91 | * Attempt to add a new interface as defined by name |
92 | * @param name the name of the type of interface that should be created given | 92 | * @param name the name of the type of interface that should be created given |
93 | * by possibleNewInterfaces(); | 93 | * by possibleNewInterfaces(); |
94 | * @return Interface* NULL if it was unable to be created. | 94 | * @return Interface* NULL if it was unable to be created. |
95 | */ | 95 | */ |
96 | Interface *WLANModule::addNewInterface(QString ){ | 96 | Interface *WLANModule::addNewInterface(QString ){ |
97 | // We can't add a 802.11 interface, either the hardware will be there | 97 | // We can't add a 802.11 interface, either the hardware will be there |
98 | // or it wont. | 98 | // or it wont. |
99 | return NULL; | 99 | return NULL; |
100 | } | 100 | } |
101 | 101 | ||
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 | |||
@@ -1,41 +1,41 @@ | |||
1 | #ifndef WLAN_MODULE_H | 1 | #ifndef WLAN_MODULE_H |
2 | #define WLAN_MODULE_H | 2 | #define WLAN_MODULE_H |
3 | 3 | ||
4 | #include "module.h" | 4 | #include "module.h" |
5 | 5 | ||
6 | class WLANModule : Module{ | 6 | class WLANModule : Module{ |
7 | 7 | ||
8 | signals: | 8 | signals: |
9 | void updateInterface(Interface *i); | 9 | void updateInterface(Interface *i); |
10 | 10 | ||
11 | public: | 11 | public: |
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 | ||
25 | private: | 25 | private: |
26 | QList<Interface> list; | 26 | QList<Interface> list; |
27 | QString profile; | 27 | QString profile; |
28 | 28 | ||
29 | }; | 29 | }; |
30 | 30 | ||
31 | extern "C" | 31 | extern "C" |
32 | { | 32 | { |
33 | void* create_plugin() { | 33 | void* create_plugin() { |
34 | return new WLANModule(); | 34 | return new WLANModule(); |
35 | } | 35 | } |
36 | }; | 36 | }; |
37 | 37 | ||
38 | #endif | 38 | #endif |
39 | 39 | ||
40 | // wlanmodule.h | 40 | // wlanmodule.h |
41 | 41 | ||