summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/applet/bluezapplet.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/noncore/net/opietooth/applet/bluezapplet.cpp b/noncore/net/opietooth/applet/bluezapplet.cpp
index 6351d4e..f7774f0 100644
--- a/noncore/net/opietooth/applet/bluezapplet.cpp
+++ b/noncore/net/opietooth/applet/bluezapplet.cpp
@@ -14,75 +14,74 @@
    : ..    .:,     . . . without even the implied warranty of
    =_        +     =;=| MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>: PARTICULAR PURPOSE. See the GNU
..}^=.=       =       ; Library General Public License for more
++=   -.     .     .: details.
 :     =  ...= . :.=-
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = Library General Public License along with
  --        :-= this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "bluezapplet.h"
/* OPIE */
#include <opie2/otaskbarapplet.h>
#include <opie2/odevice.h>
#include <opie2/odebug.h>
#include <opie2/oresource.h>
#include <opie2/oprocess.h>
+#include <qpe/version.h>
#include <qpe/applnk.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/config.h>
using namespace Opie::Core;
/* QT */
#include <qapplication.h>
#include <qpoint.h>
#include <qpainter.h>
#include <qlayout.h>
#include <qframe.h>
#include <qpixmap.h>
#include <qstring.h>
#include <qtimer.h>
#include <qpopupmenu.h>
#include <qmessagebox.h>
/* STD */
#include <device.h>
-#define OPIE120 // undefine it fo the latest OPIE
-
namespace OpieTooth {
BluezApplet::BluezApplet( QWidget *parent, const char *name ) : QWidget( parent, name ) {
setFixedHeight( AppLnk::smallIconSize() );
setFixedWidth( AppLnk::smallIconSize() );
-#ifdef OPIE120
+#if OPIE_VERSION < 102010
bluezOnPixmap = Resource::loadPixmap( "bluetoothapplet/bluezon" );
bluezOffPixmap = Resource::loadPixmap( "bluetoothapplet/bluezoff" );
bluezDiscoveryOnPixmap = Resource::loadPixmap( "bluetoothapplet/magglass.png" );
#else
bluezOnPixmap = OResource::loadImage( "bluetoothapplet/bluezon", OResource::SmallIcon );
bluezOffPixmap = OResource::loadImage( "bluetoothapplet/bluezoff", Opie::Core::OResource::SmallIcon );
bluezDiscoveryOnPixmap = OResource::loadImage( "bluetoothapplet/bluezondiscovery", Opie::Core::OResource::SmallIcon );
#endif
startTimer(2000);
btDevice = 0;
btManager = 0;
bluezactive = false;
bluezDiscoveryActive = false;
doListDevice = false;
isScanning = false;
m_wasOn = false;
// TODO: determine whether this channel has to be closed at destruction time.
QCopChannel* chan = new QCopChannel("QPE/Bluetooth", this );
connect(chan, SIGNAL(received(const QCString&,const QByteArray&) ),
this, SLOT(slotMessage(const QCString&,const QByteArray&) ) );
::system("/etc/init.d/bluetooth stop >/dev/null 2>/dev/null");
}
@@ -299,46 +298,46 @@ namespace OpieTooth {
bool oldactive = bluezactive;
int olddiscovery = bluezDiscoveryActive;
bluezactive = checkBluezStatus();
bluezDiscoveryActive = checkBluezDiscoveryStatus();
if ((bluezactive != oldactive) ||
(bluezDiscoveryActive != olddiscovery))
update();
if (bluezactive && doListDevice) {
const QByteArray arr;
slotMessage("listDevices()", arr);
}
}
/**
* Implementation of the paint event
* @param the QPaintEvent
*/
void BluezApplet::paintEvent( QPaintEvent* ) {
QPainter p(this);
odebug << "paint bluetooth pixmap" << oendl;
if (bluezactive) {
-#ifdef OPIE120
+#if OPIE_VERSION < 102010
p.drawPixmap( 0, -1, bluezOnPixmap );
#else
p.drawPixmap( 0, 0, bluezOnPixmap );
#endif
} else {
-#ifdef OPIE120
+#if OPIE_VERSION < 102010
p.drawPixmap( 0, -1, bluezOffPixmap );
#else
p.drawPixmap( 0, 0, bluezOffPixmap );
#endif
}
if (bluezDiscoveryActive) {
p.drawPixmap( 0, 0, bluezDiscoveryOnPixmap );
}
}
};
EXPORT_OPIE_APPLET_v1( OpieTooth::BluezApplet )