Diffstat (limited to 'noncore/applets/wirelessapplet/wireless.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/applets/wirelessapplet/wireless.cpp | 59 |
1 files changed, 26 insertions, 33 deletions
diff --git a/noncore/applets/wirelessapplet/wireless.cpp b/noncore/applets/wirelessapplet/wireless.cpp index dc9742a..72ac380 100644 --- a/noncore/applets/wirelessapplet/wireless.cpp +++ b/noncore/applets/wirelessapplet/wireless.cpp | |||
@@ -13,5 +13,4 @@ | |||
13 | 13 | ||
14 | #include "wireless.h" | 14 | #include "wireless.h" |
15 | #include "networkinfo.h" | ||
16 | #include "mgraph.h" | 15 | #include "mgraph.h" |
17 | #include "advancedconfig.h" | 16 | #include "advancedconfig.h" |
@@ -52,6 +51,6 @@ | |||
52 | #define STYLE_ANTENNA 1 | 51 | #define STYLE_ANTENNA 1 |
53 | 52 | ||
54 | //#define MDEBUG | 53 | #define MDEBUG |
55 | #undef MDEBUG | 54 | //#undef MDEBUG |
56 | 55 | ||
57 | WirelessControl::WirelessControl( WirelessApplet *applet, QWidget *parent, const char *name ) | 56 | WirelessControl::WirelessControl( WirelessApplet *applet, QWidget *parent, const char *name ) |
@@ -326,30 +325,24 @@ WirelessApplet::~WirelessApplet() | |||
326 | void WirelessApplet::timerEvent( QTimerEvent* ) | 325 | void WirelessApplet::timerEvent( QTimerEvent* ) |
327 | { | 326 | { |
328 | /* | 327 | qDebug( "WirelessApplet::timerEvent" ); |
329 | |||
330 | OWirelessNetworkInterface* iface = interface; | 328 | OWirelessNetworkInterface* iface = interface; |
331 | 329 | ||
332 | if ( iface ) | 330 | if ( iface ) |
333 | { | 331 | { |
334 | bool statResult = iface->updateStatistics(); | 332 | if ( mustRepaint() ) |
335 | if ( !statResult ) | ||
336 | { | 333 | { |
337 | interface = 0; | 334 | qDebug( "WIFIAPPLET: A value has changed -> repainting." ); |
338 | mustRepaint(); | 335 | repaint(); |
339 | return ; | ||
340 | } | 336 | } |
341 | else | ||
342 | if ( mustRepaint() ) | ||
343 | { | ||
344 | //qDebug( "WIFIAPPLET: A value has changed -> repainting." ); | ||
345 | repaint(); | ||
346 | } | ||
347 | 337 | ||
348 | if ( status->isVisible() ) | 338 | if ( status->isVisible() ) |
339 | { | ||
349 | updatePopupWindow(); | 340 | updatePopupWindow(); |
341 | } | ||
342 | } | ||
343 | else | ||
344 | { | ||
345 | checkInterface(); | ||
350 | } | 346 | } |
351 | else checkInterface(); | ||
352 | |||
353 | */ | ||
354 | } | 347 | } |
355 | 348 | ||
@@ -451,6 +444,6 @@ bool WirelessApplet::mustRepaint() | |||
451 | void WirelessApplet::updatePopupWindow() | 444 | void WirelessApplet::updatePopupWindow() |
452 | { | 445 | { |
453 | MWirelessNetworkInterface * iface = ( MWirelessNetworkInterface* ) interface; | 446 | OWirelessNetworkInterface* iface = interface; |
454 | int qualityH = iface->qualityPercent(); | 447 | int qualityH = iface->signalStrength(); |
455 | 448 | ||
456 | if ( status->mgraph ) | 449 | if ( status->mgraph ) |
@@ -458,19 +451,19 @@ void WirelessApplet::updatePopupWindow() | |||
458 | 451 | ||
459 | QString freqString; | 452 | QString freqString; |
460 | QString cell = ( iface->mode == "Managed" ) ? "AP: " : "Cell: "; | 453 | QString cell = ( iface->mode() == "Managed" ) ? "AP: " : "Cell: "; |
461 | freqString.sprintf( "%.3f GHz", iface->freq ); | 454 | freqString.sprintf( "%.3f GHz", iface->frequency() ); |
462 | status->statusLabel->setText( "Station: " + iface->nick + "<br>" + | 455 | status->statusLabel->setText( "Station: " + iface->nickName() + "<br>" + |
463 | "ESSID: " + iface->essid + "<br>" + | 456 | "ESSID: " + iface->SSID() + "<br>" + |
464 | "MODE: " + iface->mode + "<br>" + | 457 | "MODE: " + iface->mode() + "<br>" + |
465 | "FREQ: " + freqString + "<br>" + | 458 | "FREQ: " + freqString + "<br>" + |
466 | cell + " " + iface->APAddr ); | 459 | cell + " " + iface->associatedAP().toString() ); |
467 | } | 460 | } |
468 | 461 | ||
469 | const char** WirelessApplet::getQualityPixmap() | 462 | const char** WirelessApplet::getQualityPixmap() |
470 | { | 463 | { |
471 | MWirelessNetworkInterface * iface = ( MWirelessNetworkInterface* ) interface; | 464 | OWirelessNetworkInterface* iface = interface; |
472 | 465 | ||
473 | if ( !iface ) return ( const char** ) nowireless_xpm; | 466 | if ( !iface ) return ( const char** ) nowireless_xpm; |
474 | int qualityH = iface->qualityPercent(); | 467 | int qualityH = iface->signalStrength(); |
475 | if ( qualityH < 0 ) return ( const char** ) nowireless_xpm; | 468 | if ( qualityH < 0 ) return ( const char** ) nowireless_xpm; |
476 | 469 | ||
@@ -490,5 +483,5 @@ const char** WirelessApplet::getQualityPixmap() | |||
490 | void WirelessApplet::paintEvent( QPaintEvent* ) | 483 | void WirelessApplet::paintEvent( QPaintEvent* ) |
491 | { | 484 | { |
492 | MWirelessNetworkInterface * iface = ( MWirelessNetworkInterface* ) interface; | 485 | OWirelessNetworkInterface* iface = interface; |
493 | 486 | ||
494 | QPainter p( this ); | 487 | QPainter p( this ); |
@@ -502,7 +495,7 @@ void WirelessApplet::paintEvent( QPaintEvent* ) | |||
502 | { | 495 | { |
503 | 496 | ||
504 | int noiseH = iface->noisePercent() * ( height() - 3 ) / 100; | 497 | int noiseH = 30; // iface->noisePercent() * ( height() - 3 ) / 100; |
505 | int signalH = iface->signalPercent() * ( height() - 3 ) / 100; | 498 | int signalH = 50; // iface->signalPercent() * ( height() - 3 ) / 100; |
506 | int qualityH = iface->qualityPercent() * ( height() - 3 ) / 100; | 499 | int qualityH = iface->signalStrength(); // iface->qualityPercent() * ( height() - 3 ) / 100; |
507 | 500 | ||
508 | double intensity; | 501 | double intensity; |