author | mickeyl <mickeyl> | 2004-02-23 13:37:46 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-02-23 13:37:46 (UTC) |
commit | 1f362cd77a2b39eae2abca6da28efa5118d2c347 (patch) (unidiff) | |
tree | ddc796d7505b2ec0f20e9b74154316d3f818d16c | |
parent | 12ce268e3f75e4f07699b8e0c368f2112e651f7f (diff) | |
download | opie-1f362cd77a2b39eae2abca6da28efa5118d2c347.zip opie-1f362cd77a2b39eae2abca6da28efa5118d2c347.tar.gz opie-1f362cd77a2b39eae2abca6da28efa5118d2c347.tar.bz2 |
start with the long awaited wireless applet overhaul
-rw-r--r-- | noncore/applets/wirelessapplet/wireless.cpp | 55 | ||||
-rw-r--r-- | noncore/applets/wirelessapplet/wireless.h | 1 | ||||
-rw-r--r-- | noncore/applets/wirelessapplet/wirelessapplet.pro | 8 | ||||
-rw-r--r-- | noncore/applets/wirelessapplet/wirelessappletimpl.cpp | 66 | ||||
-rw-r--r-- | noncore/applets/wirelessapplet/wirelessappletimpl.h | 43 |
5 files changed, 39 insertions, 134 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,6 +1,4 @@ | |||
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 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 4 | ** This file may be distributed and/or modified under the terms of the |
@@ -15,9 +13,21 @@ | |||
15 | 13 | ||
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> |
20 | #include <qpe/config.h> | 29 | #include <qpe/config.h> |
21 | 30 | ||
31 | /* QT */ | ||
22 | #include <qpoint.h> | 32 | #include <qpoint.h> |
23 | #include <qradiobutton.h> | 33 | #include <qradiobutton.h> |
@@ -34,20 +44,8 @@ | |||
34 | #include <qtextstream.h> | 44 | #include <qtextstream.h> |
35 | 45 | ||
46 | /* STD */ | ||
36 | #include <sys/types.h> | 47 | #include <sys/types.h> |
37 | #include <signal.h> | 48 | #include <signal.h> |
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 |
53 | #define STYLE_ANTENNA 1 | 51 | #define STYLE_ANTENNA 1 |
@@ -227,4 +225,5 @@ void WirelessApplet::checkInterface() | |||
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 | } |
230 | else | 229 | else |
@@ -315,6 +314,5 @@ void WirelessApplet::displayStyleChange( int style ) | |||
315 | 314 | ||
316 | WirelessApplet::~WirelessApplet() | 315 | WirelessApplet::~WirelessApplet() |
317 | { | 316 | {} |
318 | } | ||
319 | 317 | ||
320 | void WirelessApplet::timerEvent( QTimerEvent* ) | 318 | void WirelessApplet::timerEvent( QTimerEvent* ) |
@@ -330,5 +328,6 @@ void WirelessApplet::timerEvent( QTimerEvent* ) | |||
330 | mustRepaint(); | 328 | mustRepaint(); |
331 | return; | 329 | return; |
332 | } else | 330 | } |
331 | else | ||
333 | if ( mustRepaint() ) | 332 | if ( mustRepaint() ) |
334 | { | 333 | { |
@@ -339,5 +338,6 @@ void WirelessApplet::timerEvent( QTimerEvent* ) | |||
339 | if ( status->isVisible() ) | 338 | if ( status->isVisible() ) |
340 | updatePopupWindow(); | 339 | updatePopupWindow(); |
341 | } else checkInterface(); | 340 | } |
341 | else checkInterface(); | ||
342 | } | 342 | } |
343 | 343 | ||
@@ -538,2 +538,15 @@ void WirelessApplet::paintEvent( QPaintEvent* ) | |||
538 | } | 538 | } |
539 | } | 539 | } |
540 | |||
541 | |||
542 | int WirelessApplet::position() | ||
543 | { | ||
544 | return 6; | ||
545 | } | ||
546 | |||
547 | |||
548 | Q_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 | |||
@@ -66,4 +66,5 @@ 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 | ||
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 | |||
@@ -1,13 +1,13 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt plugin warn_on release | 2 | CONFIG += qt plugin warn_on release |
3 | HEADERS = wireless.h wirelessappletimpl.h networkinfo.h mgraph.h advancedconfig.h | 3 | HEADERS = wireless.h networkinfo.h mgraph.h advancedconfig.h |
4 | SOURCES = wireless.cpp wirelessappletimpl.cpp networkinfo.cpp mgraph.cpp advancedconfig.cpp | 4 | SOURCES = wireless.cpp networkinfo.cpp mgraph.cpp advancedconfig.cpp |
5 | INTERFACES = advancedconfigbase.ui | 5 | INTERFACES = advancedconfigbase.ui |
6 | TARGET = wirelessapplet | 6 | TARGET = wirelessapplet |
7 | DESTDIR = $(OPIEDIR)/plugins/applets | 7 | 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 |
11 | VERSION = 0.1.0 | 11 | VERSION = 0.1.1 |
12 | 12 | ||
13 | include ( $(OPIEDIR)/include.pro ) | 13 | include ( $(OPIEDIR)/include.pro ) |
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 | |||
24 | WirelessAppletImpl::WirelessAppletImpl() | ||
25 | : wireless(0) | ||
26 | { | ||
27 | } | ||
28 | |||
29 | WirelessAppletImpl::~WirelessAppletImpl() | ||
30 | { | ||
31 | delete wireless; | ||
32 | } | ||
33 | |||
34 | QWidget *WirelessAppletImpl::applet( QWidget *parent ) | ||
35 | { | ||
36 | if ( !wireless ) | ||
37 | wireless = new WirelessApplet( parent ); | ||
38 | return wireless; | ||
39 | } | ||
40 | |||
41 | int WirelessAppletImpl::position() const | ||
42 | { | ||
43 | return 6; | ||
44 | } | ||
45 | |||
46 | QRESULT 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 | |||
61 | Q_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 | |||
25 | class WirelessApplet; | ||
26 | |||
27 | class WirelessAppletImpl : public TaskbarAppletInterface | ||
28 | { | ||
29 | public: | ||
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 | |||
39 | private: | ||
40 | WirelessApplet *wireless; | ||
41 | }; | ||
42 | |||
43 | #endif | ||