summaryrefslogtreecommitdiff
path: root/noncore/applets/wirelessapplet/wireless.cpp
Unidiff
Diffstat (limited to 'noncore/applets/wirelessapplet/wireless.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/wirelessapplet/wireless.cpp50
1 files changed, 31 insertions, 19 deletions
diff --git a/noncore/applets/wirelessapplet/wireless.cpp b/noncore/applets/wirelessapplet/wireless.cpp
index cbaf5d6..dc9742a 100644
--- a/noncore/applets/wirelessapplet/wireless.cpp
+++ b/noncore/applets/wirelessapplet/wireless.cpp
@@ -26,2 +26,3 @@
26/* OPIE */ 26/* OPIE */
27#include <opie2/onetwork.h>
27#include <opie2/otaskbarapplet.h> 28#include <opie2/otaskbarapplet.h>
@@ -209,4 +210,4 @@ WirelessApplet::WirelessApplet( QWidget *parent, const char *name )
209 : QWidget( parent, name ), visualStyle( STYLE_ANTENNA ), 210 : QWidget( parent, name ), visualStyle( STYLE_ANTENNA ),
210 timer( 0 ), interface( 0 ), 211 timer( 0 ), interface( 0 ), oldiface( 0 ),
211 rocESSID( false ), rocFREQ( false ), rocAP( false ), rocMODE( false ) 212 rocESSID( false ), rocFREQ( false ), rocAP( false ), rocMODE( false )
212{ 213{
@@ -214,3 +215,2 @@ WirelessApplet::WirelessApplet( QWidget *parent, const char *name )
214 setFixedWidth( 14 ); 215 setFixedWidth( 14 );
215 network = new MWirelessNetwork();
216 status = new WirelessControl( this, this, "wireless status" ); 216 status = new WirelessControl( this, this, "wireless status" );
@@ -220,3 +220,11 @@ void WirelessApplet::checkInterface()
220{ 220{
221 interface = network->getFirstInterface(); 221 interface = 0L;
222 ONetwork* net = ONetwork::instance();
223 ONetwork::InterfaceIterator it = net->iterator();
224
225 while ( it.current() && !it.current()->isWireless() ) ++it;
226
227 if ( it.current() && it.current()->isWireless() )
228 interface = static_cast<OWirelessNetworkInterface*>( it.current() );
229
222 if ( interface ) 230 if ( interface )
@@ -224,3 +232,3 @@ void WirelessApplet::checkInterface()
224#ifdef MDEBUG 232#ifdef MDEBUG
225 qDebug( "WIFIAPPLET: using interface '%s'", ( const char* ) interface->getName() ); 233 qDebug( "WIFIAPPLET: using interface '%s'", ( const char* ) interface->name() );
226#endif 234#endif
@@ -246,3 +254,3 @@ void WirelessApplet::renewDHCP()
246 return ; 254 return ;
247 QString ifacename( interface->getName() ); 255 QString ifacename( interface->name() );
248 256
@@ -319,3 +327,5 @@ void WirelessApplet::timerEvent( QTimerEvent* )
319{ 327{
320 MWirelessNetworkInterface * iface = ( MWirelessNetworkInterface* ) interface; 328 /*
329
330 OWirelessNetworkInterface* iface = interface;
321 331
@@ -341,2 +351,4 @@ void WirelessApplet::timerEvent( QTimerEvent* )
341 else checkInterface(); 351 else checkInterface();
352
353 */
342} 354}
@@ -353,3 +365,3 @@ bool WirelessApplet::mustRepaint()
353{ 365{
354 MWirelessNetworkInterface * iface = ( MWirelessNetworkInterface* ) interface; 366 OWirelessNetworkInterface* iface = interface;
355 367
@@ -387,5 +399,5 @@ bool WirelessApplet::mustRepaint()
387 399
388 int noiseH = iface->noisePercent() * ( height() - 3 ) / 100; 400 int noiseH = 50; // iface->noisePercent() * ( height() - 3 ) / 100;
389 int signalH = iface->signalPercent() * ( height() - 3 ) / 100; 401 int signalH = iface->signalStrength() * ( height() - 3 ) / 100;
390 int qualityH = iface->qualityPercent() * ( height() - 3 ) / 100; 402 int qualityH = 50; // iface->qualityPercent() * ( height() - 3 ) / 100;
391 403
@@ -401,3 +413,3 @@ bool WirelessApplet::mustRepaint()
401 413
402 if ( rocESSID && ( oldESSID != iface->essid ) ) 414 if ( rocESSID && ( oldESSID != iface->SSID() ) )
403 { 415 {
@@ -408,3 +420,3 @@ bool WirelessApplet::mustRepaint()
408 } 420 }
409 else if ( rocFREQ && ( oldFREQ != iface->freq ) ) 421 else if ( rocFREQ && ( oldFREQ != iface->frequency() ) )
410 { 422 {
@@ -415,3 +427,3 @@ bool WirelessApplet::mustRepaint()
415 } 427 }
416 else if ( rocAP && ( oldAP != iface->APAddr ) ) 428 else if ( rocAP && ( oldAP != iface->associatedAP().toString() ) )
417 { 429 {
@@ -422,3 +434,3 @@ bool WirelessApplet::mustRepaint()
422 } 434 }
423 else if ( rocMODE && ( oldMODE != iface->mode ) ) 435 else if ( rocMODE && ( oldMODE != iface->mode() ) )
424 { 436 {
@@ -430,6 +442,6 @@ bool WirelessApplet::mustRepaint()
430 442
431 oldESSID = iface->essid; 443 oldESSID = iface->SSID();
432 oldMODE = iface->mode; 444 oldMODE = iface->mode();
433 oldFREQ = iface->freq; 445 oldFREQ = iface->frequency();
434 oldAP = iface->APAddr; 446 oldAP = iface->associatedAP().toString();
435 447