-rw-r--r-- | core/obex/obexsend.cpp | 51 | ||||
-rw-r--r-- | core/obex/obexsendbase.ui | 8 |
2 files changed, 32 insertions, 27 deletions
diff --git a/core/obex/obexsend.cpp b/core/obex/obexsend.cpp index a80a48b..9cd9972 100644 --- a/core/obex/obexsend.cpp +++ b/core/obex/obexsend.cpp | |||
@@ -17,6 +17,7 @@ using namespace Opie::Core; | |||
17 | 17 | ||
18 | /* QT */ | 18 | /* QT */ |
19 | #include <qlabel.h> | 19 | #include <qlabel.h> |
20 | #include <qpushbutton.h> | ||
20 | #include <qpixmap.h> | 21 | #include <qpixmap.h> |
21 | #include <qlistview.h> | 22 | #include <qlistview.h> |
22 | #include <qtimer.h> | 23 | #include <qtimer.h> |
@@ -138,7 +139,8 @@ void SendWidget::slotIrTry(unsigned int trI) { | |||
138 | setReceiverStatus(m_irDaIt.key(), tr("Try %1").arg( QString::number( trI ) )); | 139 | setReceiverStatus(m_irDaIt.key(), tr("Try %1").arg( QString::number( trI ) )); |
139 | } | 140 | } |
140 | void SendWidget::slotStartIrda() { | 141 | void SendWidget::slotStartIrda() { |
141 | if (m_irDaIt == m_irDa.end() ) { | 142 | if ( !m_irDa.count() ) return; |
143 | if ( m_irDaIt == m_irDa.end() ) { | ||
142 | irdaStatus->setText(tr("complete.")); | 144 | irdaStatus->setText(tr("complete.")); |
143 | return; | 145 | return; |
144 | } | 146 | } |
@@ -183,31 +185,34 @@ void SendWidget::send_to_receivers() { | |||
183 | slotStartBt(); | 185 | slotStartBt(); |
184 | } | 186 | } |
185 | 187 | ||
186 | void SendWidget::scan_for_receivers() { | 188 | void SendWidget::scan_for_receivers() |
187 | 189 | { | |
188 | bool enable_irda=false; | 190 | //FIXME: Clean ListBox prior to (re)scan |
189 | bool enable_bt=false; | 191 | sendButton->setDisabled( true ); |
190 | |||
191 | if ( !QCopChannel::isRegistered("QPE/IrDaApplet") ) { | ||
192 | irdaStatus->setText(tr("not enabled.")); | ||
193 | enable_irda=true; | ||
194 | } else | ||
195 | irdaStatus->setText(tr("searching...")); | ||
196 | 192 | ||
197 | if ( !QCopChannel::isRegistered("QPE/Bluetooth") ) { | 193 | if ( !QCopChannel::isRegistered("QPE/IrDaApplet") ) |
198 | btStatus->setText(tr("not enabled.")); | 194 | { |
199 | enable_bt=true; | 195 | irdaStatus->setText(tr("not enabled.")); |
200 | } else | 196 | } |
201 | btStatus->setText(tr("searching...")); | 197 | else |
198 | { | ||
199 | QCopEnvelope e1("QPE/IrDaApplet", "enableIrda()"); | ||
200 | irdaStatus->setText(tr("searching...")); | ||
201 | sendButton->setEnabled( true ); | ||
202 | QCopEnvelope e2("QPE/IrDaApplet", "listDevices()"); | ||
203 | } | ||
202 | 204 | ||
203 | if (enable_irda) | 205 | if ( !QCopChannel::isRegistered("QPE/Bluetooth") ) |
204 | QCopEnvelope e0("QPE/IrDaApplet", "enableIrda()"); | 206 | { |
205 | if (enable_bt) | 207 | btStatus->setText(tr("not enabled.")); |
208 | } | ||
209 | else | ||
210 | { | ||
206 | QCopEnvelope e1("QPE/Bluetooth", "enableBluetooth()"); | 211 | QCopEnvelope e1("QPE/Bluetooth", "enableBluetooth()"); |
207 | 212 | btStatus->setText(tr("searching...")); | |
208 | QCopEnvelope e2("QPE/IrDaApplet", "listDevices()"); | 213 | sendButton->setEnabled( true ); |
209 | QCopEnvelope e3("QPE/Bluetooth", "listDevices()"); | 214 | QCopEnvelope e3("QPE/Bluetooth", "listDevices()"); |
210 | 215 | } | |
211 | } | 216 | } |
212 | 217 | ||
213 | void SendWidget::toggle_receiver(QListViewItem* item) | 218 | void SendWidget::toggle_receiver(QListViewItem* item) |
diff --git a/core/obex/obexsendbase.ui b/core/obex/obexsendbase.ui index a192dd3..4619842 100644 --- a/core/obex/obexsendbase.ui +++ b/core/obex/obexsendbase.ui | |||
@@ -16,7 +16,7 @@ for selecting destination hosts.</comment> | |||
16 | <rect> | 16 | <rect> |
17 | <x>0</x> | 17 | <x>0</x> |
18 | <y>0</y> | 18 | <y>0</y> |
19 | <width>363</width> | 19 | <width>359</width> |
20 | <height>221</height> | 20 | <height>221</height> |
21 | </rect> | 21 | </rect> |
22 | </property> | 22 | </property> |
@@ -297,7 +297,7 @@ for selecting destination hosts.</comment> | |||
297 | </property> | 297 | </property> |
298 | <property stdset="1"> | 298 | <property stdset="1"> |
299 | <name>text</name> | 299 | <name>text</name> |
300 | <string>Scan</string> | 300 | <string>&Rescan</string> |
301 | </property> | 301 | </property> |
302 | </widget> | 302 | </widget> |
303 | <widget> | 303 | <widget> |
@@ -308,7 +308,7 @@ for selecting destination hosts.</comment> | |||
308 | </property> | 308 | </property> |
309 | <property stdset="1"> | 309 | <property stdset="1"> |
310 | <name>text</name> | 310 | <name>text</name> |
311 | <string>Send</string> | 311 | <string>&Send</string> |
312 | </property> | 312 | </property> |
313 | </widget> | 313 | </widget> |
314 | <widget> | 314 | <widget> |
@@ -319,7 +319,7 @@ for selecting destination hosts.</comment> | |||
319 | </property> | 319 | </property> |
320 | <property stdset="1"> | 320 | <property stdset="1"> |
321 | <name>text</name> | 321 | <name>text</name> |
322 | <string>Done</string> | 322 | <string>&Close</string> |
323 | </property> | 323 | </property> |
324 | </widget> | 324 | </widget> |
325 | </hbox> | 325 | </hbox> |