author | mickeyl <mickeyl> | 2006-05-02 08:57:25 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2006-05-02 08:57:25 (UTC) |
commit | d5b6868cb4f99d2c3dc3587115cd37c09e4610eb (patch) (side-by-side diff) | |
tree | 1397f12f885c849419e511ad203d19696c4ae07e /core/obex/obexsend.cpp | |
parent | 1295db77f2ab7e9125183e4240de0b92f72940e4 (diff) | |
download | opie-d5b6868cb4f99d2c3dc3587115cd37c09e4610eb.zip opie-d5b6868cb4f99d2c3dc3587115cd37c09e4610eb.tar.gz opie-d5b6868cb4f99d2c3dc3587115cd37c09e4610eb.tar.bz2 |
bluetooth patches courtesy Dmitriy Korovkin (thanks!):
* When sending data to a device, do service discovery in order to get port number.
* Switched to ussp-push for sending.
* Clear receivers list on rescan.
* Changed the way of window closing in order to shut down IRDA and bluetooth correctly.
-rw-r--r-- | core/obex/obexsend.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/core/obex/obexsend.cpp b/core/obex/obexsend.cpp index 9cd9972..dbbb7b3 100644 --- a/core/obex/obexsend.cpp +++ b/core/obex/obexsend.cpp @@ -20,8 +20,8 @@ using namespace Opie::Core; #include <qpushbutton.h> #include <qpixmap.h> #include <qlistview.h> -#include <qtimer.h> +#include <unistd.h> /* TRANSLATOR OpieObex::SendWidget */ SendWidget::SendWidget( QWidget* parent, const char* name ) @@ -83,7 +83,7 @@ int SendWidget::addReceiver(const char *r, const char *icon) bool SendWidget::receiverSelected(int id) { - return receivers[id]->pixmap(2); + return (bool)(receivers[id]->pixmap(2) != NULL); } void SendWidget::setReceiverStatus( int id, const QString& status ) { @@ -141,7 +141,7 @@ void SendWidget::slotIrTry(unsigned int trI) { void SendWidget::slotStartIrda() { if ( !m_irDa.count() ) return; if ( m_irDaIt == m_irDa.end() ) { - irdaStatus->setText(tr("complete.")); + irdaStatus->setText(tr("complete.")); return; } setReceiverStatus( m_irDaIt.key(), tr("Start sending") ); @@ -173,7 +173,7 @@ void SendWidget::slotStartBt() { while((m_btIt != m_bt.end()) && !receiverSelected(m_btIt.key())) ++m_btIt; if (m_btIt == m_bt.end() ) { - btStatus->setText(tr("complete.")); + btStatus->setText(tr("complete.")); return; } setReceiverStatus( m_btIt.key(), tr("Start sending") ); @@ -187,7 +187,8 @@ void SendWidget::send_to_receivers() { void SendWidget::scan_for_receivers() { - //FIXME: Clean ListBox prior to (re)scan + receiverList->clear(); + receivers.clear(); sendButton->setDisabled( true ); if ( !QCopChannel::isRegistered("QPE/IrDaApplet") ) @@ -219,21 +220,22 @@ void SendWidget::toggle_receiver(QListViewItem* item) { // toggle the state of an individual receiver. if(item->pixmap(2)) - item->setPixmap(2,QPixmap()); + item->setPixmap(2,QPixmap()); else - item->setPixmap(2,Resource::loadPixmap("backup/check.png")); + item->setPixmap(2,Resource::loadPixmap("backup/check.png")); } void SendWidget::closeEvent( QCloseEvent* e) { - e->accept(); // make sure - QTimer::singleShot(0, this, SLOT(userDone() ) ); -} -void SendWidget::userDone() { + obexSendBase::closeEvent(e); QCopEnvelope e0("QPE/IrDaApplet", "disableIrda()"); QCopEnvelope e1("QPE/Bluetooth", "disableBluetooth()"); - emit done(); } + +void SendWidget::userDone() { + close(); +} + QString SendWidget::file()const { return m_file; } |