summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/opietooth/applet/bluezapplet.cpp38
-rw-r--r--noncore/net/opietooth/applet/bluezapplet.h4
2 files changed, 34 insertions, 8 deletions
diff --git a/noncore/net/opietooth/applet/bluezapplet.cpp b/noncore/net/opietooth/applet/bluezapplet.cpp
index a1d64a4..32560a1 100644
--- a/noncore/net/opietooth/applet/bluezapplet.cpp
+++ b/noncore/net/opietooth/applet/bluezapplet.cpp
@@ -65,8 +65,10 @@ namespace OpieTooth {
bluezOffPixmap = Resource::loadPixmap( "bluetoothapplet/bluezoff" );
bluezDiscoveryOnPixmap = Resource::loadPixmap( "bluetoothapplet/magglass.png" );
+ bluezReceiveOnPixmap = Resource::loadPixmap( "bluetoothapplet/receive.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 );
+ bluezReceiveOnPixmap = )Resource::loadImage( "bluetoothapplet/bluezonreceive", Opie::Core::OResource::SmallIcon );
#endif
startTimer(2000);
@@ -75,4 +77,6 @@ namespace OpieTooth {
bluezactive = false;
bluezDiscoveryActive = false;
+ bluezReceiveActive = false;
+ bluezReceiveChanged = false;
doListDevice = false;
isScanning = false;
@@ -135,5 +139,4 @@ namespace OpieTooth {
break;
#endif
-
case Model_iPAQ_H22xx:
btDevice = new Device( "/dev/tts/3", "any", "921600" );
@@ -149,4 +152,5 @@ namespace OpieTooth {
} else {
+ setObexRecieveStatus(0);
::system("/etc/init.d/bluetooth stop >/dev/null 2>/dev/null");
if ( btManager ) {
@@ -170,4 +174,14 @@ namespace OpieTooth {
}
+ int BluezApplet::setObexRecieveStatus(int d) {
+ {
+ QCopEnvelope e ( "QPE/Obex", "btreceive(int)" );
+ e << ( d ? 1 : 0 );
+ }
+ bluezReceiveActive = (bool)(d != 0);
+ bluezReceiveChanged = true;
+ return d;
+ }
+
// FIXME mbhaynie
// receiver for QCopChannel("QPE/Bluetooth") messages.
@@ -245,10 +259,11 @@ namespace OpieTooth {
//menu->insertSeparator(8);
- if (bluezDiscoveryActive) {
- menu->insertItem( tr("Disable discovery"), 3 );
+ if (bluezactive) {
+ if (bluezReceiveActive) {
+ menu->insertItem( tr("Disable receive"), 3 );
} else {
- menu->insertItem( tr("Enable discovery"), 4 );
+ menu->insertItem( tr("Enable receive"), 4 );
+ }
}
-
QPoint p = mapToGlobal( QPoint(1, -menu->sizeHint().height()-1) );
@@ -271,9 +286,9 @@ namespace OpieTooth {
break;
case 3:
- setBluezDiscoveryStatus(0);
+ setObexRecieveStatus(0);
timerEvent( 0 );
break;
case 4:
- setBluezDiscoveryStatus(1);
+ setObexRecieveStatus(1);
timerEvent(0 );
break;
@@ -307,5 +322,6 @@ namespace OpieTooth {
if ((bluezactive != oldactive) ||
- (bluezDiscoveryActive != olddiscovery))
+ (bluezDiscoveryActive != olddiscovery) ||
+ bluezReceiveChanged)
update();
if (bluezactive && doListDevice) {
@@ -313,4 +329,6 @@ namespace OpieTooth {
slotMessage("listDevices()", arr);
}
+ if (bluezReceiveChanged)
+ bluezReceiveChanged = false;
}
@@ -340,5 +358,9 @@ namespace OpieTooth {
p.drawPixmap( 0, 0, bluezDiscoveryOnPixmap );
}
+ if (bluezReceiveActive) {
+ p.drawPixmap( 0, 0, bluezReceiveOnPixmap );
}
+ }
+
/**
* Reacts on device up
diff --git a/noncore/net/opietooth/applet/bluezapplet.h b/noncore/net/opietooth/applet/bluezapplet.h
index b79ed5b..9809d20 100644
--- a/noncore/net/opietooth/applet/bluezapplet.h
+++ b/noncore/net/opietooth/applet/bluezapplet.h
@@ -59,4 +59,5 @@ public slots:
int checkBluezDiscoveryStatus();
int setBluezDiscoveryStatus(int);
+ int setObexRecieveStatus(int);
private:
@@ -66,6 +67,9 @@ public slots:
QPixmap bluezOffPixmap;
QPixmap bluezDiscoveryOnPixmap;
+ QPixmap bluezReceiveOnPixmap;
bool bluezactive;
bool bluezDiscoveryActive;
+ bool bluezReceiveActive;
+ bool bluezReceiveChanged;
bool doListDevice; //If I have to list devices after bringing BT up?
bool isScanning; //If I'm scanning devices