summaryrefslogtreecommitdiff
path: root/noncore/applets/wirelessapplet/wireless.cpp
Unidiff
Diffstat (limited to 'noncore/applets/wirelessapplet/wireless.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/applets/wirelessapplet/wireless.cpp55
1 files changed, 24 insertions, 31 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
@@ -12,7 +12,6 @@
12**********************************************************************/ 12**********************************************************************/
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"
18#include "connect0.xpm" 17#include "connect0.xpm"
@@ -51,8 +50,8 @@
51#define STYLE_BARS 0 50#define STYLE_BARS 0
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
57WirelessControl::WirelessControl( WirelessApplet *applet, QWidget *parent, const char *name ) 56WirelessControl::WirelessControl( WirelessApplet *applet, QWidget *parent, const char *name )
58 : QFrame( parent, name, WStyle_StaysOnTop | WType_Popup ), applet( applet ) 57 : QFrame( parent, name, WStyle_StaysOnTop | WType_Popup ), applet( applet )
@@ -325,32 +324,26 @@ WirelessApplet::~WirelessApplet()
325 324
326void WirelessApplet::timerEvent( QTimerEvent* ) 325void 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();
335 if ( !statResult )
336 {
337 interface = 0;
338 mustRepaint();
339 return ;
340 }
341 else
342 if ( mustRepaint() ) 332 if ( mustRepaint() )
343 { 333 {
344 //qDebug( "WIFIAPPLET: A value has changed -> repainting." ); 334 qDebug( "WIFIAPPLET: A value has changed -> repainting." );
345 repaint(); 335 repaint();
346 } 336 }
347 337
348 if ( status->isVisible() ) 338 if ( status->isVisible() )
339 {
349 updatePopupWindow(); 340 updatePopupWindow();
350 } 341 }
351 else checkInterface(); 342 }
352 343 else
353 */ 344 {
345 checkInterface();
346 }
354} 347}
355 348
356void WirelessApplet::mousePressEvent( QMouseEvent * ) 349void WirelessApplet::mousePressEvent( QMouseEvent * )
@@ -450,28 +443,28 @@ bool WirelessApplet::mustRepaint()
450 443
451void WirelessApplet::updatePopupWindow() 444void 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 )
457 status->mgraph->addValue( qualityH, false ); 450 status->mgraph->addValue( qualityH, false );
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
469const char** WirelessApplet::getQualityPixmap() 462const 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
477 if ( visualStyle == STYLE_ANTENNA ) 470 if ( visualStyle == STYLE_ANTENNA )
@@ -489,7 +482,7 @@ const char** WirelessApplet::getQualityPixmap()
489 482
490void WirelessApplet::paintEvent( QPaintEvent* ) 483void WirelessApplet::paintEvent( QPaintEvent* )
491{ 484{
492 MWirelessNetworkInterface * iface = ( MWirelessNetworkInterface* ) interface; 485 OWirelessNetworkInterface* iface = interface;
493 486
494 QPainter p( this ); 487 QPainter p( this );
495 QColor color; 488 QColor color;
@@ -501,9 +494,9 @@ void WirelessApplet::paintEvent( QPaintEvent* )
501 else 494 else
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;
509 int pixelHeight; 502 int pixelHeight;