summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/wirelessapplet/config.in2
-rw-r--r--noncore/applets/wirelessapplet/wireless.cpp50
-rw-r--r--noncore/applets/wirelessapplet/wireless.h10
-rw-r--r--noncore/applets/wirelessapplet/wirelessapplet.pro2
4 files changed, 36 insertions, 28 deletions
diff --git a/noncore/applets/wirelessapplet/config.in b/noncore/applets/wirelessapplet/config.in
index 8e948a2..f4828d3 100644
--- a/noncore/applets/wirelessapplet/config.in
+++ b/noncore/applets/wirelessapplet/config.in
@@ -3,2 +3,2 @@
default "y"
- depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE
+ depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2NET
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 @@
/* OPIE */
+#include <opie2/onetwork.h>
#include <opie2/otaskbarapplet.h>
@@ -209,4 +210,4 @@ WirelessApplet::WirelessApplet( QWidget *parent, const char *name )
: QWidget( parent, name ), visualStyle( STYLE_ANTENNA ),
- timer( 0 ), interface( 0 ),
- rocESSID( false ), rocFREQ( false ), rocAP( false ), rocMODE( false )
+ timer( 0 ), interface( 0 ), oldiface( 0 ),
+ rocESSID( false ), rocFREQ( false ), rocAP( false ), rocMODE( false )
{
@@ -214,3 +215,2 @@ WirelessApplet::WirelessApplet( QWidget *parent, const char *name )
setFixedWidth( 14 );
- network = new MWirelessNetwork();
status = new WirelessControl( this, this, "wireless status" );
@@ -220,3 +220,11 @@ void WirelessApplet::checkInterface()
{
- interface = network->getFirstInterface();
+ interface = 0L;
+ ONetwork* net = ONetwork::instance();
+ ONetwork::InterfaceIterator it = net->iterator();
+
+ while ( it.current() && !it.current()->isWireless() ) ++it;
+
+ if ( it.current() && it.current()->isWireless() )
+ interface = static_cast<OWirelessNetworkInterface*>( it.current() );
+
if ( interface )
@@ -224,3 +232,3 @@ void WirelessApplet::checkInterface()
#ifdef MDEBUG
- qDebug( "WIFIAPPLET: using interface '%s'", ( const char* ) interface->getName() );
+ qDebug( "WIFIAPPLET: using interface '%s'", ( const char* ) interface->name() );
#endif
@@ -246,3 +254,3 @@ void WirelessApplet::renewDHCP()
return ;
- QString ifacename( interface->getName() );
+ QString ifacename( interface->name() );
@@ -319,3 +327,5 @@ void WirelessApplet::timerEvent( QTimerEvent* )
{
- MWirelessNetworkInterface * iface = ( MWirelessNetworkInterface* ) interface;
+ /*
+
+ OWirelessNetworkInterface* iface = interface;
@@ -341,2 +351,4 @@ void WirelessApplet::timerEvent( QTimerEvent* )
else checkInterface();
+
+ */
}
@@ -353,3 +365,3 @@ bool WirelessApplet::mustRepaint()
{
- MWirelessNetworkInterface * iface = ( MWirelessNetworkInterface* ) interface;
+ OWirelessNetworkInterface* iface = interface;
@@ -387,5 +399,5 @@ bool WirelessApplet::mustRepaint()
- int noiseH = iface->noisePercent() * ( height() - 3 ) / 100;
- int signalH = iface->signalPercent() * ( height() - 3 ) / 100;
- int qualityH = iface->qualityPercent() * ( height() - 3 ) / 100;
+ int noiseH = 50; // iface->noisePercent() * ( height() - 3 ) / 100;
+ int signalH = iface->signalStrength() * ( height() - 3 ) / 100;
+ int qualityH = 50; // iface->qualityPercent() * ( height() - 3 ) / 100;
@@ -401,3 +413,3 @@ bool WirelessApplet::mustRepaint()
- if ( rocESSID && ( oldESSID != iface->essid ) )
+ if ( rocESSID && ( oldESSID != iface->SSID() ) )
{
@@ -408,3 +420,3 @@ bool WirelessApplet::mustRepaint()
}
- else if ( rocFREQ && ( oldFREQ != iface->freq ) )
+ else if ( rocFREQ && ( oldFREQ != iface->frequency() ) )
{
@@ -415,3 +427,3 @@ bool WirelessApplet::mustRepaint()
}
- else if ( rocAP && ( oldAP != iface->APAddr ) )
+ else if ( rocAP && ( oldAP != iface->associatedAP().toString() ) )
{
@@ -422,3 +434,3 @@ bool WirelessApplet::mustRepaint()
}
- else if ( rocMODE && ( oldMODE != iface->mode ) )
+ else if ( rocMODE && ( oldMODE != iface->mode() ) )
{
@@ -430,6 +442,6 @@ bool WirelessApplet::mustRepaint()
- oldESSID = iface->essid;
- oldMODE = iface->mode;
- oldFREQ = iface->freq;
- oldAP = iface->APAddr;
+ oldESSID = iface->SSID();
+ oldMODE = iface->mode();
+ oldFREQ = iface->frequency();
+ oldAP = iface->associatedAP().toString();
diff --git a/noncore/applets/wirelessapplet/wireless.h b/noncore/applets/wirelessapplet/wireless.h
index 644be26..27f8c90 100644
--- a/noncore/applets/wirelessapplet/wireless.h
+++ b/noncore/applets/wirelessapplet/wireless.h
@@ -21,6 +21,3 @@
-class MNetwork;
-class MWirelessNetwork;
-class MNetworkInterface;
-class MWirelessNetworkInterface;
+class OWirelessNetworkInterface;
class Y;
@@ -91,4 +88,3 @@ class WirelessApplet : public QWidget
- MWirelessNetwork* network;
- MNetworkInterface* interface;
+ OWirelessNetworkInterface* interface;
@@ -96,3 +92,3 @@ class WirelessApplet : public QWidget
const char** oldpixmap;
- MWirelessNetworkInterface* oldiface;
+ OWirelessNetworkInterface* oldiface;
int oldqualityH;
diff --git a/noncore/applets/wirelessapplet/wirelessapplet.pro b/noncore/applets/wirelessapplet/wirelessapplet.pro
index 38cb475..7bd7380 100644
--- a/noncore/applets/wirelessapplet/wirelessapplet.pro
+++ b/noncore/applets/wirelessapplet/wirelessapplet.pro
@@ -9,3 +9,3 @@ INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
-LIBS += -lqpe
+LIBS += -lqpe -lopiecore2 -lopienet2
VERSION = 0.1.1