author | tille <tille> | 2003-06-13 13:32:55 (UTC) |
---|---|---|
committer | tille <tille> | 2003-06-13 13:32:55 (UTC) |
commit | e5d826221bab71c39dc8fc89d91509dd16bc2a8a (patch) (unidiff) | |
tree | 4a0ff06e1e6b43d52fe78a9ab14a7a8f98f41327 | |
parent | c48af71638614aaff280178693448916e0e98102 (diff) | |
download | opie-e5d826221bab71c39dc8fc89d91509dd16bc2a8a.zip opie-e5d826221bab71c39dc8fc89d91509dd16bc2a8a.tar.gz opie-e5d826221bab71c39dc8fc89d91509dd16bc2a8a.tar.bz2 |
qcop channels for start, stop wlan interface works now...
... the qcop handling has to become more general, and this handlet in the interface itself.
-rw-r--r-- | noncore/settings/networksettings/TODO | 6 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanimp2.cpp | 22 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanmodule.cpp | 50 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanmodule.h | 7 |
4 files changed, 65 insertions, 20 deletions
diff --git a/noncore/settings/networksettings/TODO b/noncore/settings/networksettings/TODO index 614501f..b28c5a0 100644 --- a/noncore/settings/networksettings/TODO +++ b/noncore/settings/networksettings/TODO | |||
@@ -1,3 +1,9 @@ | |||
1 | * make dcop handling portable | ||
2 | * move dcop call for start, stop interfaces from wlan to interface | ||
3 | |||
4 | |||
5 | Old TODO of Benmayer: | ||
6 | |||
1 | Types: | 7 | Types: |
2 | -Ethernet Connection (Done) | 8 | -Ethernet Connection (Done) |
3 | -ISDN Connection | 9 | -ISDN Connection |
diff --git a/noncore/settings/networksettings/wlan/wlanimp2.cpp b/noncore/settings/networksettings/wlan/wlanimp2.cpp index e7b842b..b988822 100644 --- a/noncore/settings/networksettings/wlan/wlanimp2.cpp +++ b/noncore/settings/networksettings/wlan/wlanimp2.cpp | |||
@@ -14,7 +14,7 @@ | |||
14 | #include <qtabwidget.h> | 14 | #include <qtabwidget.h> |
15 | #include <qcombobox.h> | 15 | #include <qcombobox.h> |
16 | 16 | ||
17 | #ifdef QWS | 17 | #ifdef QWS |
18 | #include <opie/oprocess.h> | 18 | #include <opie/oprocess.h> |
19 | #else | 19 | #else |
20 | #define OProcess KProcess | 20 | #define OProcess KProcess |
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | /** | 27 | /** |
28 | * Constructor, read in the wireless.opts file for parsing later. | 28 | * Constructor, read in the wireless.opts file for parsing later. |
29 | */ | 29 | */ |
30 | WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl) : WLAN(parent, name, modal, fl), currentProfile("*"), interface(i) { | 30 | WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl) : WLAN(parent, name, modal, fl), currentProfile("*"), interface(i) { |
31 | interfaces = new Interfaces; | 31 | interfaces = new Interfaces; |
32 | interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, interfaces); | 32 | interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, interfaces); |
@@ -40,12 +40,12 @@ WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, W | |||
40 | } | 40 | } |
41 | 41 | ||
42 | WLANImp::~WLANImp() { | 42 | WLANImp::~WLANImp() { |
43 | delete interfaces; | 43 | //FIXME: delete interfaces; |
44 | } | 44 | } |
45 | 45 | ||
46 | /** | 46 | /** |
47 | * Change the profile for both wireless settings and network settings. | 47 | * Change the profile for both wireless settings and network settings. |
48 | */ | 48 | */ |
49 | void WLANImp::setProfile(const QString &profile){ | 49 | void WLANImp::setProfile(const QString &profile){ |
50 | interfaceSetup->setProfile(profile); | 50 | interfaceSetup->setProfile(profile); |
51 | parseOpts(); | 51 | parseOpts(); |
@@ -58,7 +58,7 @@ void WLANImp::parseOpts() { | |||
58 | if (! interfaces->isInterfaceSet()) | 58 | if (! interfaces->isInterfaceSet()) |
59 | return; | 59 | return; |
60 | 60 | ||
61 | 61 | ||
62 | opt = interfaces->getInterfaceOption("wireless_essid", error); | 62 | opt = interfaces->getInterfaceOption("wireless_essid", error); |
63 | if(opt == "any" || opt == "off" || opt.isNull()){ | 63 | if(opt == "any" || opt == "off" || opt.isNull()){ |
64 | essid->setEditText("any"); | 64 | essid->setEditText("any"); |
@@ -75,7 +75,7 @@ void WLANImp::parseOpts() { | |||
75 | // Managed/Infrastructure mode | 75 | // Managed/Infrastructure mode |
76 | mode->setCurrentItem(1); | 76 | mode->setCurrentItem(1); |
77 | } | 77 | } |
78 | 78 | ||
79 | opt = interfaces->getInterfaceOption("wireless_ap", error).simplifyWhiteSpace(); | 79 | opt = interfaces->getInterfaceOption("wireless_ap", error).simplifyWhiteSpace(); |
80 | if (! opt.isNull()) { | 80 | if (! opt.isNull()) { |
81 | specifyAp->setChecked(true); | 81 | specifyAp->setChecked(true); |
@@ -132,7 +132,7 @@ void WLANImp::parseKeyStr(QString keystr) { | |||
132 | case 4: | 132 | case 4: |
133 | keyRadio3->setChecked(true); | 133 | keyRadio3->setChecked(true); |
134 | break; | 134 | break; |
135 | } | 135 | } |
136 | } else { | 136 | } else { |
137 | // key | 137 | // key |
138 | key = (*it); | 138 | key = (*it); |
@@ -140,7 +140,7 @@ void WLANImp::parseKeyStr(QString keystr) { | |||
140 | if (! key.isNull()) { | 140 | if (! key.isNull()) { |
141 | if (enc == -1) | 141 | if (enc == -1) |
142 | enc = 1; | 142 | enc = 1; |
143 | QStringList::Iterator next = ++it; | 143 | QStringList::Iterator next = ++it; |
144 | if (it == keys.end()) { | 144 | if (it == keys.end()) { |
145 | break; | 145 | break; |
146 | } | 146 | } |
@@ -187,8 +187,8 @@ void WLANImp::accept() { | |||
187 | QMessageBox::information(this, "Error", "Please enter a WEP key.", QMessageBox::Ok); | 187 | QMessageBox::information(this, "Error", "Please enter a WEP key.", QMessageBox::Ok); |
188 | return; | 188 | return; |
189 | } | 189 | } |
190 | } | 190 | } |
191 | 191 | ||
192 | if (essid->currentText().isEmpty()) { | 192 | if (essid->currentText().isEmpty()) { |
193 | QMessageBox::information(this, "Error", "Please select/enter an ESSID.", QMessageBox::Ok); | 193 | QMessageBox::information(this, "Error", "Please select/enter an ESSID.", QMessageBox::Ok); |
194 | return; | 194 | return; |
@@ -198,7 +198,7 @@ void WLANImp::accept() { | |||
198 | QMessageBox::information(this, "Error", "Please enter the MAC address of the Access Point.", QMessageBox::Ok); | 198 | QMessageBox::information(this, "Error", "Please enter the MAC address of the Access Point.", QMessageBox::Ok); |
199 | return; | 199 | return; |
200 | } | 200 | } |
201 | 201 | ||
202 | // Try to save the interfaces settings. | 202 | // Try to save the interfaces settings. |
203 | writeOpts(); | 203 | writeOpts(); |
204 | 204 | ||
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp index 3c988d5..e6f082c 100644 --- a/noncore/settings/networksettings/wlan/wlanmodule.cpp +++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp | |||
@@ -8,6 +8,9 @@ | |||
8 | #include <qprogressbar.h> | 8 | #include <qprogressbar.h> |
9 | #include <qtabwidget.h> | 9 | #include <qtabwidget.h> |
10 | 10 | ||
11 | |||
12 | |||
13 | |||
11 | /** | 14 | /** |
12 | * Constructor, find all of the possible interfaces | 15 | * Constructor, find all of the possible interfaces |
13 | */ | 16 | */ |
@@ -21,6 +24,7 @@ WLANModule::~WLANModule(){ | |||
21 | Interface *i; | 24 | Interface *i; |
22 | for ( i=list.first(); i != 0; i=list.next() ) | 25 | for ( i=list.first(); i != 0; i=list.next() ) |
23 | delete i; | 26 | delete i; |
27 | |||
24 | } | 28 | } |
25 | 29 | ||
26 | /** | 30 | /** |
@@ -73,10 +77,7 @@ QWidget *WLANModule::information(Interface *i){ | |||
73 | if(!we.doesHaveWirelessExtensions()) | 77 | if(!we.doesHaveWirelessExtensions()) |
74 | return NULL; | 78 | return NULL; |
75 | 79 | ||
76 | WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose); | 80 | return getInfo( i ); |
77 | InterfaceInformationImp *information = new InterfaceInformationImp(info->tabWidget, "InterfaceSetupImp", i); | ||
78 | info->tabWidget->insertTab(information, "TCP/IP"); | ||
79 | return info; | ||
80 | } | 81 | } |
81 | 82 | ||
82 | /** | 83 | /** |
@@ -128,20 +129,43 @@ void WLANModule::receive(const QCString ¶m, const QByteArray &arg) | |||
128 | stream >> interface; | 129 | stream >> interface; |
129 | stream >> action; | 130 | stream >> action; |
130 | qDebug("got interface %s and acion %s", interface.latin1(), action.latin1()); | 131 | qDebug("got interface %s and acion %s", interface.latin1(), action.latin1()); |
132 | // find interfaces | ||
133 | Interface *ifa=0; | ||
134 | for ( Interface *i=list.first(); i != 0; i=list.next() ){ | ||
135 | if (i->getInterfaceName() == interface){ | ||
136 | qDebug("found interface %s",interface.latin1()); | ||
137 | ifa = i; | ||
138 | } | ||
139 | } | ||
140 | |||
141 | if (ifa == 0){ | ||
142 | qFatal("Did not find %s",interface.latin1()); | ||
143 | } | ||
131 | 144 | ||
132 | if (count == 2){ | 145 | if (count == 2){ |
133 | // those should call the interface | 146 | // those should call the interface directly |
147 | QWidget *info = getInfo( ifa ); | ||
148 | info->showMaximized(); | ||
149 | |||
134 | if ( action.contains("start" ) ){ | 150 | if ( action.contains("start" ) ){ |
135 | qDebug("starting %s not yet implemented",interface.latin1()); | 151 | ifa->start(); |
136 | } else if ( action.contains("restart" ) ){ | 152 | } else if ( action.contains("restart" ) ){ |
137 | qDebug("restarting %s not yet implemented",interface.latin1()); | 153 | ifa->restart(); |
138 | } else if ( action.contains("stop" ) ){ | 154 | } else if ( action.contains("stop" ) ){ |
139 | qDebug("stopping %s not yet implemented",interface.latin1()); | 155 | ifa->stop(); |
156 | }else if ( action.contains("refresh" ) ){ | ||
157 | ifa->refresh(); | ||
140 | } | 158 | } |
141 | }else if (count == 3){ | 159 | }else if (count == 3){ |
142 | QString value; | 160 | QString value; |
143 | stream >> value; | 161 | stream >> value; |
144 | qDebug("setting %s of %s to %s", action.latin1(), interface.latin1(), value.latin1() ); | 162 | qDebug("setting %s of %s to %s", action.latin1(), interface.latin1(), value.latin1() ); |
163 | if ( action.contains("ESSID") ){ | ||
164 | qDebug("Setting ESSID not yet impl"); | ||
165 | }else if (action.contains("Channel")){ | ||
166 | qDebug("Setting Channel not yet impl"); | ||
167 | }else | ||
168 | qDebug("wlan plugin has no clue"); | ||
145 | } | 169 | } |
146 | // if (param.contains("QString,QString,QString")) { | 170 | // if (param.contains("QString,QString,QString")) { |
147 | // QDataStream stream(arg,IO_ReadOnly); | 171 | // QDataStream stream(arg,IO_ReadOnly); |
@@ -151,3 +175,13 @@ void WLANModule::receive(const QCString ¶m, const QByteArray &arg) | |||
151 | // } | 175 | // } |
152 | } | 176 | } |
153 | 177 | ||
178 | QWidget *WLANModule::getInfo( Interface *i) | ||
179 | { | ||
180 | qDebug("WLANModule::getInfo start"); | ||
181 | WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose); | ||
182 | InterfaceInformationImp *information = new InterfaceInformationImp(info->tabWidget, "InterfaceSetupImp", i); | ||
183 | info->tabWidget->insertTab(information, "TCP/IP", 0); | ||
184 | |||
185 | qDebug("WLANModule::getInfo return"); | ||
186 | return info; | ||
187 | } | ||
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.h b/noncore/settings/networksettings/wlan/wlanmodule.h index a617a90..0963137 100644 --- a/noncore/settings/networksettings/wlan/wlanmodule.h +++ b/noncore/settings/networksettings/wlan/wlanmodule.h | |||
@@ -3,6 +3,8 @@ | |||
3 | 3 | ||
4 | #include "module.h" | 4 | #include "module.h" |
5 | 5 | ||
6 | //class WlanInfoImp; | ||
7 | |||
6 | class WLANModule : Module{ | 8 | class WLANModule : Module{ |
7 | 9 | ||
8 | signals: | 10 | signals: |
@@ -26,9 +28,12 @@ public: | |||
26 | virtual void receive(const QCString&, const QByteArray&); | 28 | virtual void receive(const QCString&, const QByteArray&); |
27 | 29 | ||
28 | private: | 30 | private: |
31 | QWidget *getInfo(Interface*); | ||
32 | |||
29 | QList<Interface> list; | 33 | QList<Interface> list; |
30 | QString profile; | 34 | QString profile; |
31 | 35 | // WlanInfoImp *info; | |
36 | // Interface *iface; | ||
32 | }; | 37 | }; |
33 | 38 | ||
34 | extern "C" | 39 | extern "C" |