author | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
commit | 16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 (patch) (unidiff) | |
tree | 0701eae15aa606a0211a2fccfde0eafdac69357c /noncore/settings/networksettings/wlan | |
parent | 8d2d2664e5f544b8292806e617deb7a0e4170dc0 (diff) | |
download | opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.zip opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.gz opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.bz2 |
convert to Opie Debugging Framework
Diffstat (limited to 'noncore/settings/networksettings/wlan') (more/less context) (ignore whitespace changes)
5 files changed, 50 insertions, 50 deletions
diff --git a/noncore/settings/networksettings/wlan/infoimp.cpp b/noncore/settings/networksettings/wlan/infoimp.cpp index bd56678..c558f5e 100644 --- a/noncore/settings/networksettings/wlan/infoimp.cpp +++ b/noncore/settings/networksettings/wlan/infoimp.cpp | |||
@@ -10,13 +10,13 @@ | |||
10 | * start a timer that every second will update the information. | 10 | * start a timer that every second will update the information. |
11 | */ | 11 | */ |
12 | WlanInfoImp::WlanInfoImp( QWidget* parent, const char* name, WFlags fl): WlanInfo(parent, name, fl){ | 12 | WlanInfoImp::WlanInfoImp( QWidget* parent, const char* name, WFlags fl): WlanInfo(parent, name, fl){ |
13 | WExtensions *wExtensions = new WExtensions(name); | 13 | WExtensions *wExtensions = new WExtensions(name); |
14 | if(!wExtensions->doesHaveWirelessExtensions()){ | 14 | if(!wExtensions->doesHaveWirelessExtensions()){ |
15 | delete wExtensions; | 15 | delete wExtensions; |
16 | qDebug("WlanInfoImp::No wireless extension"); | 16 | odebug << "WlanInfoImp::No wireless extension" << oendl; |
17 | return; | 17 | return; |
18 | } | 18 | } |
19 | delete wExtensions; | 19 | delete wExtensions; |
20 | timer = new QTimer( this ); | 20 | timer = new QTimer( this ); |
21 | connect( timer, SIGNAL(timeout()), this, SLOT(update())); | 21 | connect( timer, SIGNAL(timeout()), this, SLOT(update())); |
22 | timer->start( 1000, false ); | 22 | timer->start( 1000, false ); |
@@ -25,13 +25,13 @@ WlanInfoImp::WlanInfoImp( QWidget* parent, const char* name, WFlags fl): WlanInf | |||
25 | /** | 25 | /** |
26 | * Updates the information about the wireless device. | 26 | * Updates the information about the wireless device. |
27 | */ | 27 | */ |
28 | void WlanInfoImp::update(){ | 28 | void WlanInfoImp::update(){ |
29 | WExtensions *wExtensions = new WExtensions(this->name()); | 29 | WExtensions *wExtensions = new WExtensions(this->name()); |
30 | if(!wExtensions->doesHaveWirelessExtensions()){ | 30 | if(!wExtensions->doesHaveWirelessExtensions()){ |
31 | qDebug("No extension"); | 31 | odebug << "No extension" << oendl; |
32 | delete wExtensions; | 32 | delete wExtensions; |
33 | timer->stop(); | 33 | timer->stop(); |
34 | return; | 34 | return; |
35 | } | 35 | } |
36 | essidLabel->setText(wExtensions->essid()); | 36 | essidLabel->setText(wExtensions->essid()); |
37 | apLabel->setText(wExtensions->ap()); | 37 | apLabel->setText(wExtensions->ap()); |
diff --git a/noncore/settings/networksettings/wlan/wextensions.cpp b/noncore/settings/networksettings/wlan/wextensions.cpp index d1fff88..9c64323 100644 --- a/noncore/settings/networksettings/wlan/wextensions.cpp +++ b/noncore/settings/networksettings/wlan/wextensions.cpp | |||
@@ -109,13 +109,13 @@ int WExtensions::channel(){ | |||
109 | for(int channel = 1; channel<= 15; channel++){ | 109 | for(int channel = 1; channel<= 15; channel++){ |
110 | if( num >= left && num <= right ) | 110 | if( num >= left && num <= right ) |
111 | return channel; | 111 | return channel; |
112 | left += 0.005; | 112 | left += 0.005; |
113 | right += 0.005; | 113 | right += 0.005; |
114 | } | 114 | } |
115 | qDebug(QString("Unknown frequency: %1, returning -1 for the channel.").arg(num).latin1()); | 115 | odebug << QString("Unknown frequency: %1, returning -1 for the channel.").arg(num).latin1() << oendl; |
116 | return -1; | 116 | return -1; |
117 | } | 117 | } |
118 | 118 | ||
119 | /*** | 119 | /*** |
120 | * Get the current rate that the card is transmiting at. | 120 | * Get the current rate that the card is transmiting at. |
121 | * @return double the rate, 0 if error. | 121 | * @return double the rate, 0 if error. |
@@ -174,26 +174,26 @@ bool WExtensions::stats(int &signal, int &noise, int &quality){ | |||
174 | wstream.readLine(); // skip the first two lines | 174 | wstream.readLine(); // skip the first two lines |
175 | wstream.readLine(); // because they only contain headers | 175 | wstream.readLine(); // because they only contain headers |
176 | while(!wstream.atEnd()){ | 176 | while(!wstream.atEnd()){ |
177 | wstream >> name >> status >> quality >> c >> signal >> c >> noise; | 177 | wstream >> name >> status >> quality >> c >> signal >> c >> noise; |
178 | if(name == QString("%1:").arg(interface)){ | 178 | if(name == QString("%1:").arg(interface)){ |
179 | if ( quality > 92 ) | 179 | if ( quality > 92 ) |
180 | qDebug( "WIFIAPPLET: D'oh! Quality %d > estimated max!\n", quality ); | 180 | odebug << "WIFIAPPLET: D'oh! Quality " << quality << " > estimated max!\n" << oendl; |
181 | if ( ( signal > IW_UPPER ) || ( signal < IW_LOWER ) ) | 181 | if ( ( signal > IW_UPPER ) || ( signal < IW_LOWER ) ) |
182 | qDebug( "WIFIAPPLET: Doh! Strength %d > estimated max!\n", signal ); | 182 | odebug << "WIFIAPPLET: Doh! Strength " << signal << " > estimated max!\n" << oendl; |
183 | if ( ( noise > IW_UPPER ) || ( noise < IW_LOWER ) ) | 183 | if ( ( noise > IW_UPPER ) || ( noise < IW_LOWER ) ) |
184 | qDebug( "WIFIAPPLET: Doh! Noise %d > estimated max!\n", noise ); | 184 | odebug << "WIFIAPPLET: Doh! Noise " << noise << " > estimated max!\n" << oendl; |
185 | //qDebug(QString("q:%1, s:%2, n:%3").arg(quality).arg(signal).arg(noise).latin1()); | 185 | //odebug << QString("q:%1, s:%2, n:%3").arg(quality).arg(signal).arg(noise).latin1() << oendl; |
186 | signal = ( ( signal-IW_LOWER ) * 100 ) / IW_UPPER; | 186 | signal = ( ( signal-IW_LOWER ) * 100 ) / IW_UPPER; |
187 | noise = ( ( noise-IW_LOWER ) * 100 ) / IW_UPPER; | 187 | noise = ( ( noise-IW_LOWER ) * 100 ) / IW_UPPER; |
188 | quality = ( quality*100 ) / 92; | 188 | quality = ( quality*100 ) / 92; |
189 | return true; | 189 | return true; |
190 | } | 190 | } |
191 | } | 191 | } |
192 | 192 | ||
193 | qDebug("WExtensions::statsCard no longer present."); | 193 | odebug << "WExtensions::statsCard no longer present." << oendl; |
194 | quality = -1; | 194 | quality = -1; |
195 | signal = IW_LOWER; | 195 | signal = IW_LOWER; |
196 | noise = IW_LOWER; | 196 | noise = IW_LOWER; |
197 | return false; | 197 | return false; |
198 | } | 198 | } |
199 | 199 | ||
diff --git a/noncore/settings/networksettings/wlan/wlanimp.cpp b/noncore/settings/networksettings/wlan/wlanimp.cpp index 80a9927..fe7941d 100644 --- a/noncore/settings/networksettings/wlan/wlanimp.cpp +++ b/noncore/settings/networksettings/wlan/wlanimp.cpp | |||
@@ -42,13 +42,13 @@ WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, W | |||
42 | } | 42 | } |
43 | file.close(); | 43 | file.close(); |
44 | settingsFileText = QStringList::split("\n", line, true); | 44 | settingsFileText = QStringList::split("\n", line, true); |
45 | parseSettingFile(); | 45 | parseSettingFile(); |
46 | } | 46 | } |
47 | else | 47 | else |
48 | qDebug(QString("WLANImp: Can't open file: %1 for reading.").arg(wlanFile).latin1()); | 48 | odebug << QString("WLANImp: Can't open file: %1 for reading.").arg(wlanFile).latin1() << oendl; |
49 | connect(networkType, SIGNAL(activated(int)), this, SLOT(typeChanged(int))); | 49 | connect(networkType, SIGNAL(activated(int)), this, SLOT(typeChanged(int))); |
50 | } | 50 | } |
51 | 51 | ||
52 | void WLANImp::typeChanged(int mod){ | 52 | void WLANImp::typeChanged(int mod){ |
53 | networkChannel->setEnabled(mod); | 53 | networkChannel->setEnabled(mod); |
54 | channelLabel->setEnabled(mod); | 54 | channelLabel->setEnabled(mod); |
@@ -143,13 +143,13 @@ void WLANImp::parseSettingFile(){ | |||
143 | void WLANImp::changeAndSaveSettingFile(){ | 143 | void WLANImp::changeAndSaveSettingFile(){ |
144 | QString wlanFile = WIRELESS_OPTS; | 144 | QString wlanFile = WIRELESS_OPTS; |
145 | QFile::remove(wlanFile); | 145 | QFile::remove(wlanFile); |
146 | QFile file(wlanFile); | 146 | QFile file(wlanFile); |
147 | 147 | ||
148 | if (!file.open(IO_ReadWrite)){ | 148 | if (!file.open(IO_ReadWrite)){ |
149 | qDebug(QString("WLANImp::changeAndSaveSettingFile(): Can't open file: %1 for writing.").arg(wlanFile).latin1()); | 149 | odebug << QString("WLANImp::changeAndSaveSettingFile(): Can't open file: %1 for writing.").arg(wlanFile).latin1() << oendl; |
150 | return; | 150 | return; |
151 | } | 151 | } |
152 | 152 | ||
153 | QTextStream stream( &file ); | 153 | QTextStream stream( &file ); |
154 | bool foundCase = false; | 154 | bool foundCase = false; |
155 | bool found = false; | 155 | bool found = false; |
@@ -233,13 +233,13 @@ void WLANImp::accept(){ | |||
233 | OProcess insert; | 233 | OProcess insert; |
234 | insert << "sh"; | 234 | insert << "sh"; |
235 | insert << "-c"; | 235 | insert << "-c"; |
236 | insert << "cardctl eject && cardctl insert"; | 236 | insert << "cardctl eject && cardctl insert"; |
237 | 237 | ||
238 | if (!insert.start(OProcess::DontCare, OProcess::NoCommunication) ) { | 238 | if (!insert.start(OProcess::DontCare, OProcess::NoCommunication) ) { |
239 | qWarning("could not start cardctl"); | 239 | owarn << "could not start cardctl" << oendl; |
240 | } | 240 | } |
241 | 241 | ||
242 | // Close out the dialog | 242 | // Close out the dialog |
243 | QDialog::accept(); | 243 | QDialog::accept(); |
244 | } | 244 | } |
245 | 245 | ||
diff --git a/noncore/settings/networksettings/wlan/wlanimp2.cpp b/noncore/settings/networksettings/wlan/wlanimp2.cpp index eeebe7f..e483efe 100644 --- a/noncore/settings/networksettings/wlan/wlanimp2.cpp +++ b/noncore/settings/networksettings/wlan/wlanimp2.cpp | |||
@@ -49,13 +49,13 @@ WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, W | |||
49 | interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, interfaces); | 49 | interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, interfaces); |
50 | tabWidget->insertTab(interfaceSetup, "TCP/IP"); | 50 | tabWidget->insertTab(interfaceSetup, "TCP/IP"); |
51 | 51 | ||
52 | // Check sanity - the existance of the wireless-tools if-pre-up script | 52 | // Check sanity - the existance of the wireless-tools if-pre-up script |
53 | QFile file(QString(PREUP)); | 53 | QFile file(QString(PREUP)); |
54 | if (file.exists()) { | 54 | if (file.exists()) { |
55 | qWarning(QString("WLANImp: Unable to open /etc/network/if-pre-up.d/wireless-tools")); | 55 | owarn << QString("WLANImp: Unable to open /etc/network/if-pre-up.d/wireless-tools") << oendl; |
56 | } | 56 | } |
57 | 57 | ||
58 | connect( rescanButton, SIGNAL( clicked() ), this, SLOT( rescanNeighbourhood() ) ); | 58 | connect( rescanButton, SIGNAL( clicked() ), this, SLOT( rescanNeighbourhood() ) ); |
59 | connect( netView, SIGNAL( clicked(QListViewItem*) ), this, SLOT( selectNetwork(QListViewItem*) ) ); | 59 | connect( netView, SIGNAL( clicked(QListViewItem*) ), this, SLOT( selectNetwork(QListViewItem*) ) ); |
60 | netView->setColumnAlignment( col_chn, AlignCenter ); | 60 | netView->setColumnAlignment( col_chn, AlignCenter ); |
61 | netView->setItemMargin( 3 ); | 61 | netView->setItemMargin( 3 ); |
@@ -230,13 +230,13 @@ void WLANImp::writeOpts() { | |||
230 | if(!interfaces->isInterfaceSet()){ | 230 | if(!interfaces->isInterfaceSet()){ |
231 | QMessageBox::warning(0,"Inface not set","should not happen!!!"); | 231 | QMessageBox::warning(0,"Inface not set","should not happen!!!"); |
232 | return; | 232 | return; |
233 | } | 233 | } |
234 | bool error = false; | 234 | bool error = false; |
235 | 235 | ||
236 | qDebug("setting wlan interface %s", interfaces->getInterfaceName( error ).latin1() ); | 236 | odebug << "setting wlan interface " << interfaces->getInterfaceName( error ).latin1() << "" << oendl; |
237 | 237 | ||
238 | if (error) QMessageBox::warning(0,"Inface not set","should not happen!!!"); | 238 | if (error) QMessageBox::warning(0,"Inface not set","should not happen!!!"); |
239 | 239 | ||
240 | interfaces->setInterfaceOption(QString("wireless_mode"), mode->currentText()); | 240 | interfaces->setInterfaceOption(QString("wireless_mode"), mode->currentText()); |
241 | interfaces->setInterfaceOption(QString("wireless_essid"), essid->currentText()); | 241 | interfaces->setInterfaceOption(QString("wireless_essid"), essid->currentText()); |
242 | 242 | ||
@@ -304,13 +304,13 @@ void WLANImp::writeOpts() { | |||
304 | * ... powered by Wellenreiter II technology (C) Michael 'Mickey' Lauer <mickeyl@handhelds.org> | 304 | * ... powered by Wellenreiter II technology (C) Michael 'Mickey' Lauer <mickeyl@handhelds.org> |
305 | */ | 305 | */ |
306 | 306 | ||
307 | void WLANImp::rescanNeighbourhood() | 307 | void WLANImp::rescanNeighbourhood() |
308 | { | 308 | { |
309 | QString name = interface->getInterfaceName(); | 309 | QString name = interface->getInterfaceName(); |
310 | qDebug( "rescanNeighbourhood via '%s'", (const char*) name ); | 310 | odebug << "rescanNeighbourhood via '" << (const char*) name << "'" << oendl; |
311 | 311 | ||
312 | OWirelessNetworkInterface* wiface = static_cast<OWirelessNetworkInterface*>( ONetwork::instance()->interface( name ) ); | 312 | OWirelessNetworkInterface* wiface = static_cast<OWirelessNetworkInterface*>( ONetwork::instance()->interface( name ) ); |
313 | assert( wiface ); | 313 | assert( wiface ); |
314 | 314 | ||
315 | // try to guess device type | 315 | // try to guess device type |
316 | QString devicetype; | 316 | QString devicetype; |
@@ -327,18 +327,18 @@ void WLANImp::rescanNeighbourhood() | |||
327 | else if ( line.contains( "prism" ) ) devicetype = "wlan-ng"; /* puke */ | 327 | else if ( line.contains( "prism" ) ) devicetype = "wlan-ng"; /* puke */ |
328 | else if ( line.contains( "orinoco" ) ) devicetype = "orinoco"; | 328 | else if ( line.contains( "orinoco" ) ) devicetype = "orinoco"; |
329 | } | 329 | } |
330 | } | 330 | } |
331 | if ( devicetype.isEmpty() ) | 331 | if ( devicetype.isEmpty() ) |
332 | { | 332 | { |
333 | qWarning( "rescanNeighbourhood(): couldn't guess device type :(" ); | 333 | owarn << "rescanNeighbourhood(): couldn't guess device type :(" << oendl; |
334 | return; | 334 | return; |
335 | } | 335 | } |
336 | else | 336 | else |
337 | { | 337 | { |
338 | qDebug( "rescanNeighbourhood(): device type seems to be '%s'", (const char*) devicetype ); | 338 | odebug << "rescanNeighbourhood(): device type seems to be '" << (const char*) devicetype << "'" << oendl; |
339 | } | 339 | } |
340 | 340 | ||
341 | // configure interface to receive 802.11 management frames | 341 | // configure interface to receive 802.11 management frames |
342 | 342 | ||
343 | wiface->setUp( true ); | 343 | wiface->setUp( true ); |
344 | wiface->setPromiscuousMode( true ); | 344 | wiface->setPromiscuousMode( true ); |
@@ -346,29 +346,29 @@ void WLANImp::rescanNeighbourhood() | |||
346 | if ( devicetype == "cisco" ) wiface->setMonitoring( new OCiscoMonitoringInterface( wiface, false ) ); | 346 | if ( devicetype == "cisco" ) wiface->setMonitoring( new OCiscoMonitoringInterface( wiface, false ) ); |
347 | else if ( devicetype == "hostap" ) wiface->setMonitoring( new OHostAPMonitoringInterface( wiface, false ) ); | 347 | else if ( devicetype == "hostap" ) wiface->setMonitoring( new OHostAPMonitoringInterface( wiface, false ) ); |
348 | else if ( devicetype == "wlan-ng" ) wiface->setMonitoring( new OWlanNGMonitoringInterface( wiface, false ) ); | 348 | else if ( devicetype == "wlan-ng" ) wiface->setMonitoring( new OWlanNGMonitoringInterface( wiface, false ) ); |
349 | else if ( devicetype == "orinoco" ) wiface->setMonitoring( new OOrinocoMonitoringInterface( wiface, false ) ); | 349 | else if ( devicetype == "orinoco" ) wiface->setMonitoring( new OOrinocoMonitoringInterface( wiface, false ) ); |
350 | else | 350 | else |
351 | { | 351 | { |
352 | qDebug( "rescanNeighbourhood(): unsupported device type for monitoring :(" ); | 352 | odebug << "rescanNeighbourhood(): unsupported device type for monitoring :(" << oendl; |
353 | return; | 353 | return; |
354 | } | 354 | } |
355 | 355 | ||
356 | wiface->setMode( "monitor" ); | 356 | wiface->setMode( "monitor" ); |
357 | if ( wiface->mode() != "monitor" ) | 357 | if ( wiface->mode() != "monitor" ) |
358 | { | 358 | { |
359 | qWarning( "rescanNeighbourhood(): Unable to bring device into monitor mode (%s).", strerror( errno ) ); | 359 | owarn << "rescanNeighbourhood(): Unable to bring device into monitor mode (" << strerror( errno ) << ")." << oendl; |
360 | return; | 360 | return; |
361 | } | 361 | } |
362 | 362 | ||
363 | // open a packet capturer | 363 | // open a packet capturer |
364 | OPacketCapturer* cap = new OPacketCapturer(); | 364 | OPacketCapturer* cap = new OPacketCapturer(); |
365 | cap->open( name ); | 365 | cap->open( name ); |
366 | if ( !cap->isOpen() ) | 366 | if ( !cap->isOpen() ) |
367 | { | 367 | { |
368 | qWarning( "rescanNeighbourhood(): Unable to open libpcap (%s).", strerror( errno ) ); | 368 | owarn << "rescanNeighbourhood(): Unable to open libpcap (" << strerror( errno ) << ")." << oendl; |
369 | return; | 369 | return; |
370 | } | 370 | } |
371 | 371 | ||
372 | // display splash screen | 372 | // display splash screen |
373 | QFrame* splash = new QFrame( this, "splash", false, WStyle_StaysOnTop | WStyle_DialogBorder | WStyle_Customize ); | 373 | QFrame* splash = new QFrame( this, "splash", false, WStyle_StaysOnTop | WStyle_DialogBorder | WStyle_Customize ); |
374 | splash->setLineWidth( 2 ); | 374 | splash->setLineWidth( 2 ); |
@@ -395,21 +395,21 @@ void WLANImp::rescanNeighbourhood() | |||
395 | 395 | ||
396 | for ( int i = 1; i <= wiface->channels(); ++i ) | 396 | for ( int i = 1; i <= wiface->channels(); ++i ) |
397 | { | 397 | { |
398 | wiface->setChannel( i ); | 398 | wiface->setChannel( i ); |
399 | pb->setProgress( i ); | 399 | pb->setProgress( i ); |
400 | qApp->processEvents(); | 400 | qApp->processEvents(); |
401 | qDebug( "rescanNeighbourhood(): listening on channel %d...", i ); | 401 | odebug << "rescanNeighbourhood(): listening on channel " << i << "..." << oendl; |
402 | OPacket* p = cap->next( 1000 ); | 402 | OPacket* p = cap->next( 1000 ); |
403 | if ( !p ) | 403 | if ( !p ) |
404 | { | 404 | { |
405 | qDebug( "rescanNeighbourhood(): nothing received on channel %d", i ); | 405 | odebug << "rescanNeighbourhood(): nothing received on channel " << i << "" << oendl; |
406 | } | 406 | } |
407 | else | 407 | else |
408 | { | 408 | { |
409 | qDebug( "rescanNeighbourhood(): TADAA - something came in on channel %d", i ); | 409 | odebug << "rescanNeighbourhood(): TADAA - something came in on channel " << i << "" << oendl; |
410 | handlePacket( p ); | 410 | handlePacket( p ); |
411 | } | 411 | } |
412 | } | 412 | } |
413 | 413 | ||
414 | cap->close(); | 414 | cap->close(); |
415 | wiface->setMode( "managed" ); // TODO: use previous mode | 415 | wiface->setMode( "managed" ); // TODO: use previous mode |
@@ -436,13 +436,13 @@ void WLANImp::handlePacket( OPacket* p ) | |||
436 | else if ( beacon->canESS() ) | 436 | else if ( beacon->canESS() ) |
437 | { | 437 | { |
438 | type = "managed"; | 438 | type = "managed"; |
439 | } | 439 | } |
440 | else | 440 | else |
441 | { | 441 | { |
442 | qWarning( "handlePacket(): invalid frame [possibly noise] detected!" ); | 442 | owarn << "handlePacket(): invalid frame [possibly noise] detected!" << oendl; |
443 | return; | 443 | return; |
444 | } | 444 | } |
445 | 445 | ||
446 | OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); | 446 | OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); |
447 | QString essid = ssid ? ssid->ID() : QString("<unknown>"); | 447 | QString essid = ssid ? ssid->ID() : QString("<unknown>"); |
448 | OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) ); | 448 | OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) ); |
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp index 74d7f8e..886af10 100644 --- a/noncore/settings/networksettings/wlan/wlanmodule.cpp +++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp | |||
@@ -119,59 +119,59 @@ bool WLANModule::remove(Interface*){ | |||
119 | // Can't remove a hardware device, you can stop it though. | 119 | // Can't remove a hardware device, you can stop it though. |
120 | return false; | 120 | return false; |
121 | } | 121 | } |
122 | 122 | ||
123 | void WLANModule::receive(const QCString ¶m, const QByteArray &arg) | 123 | void WLANModule::receive(const QCString ¶m, const QByteArray &arg) |
124 | { | 124 | { |
125 | qDebug("WLANModule::receive "+param); | 125 | odebug << "WLANModule::receive "+param << oendl; |
126 | QStringList params = QStringList::split(",",param); | 126 | QStringList params = QStringList::split(",",param); |
127 | int count = params.count(); | 127 | int count = params.count(); |
128 | qDebug("WLANModule got %i params", count ); | 128 | odebug << "WLANModule got " << count << " params" << oendl; |
129 | if (count < 2){ | 129 | if (count < 2){ |
130 | qDebug("Erorr less than 2 parameter"); | 130 | odebug << "Erorr less than 2 parameter" << oendl; |
131 | qDebug("RETURNING"); | 131 | odebug << "RETURNING" << oendl; |
132 | return; | 132 | return; |
133 | } | 133 | } |
134 | 134 | ||
135 | QDataStream stream(arg,IO_ReadOnly); | 135 | QDataStream stream(arg,IO_ReadOnly); |
136 | QString interface; | 136 | QString interface; |
137 | QString action; | 137 | QString action; |
138 | int countMsgs = 0; | 138 | int countMsgs = 0; |
139 | stream >> interface; | 139 | stream >> interface; |
140 | qDebug("got count? >%s<",interface.latin1()); | 140 | odebug << "got count? >" << interface.latin1() << "<" << oendl; |
141 | if (interface == "count"){ | 141 | if (interface == "count"){ |
142 | qDebug("got count"); | 142 | odebug << "got count" << oendl; |
143 | stream >> action; | 143 | stream >> action; |
144 | qDebug("Got count num >%s<", action.latin1()); | 144 | odebug << "Got count num >" << action.latin1() << "<" << oendl; |
145 | countMsgs = action.toInt(); | 145 | countMsgs = action.toInt(); |
146 | } | 146 | } |
147 | 147 | ||
148 | QDialog *toShow; | 148 | QDialog *toShow; |
149 | //while (! stream.atEnd() ){ | 149 | //while (! stream.atEnd() ){ |
150 | for (int i = 0; i < countMsgs; i++){ | 150 | for (int i = 0; i < countMsgs; i++){ |
151 | qDebug("start stream %d/%d",i,countMsgs); | 151 | odebug << "start stream " << i << "/" << countMsgs << "" << oendl; |
152 | if (stream.atEnd()){ | 152 | if (stream.atEnd()){ |
153 | qDebug("end of stream"); | 153 | odebug << "end of stream" << oendl; |
154 | return; | 154 | return; |
155 | } | 155 | } |
156 | stream >> interface; | 156 | stream >> interface; |
157 | qDebug("got iface"); | 157 | odebug << "got iface" << oendl; |
158 | stream >> action; | 158 | stream >> action; |
159 | qDebug("WLANModule got interface %s and acion %s", interface.latin1(), action.latin1()); | 159 | odebug << "WLANModule got interface " << interface.latin1() << " and acion " << action.latin1() << "" << oendl; |
160 | // find interfaces | 160 | // find interfaces |
161 | Interface *ifa=0; | 161 | Interface *ifa=0; |
162 | for ( Interface *i=list.first(); i != 0; i=list.next() ){ | 162 | for ( Interface *i=list.first(); i != 0; i=list.next() ){ |
163 | if (i->getInterfaceName() == interface){ | 163 | if (i->getInterfaceName() == interface){ |
164 | qDebug("WLANModule found interface %s",interface.latin1()); | 164 | odebug << "WLANModule found interface " << interface.latin1() << "" << oendl; |
165 | ifa = i; | 165 | ifa = i; |
166 | } | 166 | } |
167 | } | 167 | } |
168 | 168 | ||
169 | if (ifa == 0){ | 169 | if (ifa == 0){ |
170 | qDebug("WLANModule Did not find %s",interface.latin1()); | 170 | odebug << "WLANModule Did not find " << interface.latin1() << "" << oendl; |
171 | qDebug("skipping"); | 171 | odebug << "skipping" << oendl; |
172 | count = 0; | 172 | count = 0; |
173 | } | 173 | } |
174 | 174 | ||
175 | if (count == 2){ | 175 | if (count == 2){ |
176 | // those should call the interface directly | 176 | // those should call the interface directly |
177 | QWidget *info = getInfo( ifa ); | 177 | QWidget *info = getInfo( ifa ); |
@@ -192,15 +192,15 @@ void WLANModule::receive(const QCString ¶m, const QByteArray &arg) | |||
192 | //FIXME: what if it got closed meanwhile? | 192 | //FIXME: what if it got closed meanwhile? |
193 | wlanconfigWiget = (WLANImp*) configure(ifa); | 193 | wlanconfigWiget = (WLANImp*) configure(ifa); |
194 | toShow = (QDialog*) wlanconfigWiget; | 194 | toShow = (QDialog*) wlanconfigWiget; |
195 | } | 195 | } |
196 | QPEApplication::showWidget( wlanconfigWiget ); | 196 | QPEApplication::showWidget( wlanconfigWiget ); |
197 | stream >> value; | 197 | stream >> value; |
198 | qDebug("WLANModule (build 4) is setting %s of %s to %s", action.latin1(), interface.latin1(), value.latin1() ); | 198 | odebug << "WLANModule (build 4) is setting " << action.latin1() << " of " << interface.latin1() << " to " << value.latin1() << "" << oendl; |
199 | if (value.isEmpty()){ | 199 | if (value.isEmpty()){ |
200 | qDebug("value is empty!!!\nreturning"); | 200 | odebug << "value is empty!!!\nreturning" << oendl; |
201 | return; | 201 | return; |
202 | } | 202 | } |
203 | if ( action.contains("ESSID") ){ | 203 | if ( action.contains("ESSID") ){ |
204 | QComboBox *combo = wlanconfigWiget->essid; | 204 | QComboBox *combo = wlanconfigWiget->essid; |
205 | bool found = false; | 205 | bool found = false; |
206 | for ( int i = 0; i < combo->count(); i++) | 206 | for ( int i = 0; i < combo->count(); i++) |
@@ -215,41 +215,41 @@ void WLANModule::receive(const QCString ¶m, const QByteArray &arg) | |||
215 | if ( combo->text( i ) == value ){ | 215 | if ( combo->text( i ) == value ){ |
216 | combo->setCurrentItem( i ); | 216 | combo->setCurrentItem( i ); |
217 | } | 217 | } |
218 | 218 | ||
219 | }else if (action.contains("Channel")){ | 219 | }else if (action.contains("Channel")){ |
220 | bool ok; | 220 | bool ok; |
221 | qDebug("converting channel"); | 221 | odebug << "converting channel" << oendl; |
222 | int chan = value.toInt( &ok ); | 222 | int chan = value.toInt( &ok ); |
223 | if (ok){ | 223 | if (ok){ |
224 | qDebug("ok setting channel"); | 224 | odebug << "ok setting channel" << oendl; |
225 | wlanconfigWiget->specifyChan->setChecked( true ); | 225 | wlanconfigWiget->specifyChan->setChecked( true ); |
226 | wlanconfigWiget->networkChannel->setValue( chan ); | 226 | wlanconfigWiget->networkChannel->setValue( chan ); |
227 | } | 227 | } |
228 | }else if (action.contains("MacAddr")){ | 228 | }else if (action.contains("MacAddr")){ |
229 | wlanconfigWiget->specifyAp->setChecked( true ); | 229 | wlanconfigWiget->specifyAp->setChecked( true ); |
230 | wlanconfigWiget->macEdit->setText( value ); | 230 | wlanconfigWiget->macEdit->setText( value ); |
231 | }else | 231 | }else |
232 | qDebug("wlan plugin has no clue"); | 232 | odebug << "wlan plugin has no clue" << oendl; |
233 | } | 233 | } |
234 | qDebug("next stream"); | 234 | odebug << "next stream" << oendl; |
235 | }// while stream | 235 | }// while stream |
236 | qDebug("end of stream"); | 236 | odebug << "end of stream" << oendl; |
237 | if (toShow) toShow->exec(); | 237 | if (toShow) toShow->exec(); |
238 | qDebug("returning"); | 238 | odebug << "returning" << oendl; |
239 | } | 239 | } |
240 | 240 | ||
241 | QWidget *WLANModule::getInfo( Interface *i) | 241 | QWidget *WLANModule::getInfo( Interface *i) |
242 | { | 242 | { |
243 | qDebug("WLANModule::getInfo start"); | 243 | odebug << "WLANModule::getInfo start" << oendl; |
244 | WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose); | 244 | WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose); |
245 | InterfaceInformationImp *information = new InterfaceInformationImp(info->tabWidget, "InterfaceSetupImp", i); | 245 | InterfaceInformationImp *information = new InterfaceInformationImp(info->tabWidget, "InterfaceSetupImp", i); |
246 | info->tabWidget->insertTab(information, "TCP/IP", 0); | 246 | info->tabWidget->insertTab(information, "TCP/IP", 0); |
247 | info->tabWidget->setCurrentPage( 0 ); | 247 | info->tabWidget->setCurrentPage( 0 ); |
248 | info->tabWidget->showPage( information ); | 248 | info->tabWidget->showPage( information ); |
249 | if (info->tabWidget->currentPage() == information ) qDebug("infotab OK"); | 249 | if (info->tabWidget->currentPage() == information ) odebug << "infotab OK" << oendl; |
250 | else qDebug("infotab NOT OK"); | 250 | else odebug << "infotab NOT OK" << oendl; |
251 | qDebug("current idx %d", info->tabWidget->currentPageIndex()); | 251 | odebug << "current idx " << info->tabWidget->currentPageIndex() << "" << oendl; |
252 | qDebug("WLANModule::getInfo return"); | 252 | odebug << "WLANModule::getInfo return" << oendl; |
253 | return info; | 253 | return info; |
254 | } | 254 | } |
255 | 255 | ||