summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/wirelessapplet/wireless.cpp211
-rw-r--r--noncore/applets/wirelessapplet/wireless.h33
-rw-r--r--noncore/applets/wirelessapplet/wirelessapplet.pro8
-rw-r--r--noncore/applets/wirelessapplet/wirelessappletimpl.cpp66
-rw-r--r--noncore/applets/wirelessapplet/wirelessappletimpl.h43
5 files changed, 133 insertions, 228 deletions
diff --git a/noncore/applets/wirelessapplet/wireless.cpp b/noncore/applets/wirelessapplet/wireless.cpp
index 763aab8..cbaf5d6 100644
--- a/noncore/applets/wirelessapplet/wireless.cpp
+++ b/noncore/applets/wirelessapplet/wireless.cpp
@@ -1,5 +1,3 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2002 Michael 'Mickey' Lauer 2** Copyright (C) 2002-2004 Michael 'Mickey' Lauer <mickey@vanille.de>
3** <mickey@tm.informatik.uni-frankfurt.de>
4** http://www.Vanille.de
5** 3**
@@ -16,4 +14,15 @@
16#include "wireless.h" 14#include "wireless.h"
15#include "networkinfo.h"
16#include "mgraph.h"
17#include "advancedconfig.h"
18#include "connect0.xpm"
19#include "connect1.xpm"
20#include "connect2.xpm"
21#include "connect3.xpm"
22#include "connect4.xpm"
23#include "connect5.xpm"
24#include "nowireless.xpm"
17 25
18#include <qapplication.h> 26/* OPIE */
27#include <opie2/otaskbarapplet.h>
19#include <qpe/qpeapplication.h> 28#include <qpe/qpeapplication.h>
@@ -21,2 +30,3 @@
21 30
31/* QT */
22#include <qpoint.h> 32#include <qpoint.h>
@@ -35,2 +45,3 @@
35 45
46/* STD */
36#include <sys/types.h> 47#include <sys/types.h>
@@ -38,15 +49,2 @@
38 49
39#include "networkinfo.h"
40#include "mgraph.h"
41
42#include "advancedconfig.h"
43
44#include "connect0.xpm"
45#include "connect1.xpm"
46#include "connect2.xpm"
47#include "connect3.xpm"
48#include "connect4.xpm"
49#include "connect5.xpm"
50#include "nowireless.xpm"
51
52#define STYLE_BARS 0 50#define STYLE_BARS 0
@@ -58,3 +56,3 @@
58WirelessControl::WirelessControl( WirelessApplet *applet, QWidget *parent, const char *name ) 56WirelessControl::WirelessControl( WirelessApplet *applet, QWidget *parent, const char *name )
59 : QFrame( parent, name, WStyle_StaysOnTop | WType_Popup ), applet( applet ) 57 : QFrame( parent, name, WStyle_StaysOnTop | WType_Popup ), applet( applet )
60{ 58{
@@ -72,11 +70,11 @@ WirelessControl::WirelessControl( WirelessApplet *applet, QWidget *parent, const
72 QString text( "Wireless Status:<br>" 70 QString text( "Wireless Status:<br>"
73 "*** Unknown ***<br>" 71 "*** Unknown ***<br>"
74 "Card not inserted ?<br>" 72 "Card not inserted ?<br>"
75 "Or Sharp ROM ?<br>" 73 "Or Sharp ROM ?<br>"
76 "CELL: 00:00:00:00:00:00" ); 74 "CELL: 00:00:00:00:00:00" );
77/* QString text( "Station: Unknown<br>" 75 /* QString text( "Station: Unknown<br>"
78 "ESSID: Unknown<br>" 76 "ESSID: Unknown<br>"
79 "MODE: Unknown<br>" 77 "MODE: Unknown<br>"
80 "FREQ: Unknown<br>" 78 "FREQ: Unknown<br>"
81 "CELL: AA:BB:CC:DD:EE:FF" ); */ 79 "CELL: AA:BB:CC:DD:EE:FF" ); */
82 statusLabel->setText( text ); 80 statusLabel->setText( text );
@@ -138,6 +136,6 @@ WirelessControl::WirelessControl( WirelessApplet *applet, QWidget *parent, const
138 applet->updateDelayChange( updateFrequency ); 136 applet->updateDelayChange( updateFrequency );
139 137
140 connect( group, SIGNAL( clicked( int ) ), 138 connect( group, SIGNAL( clicked( int ) ),
141 this, SLOT( displayStyleChange( int ) ) ); 139 this, SLOT( displayStyleChange( int ) ) );
142 140
143 applet->updateDHCPConfig( rocESSID, rocFREQ, rocAP, rocMODE ); 141 applet->updateDHCPConfig( rocESSID, rocFREQ, rocAP, rocMODE );
@@ -147,3 +145,3 @@ void WirelessControl::advancedConfigClicked()
147{ 145{
148 AdvancedConfig* a = new AdvancedConfig( this, "dialog", TRUE ); 146 AdvancedConfig * a = new AdvancedConfig( this, "dialog", TRUE );
149 int result = a->exec(); 147 int result = a->exec();
@@ -175,12 +173,12 @@ void WirelessControl::show ( bool )
175{ 173{
176 QPoint curPos = applet->mapToGlobal( QPoint ( 0, 0 ) ); 174 QPoint curPos = applet->mapToGlobal( QPoint ( 0, 0 ) );
177 175
178 int w = sizeHint().width(); 176 int w = sizeHint().width();
179 int x = curPos.x() - ( w / 2 ); 177 int x = curPos.x() - ( w / 2 );
180 178
181 if ( ( x + w ) > QPEApplication::desktop()->width() ) 179 if ( ( x + w ) > QPEApplication::desktop() ->width() )
182 x = QPEApplication::desktop ( )-> width ( ) - w; 180 x = QPEApplication::desktop ( ) -> width ( ) - w;
183 181
184 move( x, curPos.y () - sizeHint().height () ); 182 move( x, curPos.y () - sizeHint().height () );
185 QFrame::show(); 183 QFrame::show();
186} 184}
@@ -191,3 +189,3 @@ void WirelessControl::readConfig()
191 cfg.setGroup( "Wireless" ); 189 cfg.setGroup( "Wireless" );
192 190
193 updateFrequency = cfg.readNumEntry( "UpdateFrequency", 2 ); 191 updateFrequency = cfg.readNumEntry( "UpdateFrequency", 2 );
@@ -206,3 +204,3 @@ void WirelessControl::writeConfigEntry( const char *entry, int val )
206} 204}
207 205
208//=========================================================================== 206//===========================================================================
@@ -210,5 +208,5 @@ void WirelessControl::writeConfigEntry( const char *entry, int val )
210WirelessApplet::WirelessApplet( QWidget *parent, const char *name ) 208WirelessApplet::WirelessApplet( QWidget *parent, const char *name )
211 : QWidget( parent, name ), visualStyle( STYLE_ANTENNA ), 209 : QWidget( parent, name ), visualStyle( STYLE_ANTENNA ),
212 timer( 0 ), interface( 0 ), 210 timer( 0 ), interface( 0 ),
213 rocESSID( false ), rocFREQ( false ), rocAP( false ), rocMODE( false ) 211 rocESSID( false ), rocFREQ( false ), rocAP( false ), rocMODE( false )
214{ 212{
@@ -226,4 +224,5 @@ void WirelessApplet::checkInterface()
226#ifdef MDEBUG 224#ifdef MDEBUG
227 qDebug( "WIFIAPPLET: using interface '%s'", (const char*) interface->getName() ); 225 qDebug( "WIFIAPPLET: using interface '%s'", ( const char* ) interface->getName() );
228#endif 226#endif
227
229 } 228 }
@@ -246,3 +245,3 @@ void WirelessApplet::renewDHCP()
246 if ( !interface ) 245 if ( !interface )
247 return; 246 return ;
248 QString ifacename( interface->getName() ); 247 QString ifacename( interface->getName() );
@@ -251,5 +250,5 @@ void WirelessApplet::renewDHCP()
251 250
252 pidfile.sprintf( "/var/run/dhcpcd-%s.pid", (const char* ) ifacename ); 251 pidfile.sprintf( "/var/run/dhcpcd-%s.pid", ( const char* ) ifacename );
253#ifdef MDEBUG 252#ifdef MDEBUG
254 qDebug( "WIFIAPPLET: dhcpcd pidfile is '%s'", (const char*) pidfile ); 253 qDebug( "WIFIAPPLET: dhcpcd pidfile is '%s'", ( const char* ) pidfile );
255#endif 254#endif
@@ -266,3 +265,3 @@ void WirelessApplet::renewDHCP()
266 kill( pid, SIGALRM ); 265 kill( pid, SIGALRM );
267 return; 266 return ;
268 } 267 }
@@ -273,5 +272,5 @@ void WirelessApplet::renewDHCP()
273#endif 272#endif
274 pidfile.sprintf( "/var/run/udhcpc.%s.pid", (const char*) ifacename ); 273 pidfile.sprintf( "/var/run/udhcpc.%s.pid", ( const char* ) ifacename );
275#ifdef MDEBUG 274#ifdef MDEBUG
276 qDebug( "WIFIAPPLET: udhcpc pidfile is '%s'", (const char*) pidfile ); 275 qDebug( "WIFIAPPLET: udhcpc pidfile is '%s'", ( const char* ) pidfile );
277#endif 276#endif
@@ -287,3 +286,3 @@ void WirelessApplet::renewDHCP()
287 kill( pid, SIGUSR1 ); 286 kill( pid, SIGUSR1 );
288 return; 287 return ;
289 } 288 }
@@ -316,4 +315,3 @@ void WirelessApplet::displayStyleChange( int style )
316WirelessApplet::~WirelessApplet() 315WirelessApplet::~WirelessApplet()
317{ 316{}
318}
319 317
@@ -321,4 +319,4 @@ void WirelessApplet::timerEvent( QTimerEvent* )
321{ 319{
322 MWirelessNetworkInterface* iface = ( MWirelessNetworkInterface* ) interface; 320 MWirelessNetworkInterface * iface = ( MWirelessNetworkInterface* ) interface;
323 321
324 if ( iface ) 322 if ( iface )
@@ -330,19 +328,21 @@ void WirelessApplet::timerEvent( QTimerEvent* )
330 mustRepaint(); 328 mustRepaint();
331 return; 329 return ;
332 } else
333 if ( mustRepaint() )
334 {
335 //qDebug( "WIFIAPPLET: A value has changed -> repainting." );
336 repaint();
337 } 330 }
338 331 else
332 if ( mustRepaint() )
333 {
334 //qDebug( "WIFIAPPLET: A value has changed -> repainting." );
335 repaint();
336 }
337
339 if ( status->isVisible() ) 338 if ( status->isVisible() )
340 updatePopupWindow(); 339 updatePopupWindow();
341 } else checkInterface(); 340 }
341 else checkInterface();
342} 342}
343 343
344void WirelessApplet::mousePressEvent( QMouseEvent *) 344void WirelessApplet::mousePressEvent( QMouseEvent * )
345{ 345{
346 if ( status->isVisible() ) 346 if ( status->isVisible() )
347 status->hide(); 347 status->hide();
348 else 348 else
@@ -353,8 +353,8 @@ bool WirelessApplet::mustRepaint()
353{ 353{
354 MWirelessNetworkInterface* iface = ( MWirelessNetworkInterface* ) interface; 354 MWirelessNetworkInterface * iface = ( MWirelessNetworkInterface* ) interface;
355 355
356 // check if there are enough changes to justify a (flickering) repaint 356 // check if there are enough changes to justify a (flickering) repaint
357 357
358 // has the interface changed? 358 // has the interface changed?
359 359
360 if ( iface != oldiface ) 360 if ( iface != oldiface )
@@ -378,5 +378,5 @@ bool WirelessApplet::mustRepaint()
378 } 378 }
379 379
380 const char** pixmap = getQualityPixmap(); 380 const char** pixmap = getQualityPixmap();
381 381
382 if ( pixmap && ( pixmap != oldpixmap ) ) 382 if ( pixmap && ( pixmap != oldpixmap ) )
@@ -386,3 +386,3 @@ bool WirelessApplet::mustRepaint()
386 } 386 }
387 387
388 int noiseH = iface->noisePercent() * ( height() - 3 ) / 100; 388 int noiseH = iface->noisePercent() * ( height() - 3 ) / 100;
@@ -390,6 +390,6 @@ bool WirelessApplet::mustRepaint()
390 int qualityH = iface->qualityPercent() * ( height() - 3 ) / 100; 390 int qualityH = iface->qualityPercent() * ( height() - 3 ) / 100;
391 391
392 if ( ( noiseH != oldnoiseH ) 392 if ( ( noiseH != oldnoiseH )
393 || ( signalH != oldsignalH ) 393 || ( signalH != oldsignalH )
394 || ( qualityH != oldqualityH ) ) 394 || ( qualityH != oldqualityH ) )
395 { 395 {
@@ -404,3 +404,3 @@ bool WirelessApplet::mustRepaint()
404#ifdef MDEBUG 404#ifdef MDEBUG
405 qDebug( "WIFIAPPLET: ESSID has changed."); 405 qDebug( "WIFIAPPLET: ESSID has changed." );
406#endif 406#endif
@@ -411,3 +411,3 @@ bool WirelessApplet::mustRepaint()
411#ifdef MDEBUG 411#ifdef MDEBUG
412 qDebug( "WIFIAPPLET: FREQ has changed."); 412 qDebug( "WIFIAPPLET: FREQ has changed." );
413#endif 413#endif
@@ -418,3 +418,3 @@ bool WirelessApplet::mustRepaint()
418#ifdef MDEBUG 418#ifdef MDEBUG
419 qDebug( "WIFIAPPLET: AP has changed."); 419 qDebug( "WIFIAPPLET: AP has changed." );
420#endif 420#endif
@@ -425,3 +425,3 @@ bool WirelessApplet::mustRepaint()
425#ifdef MDEBUG 425#ifdef MDEBUG
426 qDebug( "WIFIAPPLET: MODE has changed."); 426 qDebug( "WIFIAPPLET: MODE has changed." );
427#endif 427#endif
@@ -429,3 +429,3 @@ bool WirelessApplet::mustRepaint()
429 } 429 }
430 430
431 oldESSID = iface->essid; 431 oldESSID = iface->essid;
@@ -434,3 +434,3 @@ bool WirelessApplet::mustRepaint()
434 oldAP = iface->APAddr; 434 oldAP = iface->APAddr;
435 435
436 return false; 436 return false;
@@ -440,3 +440,3 @@ void WirelessApplet::updatePopupWindow()
440{ 440{
441 MWirelessNetworkInterface* iface = ( MWirelessNetworkInterface* ) interface; 441 MWirelessNetworkInterface * iface = ( MWirelessNetworkInterface* ) interface;
442 int qualityH = iface->qualityPercent(); 442 int qualityH = iface->qualityPercent();
@@ -445,3 +445,3 @@ void WirelessApplet::updatePopupWindow()
445 status->mgraph->addValue( qualityH, false ); 445 status->mgraph->addValue( qualityH, false );
446 446
447 QString freqString; 447 QString freqString;
@@ -454,8 +454,8 @@ void WirelessApplet::updatePopupWindow()
454 cell + " " + iface->APAddr ); 454 cell + " " + iface->APAddr );
455} 455}
456 456
457const char** WirelessApplet::getQualityPixmap() 457const char** WirelessApplet::getQualityPixmap()
458{ 458{
459 MWirelessNetworkInterface* iface = ( MWirelessNetworkInterface* ) interface; 459 MWirelessNetworkInterface * iface = ( MWirelessNetworkInterface* ) interface;
460 460
461 if ( !iface ) return ( const char** ) nowireless_xpm; 461 if ( !iface ) return ( const char** ) nowireless_xpm;
@@ -463,3 +463,3 @@ const char** WirelessApplet::getQualityPixmap()
463 if ( qualityH < 0 ) return ( const char** ) nowireless_xpm; 463 if ( qualityH < 0 ) return ( const char** ) nowireless_xpm;
464 464
465 if ( visualStyle == STYLE_ANTENNA ) 465 if ( visualStyle == STYLE_ANTENNA )
@@ -467,3 +467,3 @@ const char** WirelessApplet::getQualityPixmap()
467 if ( qualityH < 1 ) return ( const char** ) connect0_xpm; 467 if ( qualityH < 1 ) return ( const char** ) connect0_xpm;
468 if ( qualityH < 17 ) return ( const char** ) connect1_xpm; 468 if ( qualityH < 17 ) return ( const char** ) connect1_xpm;
469 if ( qualityH < 34 ) return ( const char** ) connect2_xpm; 469 if ( qualityH < 34 ) return ( const char** ) connect2_xpm;
@@ -473,3 +473,3 @@ const char** WirelessApplet::getQualityPixmap()
473 } 473 }
474 474
475 return 0; // please draw your bars 475 return 0; // please draw your bars
@@ -479,5 +479,5 @@ void WirelessApplet::paintEvent( QPaintEvent* )
479{ 479{
480 MWirelessNetworkInterface* iface = ( MWirelessNetworkInterface* ) interface; 480 MWirelessNetworkInterface * iface = ( MWirelessNetworkInterface* ) interface;
481 481
482 QPainter p(this); 482 QPainter p( this );
483 QColor color; 483 QColor color;
@@ -508,6 +508,6 @@ void WirelessApplet::paintEvent( QPaintEvent* )
508 { 508 {
509 intensity = 50 + ( (double) i / (double) pixelHeight ) * 205; 509 intensity = 50 + ( ( double ) i / ( double ) pixelHeight ) * 205;
510 color.setHsv( Hue, 255, intensity ); 510 color.setHsv( Hue, 255, intensity );
511 p.setPen ( color ); 511 p.setPen ( color );
512 p.drawLine( leftoffset, height()-bottomoffset-i, pixelWidth+leftoffset, height()-bottomoffset-i ); 512 p.drawLine( leftoffset, height() - bottomoffset - i, pixelWidth + leftoffset, height() - bottomoffset - i );
513 } 513 }
@@ -520,6 +520,6 @@ void WirelessApplet::paintEvent( QPaintEvent* )
520 { 520 {
521 intensity = 50 + ( (double) i / (double) pixelHeight ) * 205; 521 intensity = 50 + ( ( double ) i / ( double ) pixelHeight ) * 205;
522 color.setHsv( Hue, 255, intensity ); 522 color.setHsv( Hue, 255, intensity );
523 p.setPen ( color ); 523 p.setPen ( color );
524 p.drawLine( leftoffset, height()-bottomoffset-i, pixelWidth+leftoffset, height()-bottomoffset-i ); 524 p.drawLine( leftoffset, height() - bottomoffset - i, pixelWidth + leftoffset, height() - bottomoffset - i );
525 } 525 }
@@ -532,8 +532,21 @@ void WirelessApplet::paintEvent( QPaintEvent* )
532 { 532 {
533 intensity = 50 + ( (double) i / (double) pixelHeight ) * 205; 533 intensity = 50 + ( ( double ) i / ( double ) pixelHeight ) * 205;
534 color.setHsv( Hue, 255, intensity ); 534 color.setHsv( Hue, 255, intensity );
535 p.setPen ( color ); 535 p.setPen ( color );
536 p.drawLine( leftoffset, height()-bottomoffset-i, pixelWidth+leftoffset, height()-bottomoffset-i ); 536 p.drawLine( leftoffset, height() - bottomoffset - i, pixelWidth + leftoffset, height() - bottomoffset - i );
537 } 537 }
538 } 538 }
539} 539}
540
541
542int WirelessApplet::position()
543{
544 return 6;
545}
546
547
548Q_EXPORT_INTERFACE()
549{
550 Q_CREATE_INSTANCE( OTaskbarAppletWrapper<WirelessApplet> );
551}
552
diff --git a/noncore/applets/wirelessapplet/wireless.h b/noncore/applets/wirelessapplet/wireless.h
index 51a3fab..644be26 100644
--- a/noncore/applets/wirelessapplet/wireless.h
+++ b/noncore/applets/wirelessapplet/wireless.h
@@ -33,6 +33,6 @@ class WirelessControl : public QFrame
33 Q_OBJECT 33 Q_OBJECT
34public: 34 public:
35 WirelessControl( WirelessApplet* icon, QWidget *parent=0, const char *name=0 ); 35 WirelessControl( WirelessApplet* icon, QWidget *parent=0, const char *name=0 );
36 void show( bool ); 36 void show( bool );
37 37
38 void readConfig(); 38 void readConfig();
@@ -44,3 +44,3 @@ public:
44 44
45public slots: 45 public slots:
46 void updateDelayChange( int ); 46 void updateDelayChange( int );
@@ -48,4 +48,4 @@ public slots:
48 void advancedConfigClicked(); 48 void advancedConfigClicked();
49 49
50private: 50 private:
51 WirelessApplet* applet; 51 WirelessApplet* applet;
@@ -64,7 +64,8 @@ class WirelessApplet : public QWidget
64 Q_OBJECT 64 Q_OBJECT
65public: 65 public:
66 WirelessApplet( QWidget *parent = 0, const char *name=0 ); 66 WirelessApplet( QWidget *parent = 0, const char *name=0 );
67 ~WirelessApplet(); 67 ~WirelessApplet();
68 static int position();
68 WirelessControl* status; 69 WirelessControl* status;
69 70
70 virtual void timerEvent( QTimerEvent* ); 71 virtual void timerEvent( QTimerEvent* );
@@ -72,6 +73,6 @@ public:
72 void displayStyleChange( int style ); 73 void displayStyleChange( int style );
73 74
74 void updateDHCPConfig( bool, bool, bool, bool ); 75 void updateDHCPConfig( bool, bool, bool, bool );
75 76
76private: 77 private:
77 void mousePressEvent( QMouseEvent * ); 78 void mousePressEvent( QMouseEvent * );
@@ -80,3 +81,3 @@ private:
80 void renewDHCP(); 81 void renewDHCP();
81 82
82 bool mustRepaint(); 83 bool mustRepaint();
@@ -85,3 +86,3 @@ private:
85 86
86private: 87 private:
87 QPixmap snapshotPixmap; 88 QPixmap snapshotPixmap;
@@ -89,7 +90,7 @@ private:
89 int timer; 90 int timer;
90 91
91 MWirelessNetwork* network; 92 MWirelessNetwork* network;
92 MNetworkInterface* interface; 93 MNetworkInterface* interface;
93 94
94private: 95 private:
95 const char** oldpixmap; 96 const char** oldpixmap;
@@ -98,3 +99,3 @@ private:
98 int oldsignalH; 99 int oldsignalH;
99 int oldnoiseH; 100 int oldnoiseH;
100 101
@@ -104,3 +105,3 @@ private:
104 double oldFREQ; 105 double oldFREQ;
105 106
106 bool rocESSID; 107 bool rocESSID;
diff --git a/noncore/applets/wirelessapplet/wirelessapplet.pro b/noncore/applets/wirelessapplet/wirelessapplet.pro
index 411a039..38cb475 100644
--- a/noncore/applets/wirelessapplet/wirelessapplet.pro
+++ b/noncore/applets/wirelessapplet/wirelessapplet.pro
@@ -2,4 +2,4 @@ TEMPLATE = lib
2CONFIG += qt plugin warn_on release 2CONFIG += qt plugin warn_on release
3HEADERS = wireless.h wirelessappletimpl.h networkinfo.h mgraph.h advancedconfig.h 3HEADERS = wireless.h networkinfo.h mgraph.h advancedconfig.h
4SOURCES = wireless.cpp wirelessappletimpl.cpp networkinfo.cpp mgraph.cpp advancedconfig.cpp 4SOURCES = wireless.cpp networkinfo.cpp mgraph.cpp advancedconfig.cpp
5INTERFACES = advancedconfigbase.ui 5INTERFACES = advancedconfigbase.ui
@@ -8,5 +8,5 @@ DESTDIR = $(OPIEDIR)/plugins/applets
8INCLUDEPATH += $(OPIEDIR)/include 8INCLUDEPATH += $(OPIEDIR)/include
9DEPENDPATH += ../$(OPIEDIR)/include 9DEPENDPATH += $(OPIEDIR)/include
10LIBS += -lqpe 10LIBS += -lqpe
11VERSION = 0.1.0 11VERSION = 0.1.1
12 12
diff --git a/noncore/applets/wirelessapplet/wirelessappletimpl.cpp b/noncore/applets/wirelessapplet/wirelessappletimpl.cpp
deleted file mode 100644
index de70714..0000000
--- a/noncore/applets/wirelessapplet/wirelessappletimpl.cpp
+++ b/dev/null
@@ -1,66 +0,0 @@
1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3**
4** This file is part of Qtopia Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20#include "wireless.h"
21#include "wirelessappletimpl.h"
22
23
24WirelessAppletImpl::WirelessAppletImpl()
25 : wireless(0)
26{
27}
28
29WirelessAppletImpl::~WirelessAppletImpl()
30{
31 delete wireless;
32}
33
34QWidget *WirelessAppletImpl::applet( QWidget *parent )
35{
36 if ( !wireless )
37 wireless = new WirelessApplet( parent );
38 return wireless;
39}
40
41int WirelessAppletImpl::position() const
42{
43 return 6;
44}
45
46QRESULT WirelessAppletImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface )
47{
48 *iface = 0;
49 if ( uuid == IID_QUnknown )
50 *iface = this;
51 else if ( uuid == IID_TaskbarApplet )
52 *iface = this;
53 else
54 return QS_FALSE;
55
56 if ( *iface )
57 (*iface)->addRef();
58 return QS_OK;
59}
60
61Q_EXPORT_INTERFACE()
62{
63 Q_CREATE_INSTANCE( WirelessAppletImpl )
64}
65
66
diff --git a/noncore/applets/wirelessapplet/wirelessappletimpl.h b/noncore/applets/wirelessapplet/wirelessappletimpl.h
deleted file mode 100644
index 1bf4507..0000000
--- a/noncore/applets/wirelessapplet/wirelessappletimpl.h
+++ b/dev/null
@@ -1,43 +0,0 @@
1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3**
4** This file is part of Qtopia Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20#ifndef WIRELESSAPPLETIMPL_H
21#define WIRELESSAPPLETIMPL_H
22
23#include <qpe/taskbarappletinterface.h>
24
25class WirelessApplet;
26
27class WirelessAppletImpl : public TaskbarAppletInterface
28{
29public:
30 WirelessAppletImpl();
31 virtual ~WirelessAppletImpl();
32
33 QRESULT queryInterface( const QUuid&, QUnknownInterface** );
34 Q_REFCOUNT
35
36 virtual QWidget *applet( QWidget *parent );
37 virtual int position() const;
38
39private:
40 WirelessApplet *wireless;
41};
42
43#endif