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.cpp41
1 files changed, 23 insertions, 18 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
@@ -14,12 +14,13 @@ using namespace OpieObex;
14#include <qpe/resource.h> 14#include <qpe/resource.h>
15 15
16using namespace Opie::Core; 16using 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>
23 24
24/* TRANSLATOR OpieObex::SendWidget */ 25/* TRANSLATOR OpieObex::SendWidget */
25 26
@@ -135,12 +136,13 @@ void SendWidget::slotIrSent( bool b) {
135 slotStartIrda(); 136 slotStartIrda();
136} 137}
137void SendWidget::slotIrTry(unsigned int trI) { 138void 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}
140void SendWidget::slotStartIrda() { 141void SendWidget::slotStartIrda() {
142 if ( !m_irDa.count() ) return;
141 if (m_irDaIt == m_irDa.end() ) { 143 if (m_irDaIt == m_irDa.end() ) {
142 irdaStatus->setText(tr("complete.")); 144 irdaStatus->setText(tr("complete."));
143 return; 145 return;
144 } 146 }
145 setReceiverStatus( m_irDaIt.key(), tr("Start sending") ); 147 setReceiverStatus( m_irDaIt.key(), tr("Start sending") );
146 m_obex->send( m_file ); 148 m_obex->send( m_file );
@@ -180,37 +182,40 @@ void SendWidget::slotStartBt() {
180 182
181void SendWidget::send_to_receivers() { 183void SendWidget::send_to_receivers() {
182 slotStartIrda(); 184 slotStartIrda();
183 slotStartBt(); 185 slotStartBt();
184} 186}
185 187
186void SendWidget::scan_for_receivers() { 188void 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}
212 217
213void SendWidget::toggle_receiver(QListViewItem* item) 218void SendWidget::toggle_receiver(QListViewItem* item)
214{ 219{
215 // toggle the state of an individual receiver. 220 // toggle the state of an individual receiver.
216 if(item->pixmap(2)) 221 if(item->pixmap(2))