-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 @@ -19,2 +19,3 @@ using namespace Opie::Core; #include <qlabel.h> +#include <qpushbutton.h> #include <qpixmap.h> @@ -140,3 +141,4 @@ void SendWidget::slotIrTry(unsigned int trI) { void SendWidget::slotStartIrda() { - if (m_irDaIt == m_irDa.end() ) { + if ( !m_irDa.count() ) return; + if ( m_irDaIt == m_irDa.end() ) { irdaStatus->setText(tr("complete.")); @@ -185,27 +187,30 @@ void SendWidget::send_to_receivers() { -void SendWidget::scan_for_receivers() { - - bool enable_irda=false; - bool enable_bt=false; - - if ( !QCopChannel::isRegistered("QPE/IrDaApplet") ) { - irdaStatus->setText(tr("not enabled.")); - enable_irda=true; - } else - irdaStatus->setText(tr("searching...")); +void SendWidget::scan_for_receivers() +{ + //FIXME: Clean ListBox prior to (re)scan + sendButton->setDisabled( true ); - if ( !QCopChannel::isRegistered("QPE/Bluetooth") ) { - btStatus->setText(tr("not enabled.")); - enable_bt=true; - } else - btStatus->setText(tr("searching...")); + if ( !QCopChannel::isRegistered("QPE/IrDaApplet") ) + { + irdaStatus->setText(tr("not enabled.")); + } + else + { + QCopEnvelope e1("QPE/IrDaApplet", "enableIrda()"); + irdaStatus->setText(tr("searching...")); + sendButton->setEnabled( true ); + QCopEnvelope e2("QPE/IrDaApplet", "listDevices()"); + } - if (enable_irda) - QCopEnvelope e0("QPE/IrDaApplet", "enableIrda()"); - if (enable_bt) + if ( !QCopChannel::isRegistered("QPE/Bluetooth") ) + { + btStatus->setText(tr("not enabled.")); + } + else + { QCopEnvelope e1("QPE/Bluetooth", "enableBluetooth()"); - - QCopEnvelope e2("QPE/IrDaApplet", "listDevices()"); - QCopEnvelope e3("QPE/Bluetooth", "listDevices()"); - + btStatus->setText(tr("searching...")); + sendButton->setEnabled( true ); + QCopEnvelope e3("QPE/Bluetooth", "listDevices()"); + } } 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> <y>0</y> - <width>363</width> + <width>359</width> <height>221</height> @@ -299,3 +299,3 @@ for selecting destination hosts.</comment> <name>text</name> - <string>Scan</string> + <string>&Rescan</string> </property> @@ -310,3 +310,3 @@ for selecting destination hosts.</comment> <name>text</name> - <string>Send</string> + <string>&Send</string> </property> @@ -321,3 +321,3 @@ for selecting destination hosts.</comment> <name>text</name> - <string>Done</string> + <string>&Close</string> </property> |