Diffstat (limited to 'noncore/net/opietooth/applet/bluezapplet.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/opietooth/applet/bluezapplet.cpp | 38 |
1 files changed, 30 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 | |||
@@ -66,2 +66,3 @@ namespace OpieTooth { | |||
66 | bluezDiscoveryOnPixmap = Resource::loadPixmap( "bluetoothapplet/magglass.png" ); | 66 | bluezDiscoveryOnPixmap = Resource::loadPixmap( "bluetoothapplet/magglass.png" ); |
67 | bluezReceiveOnPixmap = Resource::loadPixmap( "bluetoothapplet/receive.png" ); | ||
67 | #else | 68 | #else |
@@ -70,2 +71,3 @@ namespace OpieTooth { | |||
70 | bluezDiscoveryOnPixmap = OResource::loadImage( "bluetoothapplet/bluezondiscovery", Opie::Core::OResource::SmallIcon ); | 71 | bluezDiscoveryOnPixmap = OResource::loadImage( "bluetoothapplet/bluezondiscovery", Opie::Core::OResource::SmallIcon ); |
72 | bluezReceiveOnPixmap = )Resource::loadImage( "bluetoothapplet/bluezonreceive", Opie::Core::OResource::SmallIcon ); | ||
71 | #endif | 73 | #endif |
@@ -76,2 +78,4 @@ namespace OpieTooth { | |||
76 | bluezDiscoveryActive = false; | 78 | bluezDiscoveryActive = false; |
79 | bluezReceiveActive = false; | ||
80 | bluezReceiveChanged = false; | ||
77 | doListDevice = false; | 81 | doListDevice = false; |
@@ -136,3 +140,2 @@ namespace OpieTooth { | |||
136 | #endif | 140 | #endif |
137 | |||
138 | case Model_iPAQ_H22xx: | 141 | case Model_iPAQ_H22xx: |
@@ -150,2 +153,3 @@ namespace OpieTooth { | |||
150 | } else { | 153 | } else { |
154 | setObexRecieveStatus(0); | ||
151 | ::system("/etc/init.d/bluetooth stop >/dev/null 2>/dev/null"); | 155 | ::system("/etc/init.d/bluetooth stop >/dev/null 2>/dev/null"); |
@@ -171,2 +175,12 @@ namespace OpieTooth { | |||
171 | 175 | ||
176 | int BluezApplet::setObexRecieveStatus(int d) { | ||
177 | { | ||
178 | QCopEnvelope e ( "QPE/Obex", "btreceive(int)" ); | ||
179 | e << ( d ? 1 : 0 ); | ||
180 | } | ||
181 | bluezReceiveActive = (bool)(d != 0); | ||
182 | bluezReceiveChanged = true; | ||
183 | return d; | ||
184 | } | ||
185 | |||
172 | // FIXME mbhaynie | 186 | // FIXME mbhaynie |
@@ -246,8 +260,9 @@ namespace OpieTooth { | |||
246 | 260 | ||
247 | if (bluezDiscoveryActive) { | 261 | if (bluezactive) { |
248 | menu->insertItem( tr("Disable discovery"), 3 ); | 262 | if (bluezReceiveActive) { |
263 | menu->insertItem( tr("Disable receive"), 3 ); | ||
249 | } else { | 264 | } else { |
250 | menu->insertItem( tr("Enable discovery"), 4 ); | 265 | menu->insertItem( tr("Enable receive"), 4 ); |
266 | } | ||
251 | } | 267 | } |
252 | |||
253 | 268 | ||
@@ -272,3 +287,3 @@ namespace OpieTooth { | |||
272 | case 3: | 287 | case 3: |
273 | setBluezDiscoveryStatus(0); | 288 | setObexRecieveStatus(0); |
274 | timerEvent( 0 ); | 289 | timerEvent( 0 ); |
@@ -276,3 +291,3 @@ namespace OpieTooth { | |||
276 | case 4: | 291 | case 4: |
277 | setBluezDiscoveryStatus(1); | 292 | setObexRecieveStatus(1); |
278 | timerEvent(0 ); | 293 | timerEvent(0 ); |
@@ -308,3 +323,4 @@ namespace OpieTooth { | |||
308 | if ((bluezactive != oldactive) || | 323 | if ((bluezactive != oldactive) || |
309 | (bluezDiscoveryActive != olddiscovery)) | 324 | (bluezDiscoveryActive != olddiscovery) || |
325 | bluezReceiveChanged) | ||
310 | update(); | 326 | update(); |
@@ -314,2 +330,4 @@ namespace OpieTooth { | |||
314 | } | 330 | } |
331 | if (bluezReceiveChanged) | ||
332 | bluezReceiveChanged = false; | ||
315 | } | 333 | } |
@@ -341,3 +359,7 @@ namespace OpieTooth { | |||
341 | } | 359 | } |
360 | if (bluezReceiveActive) { | ||
361 | p.drawPixmap( 0, 0, bluezReceiveOnPixmap ); | ||
342 | } | 362 | } |
363 | } | ||
364 | |||
343 | /** | 365 | /** |