-rw-r--r-- | noncore/applets/wirelessapplet/config.in | 2 | ||||
-rw-r--r-- | noncore/applets/wirelessapplet/wireless.cpp | 50 | ||||
-rw-r--r-- | noncore/applets/wirelessapplet/wireless.h | 10 | ||||
-rw-r--r-- | noncore/applets/wirelessapplet/wirelessapplet.pro | 2 |
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 | |||
@@ -2,3 +2,3 @@ | |||
2 | boolean "opie-wirelessapplet (view wireless signal strength, and renew IP on AP change)" | 2 | boolean "opie-wirelessapplet (view wireless signal strength, and renew IP on AP change)" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE | 4 | 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 | |||
@@ -25,4 +25,5 @@ | |||
25 | 25 | ||
26 | /* OPIE */ | 26 | /* OPIE */ |
27 | #include <opie2/onetwork.h> | ||
27 | #include <opie2/otaskbarapplet.h> | 28 | #include <opie2/otaskbarapplet.h> |
28 | #include <qpe/qpeapplication.h> | 29 | #include <qpe/qpeapplication.h> |
@@ -208,10 +209,9 @@ void WirelessControl::writeConfigEntry( const char *entry, int val ) | |||
208 | WirelessApplet::WirelessApplet( QWidget *parent, const char *name ) | 209 | 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 | { |
213 | setFixedHeight( 18 ); | 214 | setFixedHeight( 18 ); |
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" ); |
217 | } | 217 | } |
@@ -219,9 +219,17 @@ WirelessApplet::WirelessApplet( QWidget *parent, const char *name ) | |||
219 | void WirelessApplet::checkInterface() | 219 | 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 ) |
223 | { | 231 | { |
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 |
227 | 235 | ||
@@ -245,5 +253,5 @@ void WirelessApplet::renewDHCP() | |||
245 | if ( !interface ) | 253 | if ( !interface ) |
246 | return ; | 254 | return ; |
247 | QString ifacename( interface->getName() ); | 255 | QString ifacename( interface->name() ); |
248 | 256 | ||
249 | // At first we are trying dhcpcd | 257 | // At first we are trying dhcpcd |
@@ -318,5 +326,7 @@ WirelessApplet::~WirelessApplet() | |||
318 | void WirelessApplet::timerEvent( QTimerEvent* ) | 326 | void WirelessApplet::timerEvent( QTimerEvent* ) |
319 | { | 327 | { |
320 | MWirelessNetworkInterface * iface = ( MWirelessNetworkInterface* ) interface; | 328 | /* |
329 | |||
330 | OWirelessNetworkInterface* iface = interface; | ||
321 | 331 | ||
322 | if ( iface ) | 332 | if ( iface ) |
@@ -340,4 +350,6 @@ void WirelessApplet::timerEvent( QTimerEvent* ) | |||
340 | } | 350 | } |
341 | else checkInterface(); | 351 | else checkInterface(); |
352 | |||
353 | */ | ||
342 | } | 354 | } |
343 | 355 | ||
@@ -352,5 +364,5 @@ void WirelessApplet::mousePressEvent( QMouseEvent * ) | |||
352 | bool WirelessApplet::mustRepaint() | 364 | bool WirelessApplet::mustRepaint() |
353 | { | 365 | { |
354 | MWirelessNetworkInterface * iface = ( MWirelessNetworkInterface* ) interface; | 366 | OWirelessNetworkInterface* iface = interface; |
355 | 367 | ||
356 | // check if there are enough changes to justify a (flickering) repaint | 368 | // check if there are enough changes to justify a (flickering) repaint |
@@ -386,7 +398,7 @@ bool WirelessApplet::mustRepaint() | |||
386 | } | 398 | } |
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 | ||
392 | if ( ( noiseH != oldnoiseH ) | 404 | if ( ( noiseH != oldnoiseH ) |
@@ -400,5 +412,5 @@ bool WirelessApplet::mustRepaint() | |||
400 | } | 412 | } |
401 | 413 | ||
402 | if ( rocESSID && ( oldESSID != iface->essid ) ) | 414 | if ( rocESSID && ( oldESSID != iface->SSID() ) ) |
403 | { | 415 | { |
404 | #ifdef MDEBUG | 416 | #ifdef MDEBUG |
@@ -407,5 +419,5 @@ bool WirelessApplet::mustRepaint() | |||
407 | renewDHCP(); | 419 | renewDHCP(); |
408 | } | 420 | } |
409 | else if ( rocFREQ && ( oldFREQ != iface->freq ) ) | 421 | else if ( rocFREQ && ( oldFREQ != iface->frequency() ) ) |
410 | { | 422 | { |
411 | #ifdef MDEBUG | 423 | #ifdef MDEBUG |
@@ -414,5 +426,5 @@ bool WirelessApplet::mustRepaint() | |||
414 | renewDHCP(); | 426 | renewDHCP(); |
415 | } | 427 | } |
416 | else if ( rocAP && ( oldAP != iface->APAddr ) ) | 428 | else if ( rocAP && ( oldAP != iface->associatedAP().toString() ) ) |
417 | { | 429 | { |
418 | #ifdef MDEBUG | 430 | #ifdef MDEBUG |
@@ -421,5 +433,5 @@ bool WirelessApplet::mustRepaint() | |||
421 | renewDHCP(); | 433 | renewDHCP(); |
422 | } | 434 | } |
423 | else if ( rocMODE && ( oldMODE != iface->mode ) ) | 435 | else if ( rocMODE && ( oldMODE != iface->mode() ) ) |
424 | { | 436 | { |
425 | #ifdef MDEBUG | 437 | #ifdef MDEBUG |
@@ -429,8 +441,8 @@ bool WirelessApplet::mustRepaint() | |||
429 | } | 441 | } |
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 | ||
436 | return false; | 448 | return false; |
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 | |||
@@ -20,8 +20,5 @@ | |||
20 | #include <qpixmap.h> | 20 | #include <qpixmap.h> |
21 | 21 | ||
22 | class MNetwork; | 22 | class OWirelessNetworkInterface; |
23 | class MWirelessNetwork; | ||
24 | class MNetworkInterface; | ||
25 | class MWirelessNetworkInterface; | ||
26 | class Y; | 23 | class Y; |
27 | class QLabel; | 24 | class QLabel; |
@@ -90,10 +87,9 @@ class WirelessApplet : public QWidget | |||
90 | int timer; | 87 | int timer; |
91 | 88 | ||
92 | MWirelessNetwork* network; | 89 | OWirelessNetworkInterface* interface; |
93 | MNetworkInterface* interface; | ||
94 | 90 | ||
95 | private: | 91 | private: |
96 | const char** oldpixmap; | 92 | const char** oldpixmap; |
97 | MWirelessNetworkInterface* oldiface; | 93 | OWirelessNetworkInterface* oldiface; |
98 | int oldqualityH; | 94 | int oldqualityH; |
99 | int oldsignalH; | 95 | int oldsignalH; |
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 | |||
@@ -8,5 +8,5 @@ DESTDIR = $(OPIEDIR)/plugins/applets | |||
8 | INCLUDEPATH += $(OPIEDIR)/include | 8 | INCLUDEPATH += $(OPIEDIR)/include |
9 | DEPENDPATH += $(OPIEDIR)/include | 9 | DEPENDPATH += $(OPIEDIR)/include |
10 | LIBS += -lqpe | 10 | LIBS += -lqpe -lopiecore2 -lopienet2 |
11 | VERSION = 0.1.1 | 11 | VERSION = 0.1.1 |
12 | 12 | ||