Diffstat (limited to 'noncore/settings/networksettings/wlan') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanmodule.cpp | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp index 7bded85..a4488f9 100644 --- a/noncore/settings/networksettings/wlan/wlanmodule.cpp +++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp | |||
@@ -131,11 +131,28 @@ void WLANModule::receive(const QCString ¶m, const QByteArray &arg) | |||
131 | 131 | ||
132 | QDataStream stream(arg,IO_ReadOnly); | 132 | QDataStream stream(arg,IO_ReadOnly); |
133 | QString interface; | 133 | QString interface; |
134 | QString action; | 134 | QString action; |
135 | int countMsgs = 0; | ||
136 | stream >> interface; | ||
137 | qDebug("got count? >%s<",interface.latin1()); | ||
138 | if (interface == "count"){ | ||
139 | qDebug("got count"); | ||
140 | stream >> action; | ||
141 | qDebug("Got count num >%s<", action.latin1()); | ||
142 | countMsgs = action.toInt(); | ||
143 | } | ||
144 | |||
135 | QDialog *toShow; | 145 | QDialog *toShow; |
136 | while (! stream.atEnd() ){ | 146 | //while (! stream.atEnd() ){ |
147 | for (int i = 0; i < countMsgs; i++){ | ||
148 | qDebug("start stream %d/%d",i,countMsgs); | ||
149 | if (stream.atEnd()){ | ||
150 | qDebug("end of stream"); | ||
151 | return; | ||
152 | } | ||
137 | stream >> interface; | 153 | stream >> interface; |
154 | qDebug("got iface"); | ||
138 | stream >> action; | 155 | stream >> action; |
139 | qDebug("WLANModule got interface %s and acion %s", interface.latin1(), action.latin1()); | 156 | qDebug("WLANModule got interface %s and acion %s", interface.latin1(), action.latin1()); |
140 | // find interfaces | 157 | // find interfaces |
141 | Interface *ifa=0; | 158 | Interface *ifa=0; |
@@ -174,9 +191,13 @@ void WLANModule::receive(const QCString ¶m, const QByteArray &arg) | |||
174 | toShow = (QDialog*) wlanconfigWiget; | 191 | toShow = (QDialog*) wlanconfigWiget; |
175 | } | 192 | } |
176 | wlanconfigWiget->showMaximized(); | 193 | wlanconfigWiget->showMaximized(); |
177 | stream >> value; | 194 | stream >> value; |
178 | qDebug("WLANModule is setting %s of %s to %s", action.latin1(), interface.latin1(), value.latin1() ); | 195 | qDebug("WLANModule (build 4) is setting %s of %s to %s", action.latin1(), interface.latin1(), value.latin1() ); |
196 | if (value.isEmpty()){ | ||
197 | qDebug("value is empty!!!\nreturning"); | ||
198 | return; | ||
199 | } | ||
179 | if ( action.contains("ESSID") ){ | 200 | if ( action.contains("ESSID") ){ |
180 | QComboBox *combo = wlanconfigWiget->essid; | 201 | QComboBox *combo = wlanconfigWiget->essid; |
181 | bool found = false; | 202 | bool found = false; |
182 | for ( int i = 0; i < combo->count(); i++) | 203 | for ( int i = 0; i < combo->count(); i++) |
@@ -193,10 +214,12 @@ void WLANModule::receive(const QCString ¶m, const QByteArray &arg) | |||
193 | } | 214 | } |
194 | 215 | ||
195 | }else if (action.contains("Channel")){ | 216 | }else if (action.contains("Channel")){ |
196 | bool ok; | 217 | bool ok; |
218 | qDebug("converting channel"); | ||
197 | int chan = value.toInt( &ok ); | 219 | int chan = value.toInt( &ok ); |
198 | if (ok){ | 220 | if (ok){ |
221 | qDebug("ok setting channel"); | ||
199 | wlanconfigWiget->specifyChan->setChecked( true ); | 222 | wlanconfigWiget->specifyChan->setChecked( true ); |
200 | wlanconfigWiget->networkChannel->setValue( chan ); | 223 | wlanconfigWiget->networkChannel->setValue( chan ); |
201 | } | 224 | } |
202 | }else if (action.contains("MacAddr")){ | 225 | }else if (action.contains("MacAddr")){ |
@@ -204,19 +227,26 @@ void WLANModule::receive(const QCString ¶m, const QByteArray &arg) | |||
204 | wlanconfigWiget->macEdit->setText( value ); | 227 | wlanconfigWiget->macEdit->setText( value ); |
205 | }else | 228 | }else |
206 | qDebug("wlan plugin has no clue"); | 229 | qDebug("wlan plugin has no clue"); |
207 | } | 230 | } |
231 | qDebug("next stream"); | ||
208 | }// while stream | 232 | }// while stream |
233 | qDebug("end of stream"); | ||
209 | if (toShow) toShow->exec(); | 234 | if (toShow) toShow->exec(); |
235 | qDebug("returning"); | ||
210 | } | 236 | } |
211 | 237 | ||
212 | QWidget *WLANModule::getInfo( Interface *i) | 238 | QWidget *WLANModule::getInfo( Interface *i) |
213 | { | 239 | { |
214 | qDebug("WLANModule::getInfo start"); | 240 | qDebug("WLANModule::getInfo start"); |
215 | WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose); | 241 | WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose); |
216 | InterfaceInformationImp *information = new InterfaceInformationImp(info->tabWidget, "InterfaceSetupImp", i); | 242 | InterfaceInformationImp *information = new InterfaceInformationImp(info->tabWidget, "InterfaceSetupImp", i); |
217 | info->tabWidget->insertTab(information, "TCP/IP", 0); | 243 | info->tabWidget->insertTab(information, "TCP/IP", 0); |
218 | 244 | info->tabWidget->setCurrentPage( 0 ); | |
245 | info->tabWidget->showPage( information ); | ||
246 | if (info->tabWidget->currentPage() == information ) qDebug("infotab OK"); | ||
247 | else qDebug("infotab NOT OK"); | ||
248 | qDebug("current idx %d", info->tabWidget->currentPageIndex()); | ||
219 | qDebug("WLANModule::getInfo return"); | 249 | qDebug("WLANModule::getInfo return"); |
220 | return info; | 250 | return info; |
221 | } | 251 | } |
222 | 252 | ||