summaryrefslogtreecommitdiff
path: root/noncore/applets/wirelessapplet/wireless.cpp
Side-by-side diff
Diffstat (limited to 'noncore/applets/wirelessapplet/wireless.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/wirelessapplet/wireless.cpp59
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 @@
#include "wireless.h"
-#include "networkinfo.h"
#include "mgraph.h"
#include "advancedconfig.h"
@@ -52,6 +51,6 @@
#define STYLE_ANTENNA 1
-//#define MDEBUG
-#undef MDEBUG
+#define MDEBUG
+//#undef MDEBUG
WirelessControl::WirelessControl( WirelessApplet *applet, QWidget *parent, const char *name )
@@ -326,30 +325,24 @@ WirelessApplet::~WirelessApplet()
void WirelessApplet::timerEvent( QTimerEvent* )
{
- /*
-
+ qDebug( "WirelessApplet::timerEvent" );
OWirelessNetworkInterface* iface = interface;
if ( iface )
{
- bool statResult = iface->updateStatistics();
- if ( !statResult )
+ if ( mustRepaint() )
{
- interface = 0;
- mustRepaint();
- return ;
+ qDebug( "WIFIAPPLET: A value has changed -> repainting." );
+ repaint();
}
- else
- if ( mustRepaint() )
- {
- //qDebug( "WIFIAPPLET: A value has changed -> repainting." );
- repaint();
- }
if ( status->isVisible() )
+ {
updatePopupWindow();
+ }
+ }
+ else
+ {
+ checkInterface();
}
- else checkInterface();
-
- */
}
@@ -451,6 +444,6 @@ bool WirelessApplet::mustRepaint()
void WirelessApplet::updatePopupWindow()
{
- MWirelessNetworkInterface * iface = ( MWirelessNetworkInterface* ) interface;
- int qualityH = iface->qualityPercent();
+ OWirelessNetworkInterface* iface = interface;
+ int qualityH = iface->signalStrength();
if ( status->mgraph )
@@ -458,19 +451,19 @@ void WirelessApplet::updatePopupWindow()
QString freqString;
- QString cell = ( iface->mode == "Managed" ) ? "AP: " : "Cell: ";
- freqString.sprintf( "%.3f GHz", iface->freq );
- status->statusLabel->setText( "Station: " + iface->nick + "<br>" +
- "ESSID: " + iface->essid + "<br>" +
- "MODE: " + iface->mode + "<br>" +
+ QString cell = ( iface->mode() == "Managed" ) ? "AP: " : "Cell: ";
+ freqString.sprintf( "%.3f GHz", iface->frequency() );
+ status->statusLabel->setText( "Station: " + iface->nickName() + "<br>" +
+ "ESSID: " + iface->SSID() + "<br>" +
+ "MODE: " + iface->mode() + "<br>" +
"FREQ: " + freqString + "<br>" +
- cell + " " + iface->APAddr );
+ cell + " " + iface->associatedAP().toString() );
}
const char** WirelessApplet::getQualityPixmap()
{
- MWirelessNetworkInterface * iface = ( MWirelessNetworkInterface* ) interface;
+ OWirelessNetworkInterface* iface = interface;
if ( !iface ) return ( const char** ) nowireless_xpm;
- int qualityH = iface->qualityPercent();
+ int qualityH = iface->signalStrength();
if ( qualityH < 0 ) return ( const char** ) nowireless_xpm;
@@ -490,5 +483,5 @@ const char** WirelessApplet::getQualityPixmap()
void WirelessApplet::paintEvent( QPaintEvent* )
{
- MWirelessNetworkInterface * iface = ( MWirelessNetworkInterface* ) interface;
+ OWirelessNetworkInterface* iface = interface;
QPainter p( this );
@@ -502,7 +495,7 @@ void WirelessApplet::paintEvent( QPaintEvent* )
{
- int noiseH = iface->noisePercent() * ( height() - 3 ) / 100;
- int signalH = iface->signalPercent() * ( height() - 3 ) / 100;
- int qualityH = iface->qualityPercent() * ( height() - 3 ) / 100;
+ int noiseH = 30; // iface->noisePercent() * ( height() - 3 ) / 100;
+ int signalH = 50; // iface->signalPercent() * ( height() - 3 ) / 100;
+ int qualityH = iface->signalStrength(); // iface->qualityPercent() * ( height() - 3 ) / 100;
double intensity;