author | mickeyl <mickeyl> | 2005-08-23 20:37:03 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-08-23 20:37:03 (UTC) |
commit | 68c01ad5f6e7dc12192c9ce77f0a2ee48b813831 (patch) (unidiff) | |
tree | 054dd974156c8e49400979eb9b226bb7bd32fd31 | |
parent | 95210ac41729a4c264e830963cdae3a4cdd218fb (diff) | |
download | opie-68c01ad5f6e7dc12192c9ce77f0a2ee48b813831.zip opie-68c01ad5f6e7dc12192c9ce77f0a2ee48b813831.tar.gz opie-68c01ad5f6e7dc12192c9ce77f0a2ee48b813831.tar.bz2 |
- fix SIGSEGV when trying to send but IrDA is not enabled
- rename 'scan' button to 'rescan'
- disable 'send' button if IrDA and BT is both disabled
-rw-r--r-- | core/obex/obexsend.cpp | 41 | ||||
-rw-r--r-- | core/obex/obexsendbase.ui | 8 |
2 files changed, 27 insertions, 22 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 | |||
@@ -19,2 +19,3 @@ using namespace Opie::Core; | |||
19 | #include <qlabel.h> | 19 | #include <qlabel.h> |
20 | #include <qpushbutton.h> | ||
20 | #include <qpixmap.h> | 21 | #include <qpixmap.h> |
@@ -140,2 +141,3 @@ void SendWidget::slotIrTry(unsigned int trI) { | |||
140 | void SendWidget::slotStartIrda() { | 141 | void SendWidget::slotStartIrda() { |
142 | if ( !m_irDa.count() ) return; | ||
141 | if (m_irDaIt == m_irDa.end() ) { | 143 | if (m_irDaIt == m_irDa.end() ) { |
@@ -185,27 +187,30 @@ void SendWidget::send_to_receivers() { | |||
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 | 192 | ||
191 | if ( !QCopChannel::isRegistered("QPE/IrDaApplet") ) { | 193 | if ( !QCopChannel::isRegistered("QPE/IrDaApplet") ) |
194 | { | ||
192 | irdaStatus->setText(tr("not enabled.")); | 195 | irdaStatus->setText(tr("not enabled.")); |
193 | enable_irda=true; | 196 | } |
194 | } else | 197 | else |
198 | { | ||
199 | QCopEnvelope e1("QPE/IrDaApplet", "enableIrda()"); | ||
195 | irdaStatus->setText(tr("searching...")); | 200 | irdaStatus->setText(tr("searching...")); |
201 | sendButton->setEnabled( true ); | ||
202 | QCopEnvelope e2("QPE/IrDaApplet", "listDevices()"); | ||
203 | } | ||
196 | 204 | ||
197 | if ( !QCopChannel::isRegistered("QPE/Bluetooth") ) { | 205 | if ( !QCopChannel::isRegistered("QPE/Bluetooth") ) |
206 | { | ||
198 | btStatus->setText(tr("not enabled.")); | 207 | btStatus->setText(tr("not enabled.")); |
199 | enable_bt=true; | 208 | } |
200 | } else | 209 | else |
201 | btStatus->setText(tr("searching...")); | 210 | { |
202 | |||
203 | if (enable_irda) | ||
204 | QCopEnvelope e0("QPE/IrDaApplet", "enableIrda()"); | ||
205 | if (enable_bt) | ||
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 | } |
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 | |||
@@ -18,3 +18,3 @@ for selecting destination hosts.</comment> | |||
18 | <y>0</y> | 18 | <y>0</y> |
19 | <width>363</width> | 19 | <width>359</width> |
20 | <height>221</height> | 20 | <height>221</height> |
@@ -299,3 +299,3 @@ for selecting destination hosts.</comment> | |||
299 | <name>text</name> | 299 | <name>text</name> |
300 | <string>Scan</string> | 300 | <string>&Rescan</string> |
301 | </property> | 301 | </property> |
@@ -310,3 +310,3 @@ for selecting destination hosts.</comment> | |||
310 | <name>text</name> | 310 | <name>text</name> |
311 | <string>Send</string> | 311 | <string>&Send</string> |
312 | </property> | 312 | </property> |
@@ -321,3 +321,3 @@ for selecting destination hosts.</comment> | |||
321 | <name>text</name> | 321 | <name>text</name> |
322 | <string>Done</string> | 322 | <string>&Close</string> |
323 | </property> | 323 | </property> |