summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/applet/bluezapplet.cpp
authorharlekin <harlekin>2002-06-16 15:12:06 (UTC)
committer harlekin <harlekin>2002-06-16 15:12:06 (UTC)
commit47f58b07e3718500193262bf4a0a2d13c9b7d539 (patch) (unidiff)
tree10a8cc4c29ad1e3b121c78034e83c6b111d46d92 /noncore/net/opietooth/applet/bluezapplet.cpp
parentbec7383f8b00706eb5ad0eedb6fcb0e013041ad3 (diff)
downloadopie-47f58b07e3718500193262bf4a0a2d13c9b7d539.zip
opie-47f58b07e3718500193262bf4a0a2d13c9b7d539.tar.gz
opie-47f58b07e3718500193262bf4a0a2d13c9b7d539.tar.bz2
update
Diffstat (limited to 'noncore/net/opietooth/applet/bluezapplet.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/applet/bluezapplet.cpp34
1 files changed, 14 insertions, 20 deletions
diff --git a/noncore/net/opietooth/applet/bluezapplet.cpp b/noncore/net/opietooth/applet/bluezapplet.cpp
index 6e5ee82..94e29c7 100644
--- a/noncore/net/opietooth/applet/bluezapplet.cpp
+++ b/noncore/net/opietooth/applet/bluezapplet.cpp
@@ -55,37 +55,35 @@ namespace OpieTooth {
55 bluezOffPixmap = Resource::loadPixmap( "bluetoothapplet/bluezoff" ); 55 bluezOffPixmap = Resource::loadPixmap( "bluetoothapplet/bluezoff" );
56 // bluezDiscoveryOnPixmap = Resource::loadPixmap( "bluetoothapplet/magglass" ); 56 // bluezDiscoveryOnPixmap = Resource::loadPixmap( "bluetoothapplet/magglass" );
57 startTimer(5000); 57 startTimer(5000);
58 timerEvent(NULL); 58 btDevice = 0;
59
59 } 60 }
60 61
61 BluezApplet::~BluezApplet() { 62 BluezApplet::~BluezApplet() {
62 } 63 }
63 64
64 int BluezApplet::checkBluezStatus() { 65 int BluezApplet::checkBluezStatus() {
65 if (btDevice) { 66 if (btDevice) {
66 if (btDevice->isLoaded() ) { 67 if (btDevice->isLoaded() ) {
67 return 1; 68 return 1;
69 } else {
70 return 0;
71 }
68 } else { 72 } else {
69 return 0; 73 return 0;
70 } 74 }
71 } else {
72 return 0;
73 }
74 } 75 }
75 76
76 int BluezApplet::setBluezStatus(int c) { 77 int BluezApplet::setBluezStatus(int c) {
77 78
78 if (c == 1) { 79 if (c == 1) {
79 btDevice = new Device("/dev/ttySB0", "csr" ); 80 btDevice = new Device("/dev/ttySB0", "csr" );
80 // system("hciattach /dev/ttySB0 csr");
81 //system("hcid");
82 } else { 81 } else {
83 if (btDevice) { 82 if (btDevice) {
84 delete btDevice; 83 delete btDevice;
84 btDevice = 0;
85 } 85 }
86 //system("killall hciattach"); 86 }
87 //system("killall hcid");
88 }
89 return 0; 87 return 0;
90 } 88 }
91 89
@@ -122,38 +120,34 @@ namespace OpieTooth {
122 } else { 120 } else {
123 menu->insertItem( tr("Enable discovery"), 4 ); 121 menu->insertItem( tr("Enable discovery"), 4 );
124 } 122 }
125 //menu->insertItem( tr("More..."), 7 ) 123
126 124
127 QPoint p = mapToGlobal( QPoint(1, -menu->sizeHint().height()-1) ); 125 QPoint p = mapToGlobal( QPoint(1, -menu->sizeHint().height()-1) );
128 ret = menu->exec(p, 0); 126 ret = menu->exec(p, 0);
129 127
130 // qDebug("ret was %d\n", ret);
131
132 switch(ret) { 128 switch(ret) {
133 case 0: 129 case 0:
134 setBluezStatus(0); 130 setBluezStatus(0);
135 timerEvent(NULL);
136 break; 131 break;
137 case 1: 132 case 1:
138 setBluezStatus(1); 133 setBluezStatus(1);
139 timerEvent(NULL);
140 break; 134 break;
141 case 2: 135 case 2:
142 // start bluetoothmanager 136 // start bluetoothmanager
143 launchManager(); 137 launchManager();
144 timerEvent(NULL);
145 break; 138 break;
146 case 3: 139 case 3:
147 setBluezDiscoveryStatus(0); 140 setBluezDiscoveryStatus(0);
148 timerEvent(NULL);
149 break; 141 break;
150 case 4: 142 case 4:
151 setBluezDiscoveryStatus(1); 143 setBluezDiscoveryStatus(1);
152 timerEvent(NULL);
153 break; 144 break;
154 //case 7: 145 //case 7:
155 // With table of currently-detected devices. 146 // With table of currently-detected devices.
156 } 147 }
148
149 timerEvent(NULL);
150 delete signal;
157 delete menu; 151 delete menu;
158 } 152 }
159 153