-rw-r--r-- | noncore/net/opietooth/applet/bluezapplet.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/noncore/net/opietooth/applet/bluezapplet.cpp b/noncore/net/opietooth/applet/bluezapplet.cpp index 39a9c6e..a380ac7 100644 --- a/noncore/net/opietooth/applet/bluezapplet.cpp +++ b/noncore/net/opietooth/applet/bluezapplet.cpp | |||
@@ -125,66 +125,68 @@ namespace OpieTooth { | |||
125 | //menu->insertItem( tr("More..."), 7 ) | 125 | //menu->insertItem( tr("More..."), 7 ) |
126 | 126 | ||
127 | QPoint p = mapToGlobal( QPoint(1, -menu->sizeHint().height()-1) ); | 127 | QPoint p = mapToGlobal( QPoint(1, -menu->sizeHint().height()-1) ); |
128 | ret = menu->exec(p, 0); | 128 | ret = menu->exec(p, 0); |
129 | 129 | ||
130 | // qDebug("ret was %d\n", ret); | 130 | // qDebug("ret was %d\n", ret); |
131 | 131 | ||
132 | switch(ret) { | 132 | switch(ret) { |
133 | case 0: | 133 | case 0: |
134 | setBluezStatus(0); | 134 | setBluezStatus(0); |
135 | timerEvent(NULL); | 135 | timerEvent(NULL); |
136 | break; | 136 | break; |
137 | case 1: | 137 | case 1: |
138 | setBluezStatus(1); | 138 | setBluezStatus(1); |
139 | timerEvent(NULL); | 139 | timerEvent(NULL); |
140 | break; | 140 | break; |
141 | case 2: | 141 | case 2: |
142 | // start bluetoothmanager | 142 | // start bluetoothmanager |
143 | launchManager(); | 143 | launchManager(); |
144 | timerEvent(NULL); | 144 | timerEvent(NULL); |
145 | break; | 145 | break; |
146 | case 3: | 146 | case 3: |
147 | setBluezDiscoveryStatus(0); | 147 | setBluezDiscoveryStatus(0); |
148 | timerEvent(NULL); | 148 | timerEvent(NULL); |
149 | break; | 149 | break; |
150 | case 4: | 150 | case 4: |
151 | setBluezDiscoveryStatus(1); | 151 | setBluezDiscoveryStatus(1); |
152 | timerEvent(NULL); | 152 | timerEvent(NULL); |
153 | break; | 153 | break; |
154 | //case 7: | 154 | //case 7: |
155 | // With table of currently-detected devices. | 155 | // With table of currently-detected devices. |
156 | } | 156 | } |
157 | delete menu; | ||
157 | } | 158 | } |
158 | 159 | ||
160 | |||
159 | /** | 161 | /** |
160 | * Launches the bluetooth manager | 162 | * Launches the bluetooth manager |
161 | */ | 163 | */ |
162 | void BluezApplet::launchManager() { | 164 | void BluezApplet::launchManager() { |
163 | QCopEnvelope e("QPE/System", "execute(QString)"); | 165 | QCopEnvelope e("QPE/System", "execute(QString)"); |
164 | e << QString("bluetooth-manager"); | 166 | e << QString("bluetooth-manager"); |
165 | } | 167 | } |
166 | 168 | ||
167 | /** | 169 | /** |
168 | * Refresh timer | 170 | * Refresh timer |
169 | * @param the timer event | 171 | * @param the timer event |
170 | */ | 172 | */ |
171 | void BluezApplet::timerEvent( QTimerEvent * ) { | 173 | void BluezApplet::timerEvent( QTimerEvent * ) { |
172 | int oldactive = bluezactive; | 174 | int oldactive = bluezactive; |
173 | int olddiscovery = bluezDiscoveryActive; | 175 | int olddiscovery = bluezDiscoveryActive; |
174 | 176 | ||
175 | bluezactive = checkBluezStatus(); | 177 | bluezactive = checkBluezStatus(); |
176 | bluezDiscoveryActive = checkBluezDiscoveryStatus(); | 178 | bluezDiscoveryActive = checkBluezDiscoveryStatus(); |
177 | 179 | ||
178 | if ((bluezactive != oldactive) || (bluezDiscoveryActive != olddiscovery)) { | 180 | if ((bluezactive != oldactive) || (bluezDiscoveryActive != olddiscovery)) { |
179 | paintEvent(NULL); | 181 | paintEvent(NULL); |
180 | } | 182 | } |
181 | } | 183 | } |
182 | 184 | ||
183 | /** | 185 | /** |
184 | * Implementation of the paint event | 186 | * Implementation of the paint event |
185 | * @param the QPaintEvent | 187 | * @param the QPaintEvent |
186 | */ | 188 | */ |
187 | void BluezApplet::paintEvent( QPaintEvent* ) { | 189 | void BluezApplet::paintEvent( QPaintEvent* ) { |
188 | QPainter p(this); | 190 | QPainter p(this); |
189 | qDebug("paint bluetooth pixmap"); | 191 | qDebug("paint bluetooth pixmap"); |
190 | 192 | ||