Diffstat (limited to 'noncore/net/opietooth/applet/bluezapplet.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opietooth/applet/bluezapplet.cpp | 50 |
1 files changed, 31 insertions, 19 deletions
diff --git a/noncore/net/opietooth/applet/bluezapplet.cpp b/noncore/net/opietooth/applet/bluezapplet.cpp index 66e8f01..8925803 100644 --- a/noncore/net/opietooth/applet/bluezapplet.cpp +++ b/noncore/net/opietooth/applet/bluezapplet.cpp | |||
@@ -1,66 +1,69 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | =. This file is part of the OPIE Project |
3 | .=l. Copyright (c) 2002 Maximilian Reiss <max.reiss@gmx.de> | 3 | .=l. Copyright (c) 2002 Maximilian Reiss <max.reiss@gmx.de> |
4 | .>+-= | 4 | .>+-= |
5 | _;:, .> :=|. This library is free software; you can | 5 | _;:, .> :=|. This library is free software; you can |
6 | .> <, > . <= redistribute it and/or modify it under | 6 | .> <, > . <= redistribute it and/or modify it under |
7 | :=1 )Y*s>-.-- : the terms of the GNU Library General Public | 7 | :=1 )Y*s>-.-- : the terms of the GNU Library General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 9 | - . .-<_> .<> Foundation; version 2 of the License. |
10 | ._= =} : or (at your option) any later version. | 10 | ._= =} : |
11 | .%+i> _;_. | 11 | .%+i> _;_. |
12 | .i_,=:_. -<s. This library is distributed in the hope that | 12 | .i_,=:_. -<s. This library is distributed in the hope that |
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
14 | : .. .:, . . . without even the implied warranty of | 14 | : .. .:, . . . without even the implied warranty of |
15 | =_ + =;=| MERCHANTABILITY or FITNESS FOR A | 15 | =_ + =;=| MERCHANTABILITY or FITNESS FOR A |
16 | _.=:. : :=>: PARTICULAR PURPOSE. See the GNU | 16 | _.=:. : :=>: PARTICULAR PURPOSE. See the GNU |
17 | ..}^=.= = ; Library General Public License for more | 17 | ..}^=.= = ; Library General Public License for more |
18 | ++= -. . .: details. | 18 | ++= -. . .: details. |
19 | : = ...= . :.=- | 19 | : = ...= . :.=- |
20 | -. .:....=;==+<; You should have received a copy of the GNU | 20 | -. .:....=;==+<; You should have received a copy of the GNU |
21 | -_. . . )=. = Library General Public License along with | 21 | -_. . . )=. = Library General Public License along with |
22 | -- :-= this library; see the file COPYING.LIB. | 22 | -- :-= this library; see the file COPYING.LIB. |
23 | If not, write to the Free Software Foundation, | 23 | If not, write to the Free Software Foundation, |
24 | Inc., 59 Temple Place - Suite 330, | 24 | Inc., 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | 29 | ||
30 | #include "bluezapplet.h" | 30 | #include "bluezapplet.h" |
31 | #include <qapplication.h> | ||
32 | 31 | ||
32 | /* OPIE */ | ||
33 | #include <opie2/otaskbarapplet.h> | ||
34 | #include <opie2/odevice.h> | ||
35 | #include <opie2/odebug.h> | ||
36 | #include <qpe/applnk.h> | ||
33 | #include <qpe/qcopenvelope_qws.h> | 37 | #include <qpe/qcopenvelope_qws.h> |
34 | #include <qpe/config.h> | 38 | #include <qpe/config.h> |
35 | #include <qpe/resource.h> | 39 | #include <qpe/resource.h> |
40 | using namespace Opie::Core; | ||
36 | 41 | ||
37 | #include <opie2/odevice.h> | 42 | /* QT */ |
38 | #include <opie2/odebug.h> | 43 | #include <qapplication.h> |
39 | |||
40 | #include <qpoint.h> | 44 | #include <qpoint.h> |
41 | #include <qpainter.h> | 45 | #include <qpainter.h> |
42 | #include <qlayout.h> | 46 | #include <qlayout.h> |
43 | #include <qframe.h> | 47 | #include <qframe.h> |
44 | #include <qpixmap.h> | 48 | #include <qpixmap.h> |
45 | #include <qstring.h> | 49 | #include <qstring.h> |
46 | #include <qtimer.h> | 50 | #include <qtimer.h> |
47 | #include <qpopupmenu.h> | 51 | #include <qpopupmenu.h> |
48 | 52 | ||
53 | /* STD */ | ||
49 | #include <device.h> | 54 | #include <device.h> |
50 | 55 | ||
51 | using namespace Opie::Core; | ||
52 | |||
53 | namespace OpieTooth { | 56 | namespace OpieTooth { |
54 | 57 | ||
55 | BluezApplet::BluezApplet( QWidget *parent, const char *name ) : QWidget( parent, name ) { | 58 | BluezApplet::BluezApplet( QWidget *parent, const char *name ) : QWidget( parent, name ) { |
56 | setFixedHeight( 18 ); | 59 | setFixedHeight( AppLnk::smallIconSize() ); |
57 | setFixedWidth( 14 ); | 60 | setFixedWidth( AppLnk::smallIconSize() ); |
58 | bluezOnPixmap = Resource::loadPixmap( "bluetoothapplet/bluezon" ); | 61 | bluezOnPixmap = Resource::loadImage( "bluetoothapplet/bluezon" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); |
59 | bluezOffPixmap = Resource::loadPixmap( "bluetoothapplet/bluezoff" ); | 62 | bluezOffPixmap = Resource::loadImage( "bluetoothapplet/bluezoff" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); |
60 | // bluezDiscoveryOnPixmap = Resource::loadPixmap( "bluetoothapplet/magglass" ); | 63 | //bluezDiscoveryOnPixmap = Resource::loadImage( "bluetoothapplet/magglass" )smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize()); |
61 | startTimer(4000); | 64 | startTimer(4000); |
62 | btDevice = 0; | 65 | btDevice = 0; |
63 | bluezactive = false; | 66 | bluezactive = false; |
64 | bluezDiscoveryActive = false; | 67 | bluezDiscoveryActive = false; |
65 | 68 | ||
66 | } | 69 | } |
@@ -68,12 +71,18 @@ namespace OpieTooth { | |||
68 | BluezApplet::~BluezApplet() { | 71 | BluezApplet::~BluezApplet() { |
69 | if ( btDevice ) { | 72 | if ( btDevice ) { |
70 | delete btDevice; | 73 | delete btDevice; |
71 | } | 74 | } |
72 | } | 75 | } |
73 | 76 | ||
77 | int BluezApplet::position() | ||
78 | { | ||
79 | return 6; | ||
80 | } | ||
81 | |||
82 | |||
74 | bool BluezApplet::checkBluezStatus() { | 83 | bool BluezApplet::checkBluezStatus() { |
75 | if (btDevice) { | 84 | if (btDevice) { |
76 | if (btDevice->isLoaded() ) { | 85 | if (btDevice->isLoaded() ) { |
77 | return true; | 86 | return true; |
78 | } else { | 87 | } else { |
79 | return false; | 88 | return false; |
@@ -217,6 +226,9 @@ namespace OpieTooth { | |||
217 | 226 | ||
218 | if (bluezDiscoveryActive > 0) { | 227 | if (bluezDiscoveryActive > 0) { |
219 | p.drawPixmap( 0, 1, bluezDiscoveryOnPixmap ); | 228 | p.drawPixmap( 0, 1, bluezDiscoveryOnPixmap ); |
220 | } | 229 | } |
221 | } | 230 | } |
222 | }; | 231 | }; |
232 | |||
233 | EXPORT_OPIE_APPLET_v1( OpieTooth::BluezApplet ) | ||
234 | |||