summaryrefslogtreecommitdiff
path: root/core/obex/obexsend.cpp
Unidiff
Diffstat (limited to 'core/obex/obexsend.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/obex/obexsend.cpp18
1 files changed, 10 insertions, 8 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
@@ -17,14 +17,14 @@ using namespace Opie::Core;
17 17
18/* QT */ 18/* QT */
19#include <qlabel.h> 19#include <qlabel.h>
20#include <qpushbutton.h> 20#include <qpushbutton.h>
21#include <qpixmap.h> 21#include <qpixmap.h>
22#include <qlistview.h> 22#include <qlistview.h>
23#include <qtimer.h>
24 23
24#include <unistd.h>
25/* TRANSLATOR OpieObex::SendWidget */ 25/* TRANSLATOR OpieObex::SendWidget */
26 26
27SendWidget::SendWidget( QWidget* parent, const char* name ) 27SendWidget::SendWidget( QWidget* parent, const char* name )
28 : obexSendBase( parent, name ) { 28 : obexSendBase( parent, name ) {
29 initUI(); 29 initUI();
30} 30}
@@ -80,13 +80,13 @@ int SendWidget::addReceiver(const char *r, const char *icon)
80 receivers[id]=item; 80 receivers[id]=item;
81 return id; 81 return id;
82} 82}
83 83
84bool SendWidget::receiverSelected(int id) 84bool SendWidget::receiverSelected(int id)
85{ 85{
86 return receivers[id]->pixmap(2); 86 return (bool)(receivers[id]->pixmap(2) != NULL);
87} 87}
88 88
89void SendWidget::setReceiverStatus( int id, const QString& status ) { 89void SendWidget::setReceiverStatus( int id, const QString& status ) {
90 if ( !receivers.contains(id) ) return; 90 if ( !receivers.contains(id) ) return;
91 receivers[id]->setText(3, status ); 91 receivers[id]->setText(3, status );
92} 92}
@@ -184,13 +184,14 @@ void SendWidget::send_to_receivers() {
184 slotStartIrda(); 184 slotStartIrda();
185 slotStartBt(); 185 slotStartBt();
186} 186}
187 187
188void SendWidget::scan_for_receivers() 188void SendWidget::scan_for_receivers()
189{ 189{
190 //FIXME: Clean ListBox prior to (re)scan 190 receiverList->clear();
191 receivers.clear();
191 sendButton->setDisabled( true ); 192 sendButton->setDisabled( true );
192 193
193 if ( !QCopChannel::isRegistered("QPE/IrDaApplet") ) 194 if ( !QCopChannel::isRegistered("QPE/IrDaApplet") )
194 { 195 {
195 irdaStatus->setText(tr("not enabled.")); 196 irdaStatus->setText(tr("not enabled."));
196 } 197 }
@@ -223,17 +224,18 @@ void SendWidget::toggle_receiver(QListViewItem* item)
223 else 224 else
224 item->setPixmap(2,Resource::loadPixmap("backup/check.png")); 225 item->setPixmap(2,Resource::loadPixmap("backup/check.png"));
225} 226}
226 227
227 228
228void SendWidget::closeEvent( QCloseEvent* e) { 229void SendWidget::closeEvent( QCloseEvent* e) {
229 e->accept(); // make sure 230 obexSendBase::closeEvent(e);
230 QTimer::singleShot(0, this, SLOT(userDone() ) );
231}
232void SendWidget::userDone() {
233 QCopEnvelope e0("QPE/IrDaApplet", "disableIrda()"); 231 QCopEnvelope e0("QPE/IrDaApplet", "disableIrda()");
234 QCopEnvelope e1("QPE/Bluetooth", "disableBluetooth()"); 232 QCopEnvelope e1("QPE/Bluetooth", "disableBluetooth()");
235 emit done();
236} 233}
234
235void SendWidget::userDone() {
236 close();
237}
238
237QString SendWidget::file()const { 239QString SendWidget::file()const {
238 return m_file; 240 return m_file;
239} 241}