-rw-r--r-- | core/obex/obexsend.cpp | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/core/obex/obexsend.cpp b/core/obex/obexsend.cpp index cd8d58e..f3dd11c 100644 --- a/core/obex/obexsend.cpp +++ b/core/obex/obexsend.cpp | |||
@@ -1,22 +1,23 @@ | |||
1 | #include "obex.h" | ||
2 | #include "obexsend.h" | ||
3 | using namespace OpieObex; | ||
4 | |||
5 | /* OPIE */ | ||
6 | #include <opie2/odebug.h> | ||
7 | #include <qpe/qcopenvelope_qws.h> | ||
8 | using namespace Opie::Core; | ||
9 | |||
10 | /* QT */ | ||
1 | #include <qpushbutton.h> | 11 | #include <qpushbutton.h> |
2 | #include <qlabel.h> | 12 | #include <qlabel.h> |
3 | #include <qlayout.h> | 13 | #include <qlayout.h> |
4 | #include <qtimer.h> | 14 | #include <qtimer.h> |
5 | 15 | ||
6 | |||
7 | #include <qpe/qcopenvelope_qws.h> | ||
8 | |||
9 | #include "obex.h" | ||
10 | #include "obexsend.h" | ||
11 | |||
12 | using namespace OpieObex; | ||
13 | |||
14 | /* TRANSLATOR OpieObex::SendWidget */ | 16 | /* TRANSLATOR OpieObex::SendWidget */ |
15 | 17 | ||
16 | |||
17 | SendWidget::SendWidget( QWidget* parent, const char* name ) | 18 | SendWidget::SendWidget( QWidget* parent, const char* name ) |
18 | : QWidget( parent, name ) { | 19 | : QWidget( parent, name ) { |
19 | initUI(); | 20 | initUI(); |
20 | } | 21 | } |
21 | SendWidget::~SendWidget() { | 22 | SendWidget::~SendWidget() { |
22 | } | 23 | } |
@@ -101,13 +102,13 @@ void SendWidget::send( const QString& file, const QString& desc ) { | |||
101 | QCopEnvelope e1("QPE/Bluetooth", "enableBluetooth()"); | 102 | QCopEnvelope e1("QPE/Bluetooth", "enableBluetooth()"); |
102 | QCopEnvelope e2("QPE/IrDaApplet", "listDevices()"); | 103 | QCopEnvelope e2("QPE/IrDaApplet", "listDevices()"); |
103 | QCopEnvelope e3("QPE/Bluetooth", "listDevices()"); | 104 | QCopEnvelope e3("QPE/Bluetooth", "listDevices()"); |
104 | } | 105 | } |
105 | } | 106 | } |
106 | void SendWidget::slotIrDaDevices( const QStringList& list) { | 107 | void SendWidget::slotIrDaDevices( const QStringList& list) { |
107 | qWarning("slot it irda devices "); | 108 | owarn << "slot it irda devices " << oendl; |
108 | for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) { | 109 | for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) { |
109 | int id = m_devBox->addDevice( (*it), DeviceBox::IrDa, tr("Scheduling for beam.") ); | 110 | int id = m_devBox->addDevice( (*it), DeviceBox::IrDa, tr("Scheduling for beam.") ); |
110 | m_irDa.insert( id, (*it) ); | 111 | m_irDa.insert( id, (*it) ); |
111 | } | 112 | } |
112 | m_devBox->removeDevice( m_irDeSearch ); | 113 | m_devBox->removeDevice( m_irDeSearch ); |
113 | m_irDaIt = m_irDa.begin(); | 114 | m_irDaIt = m_irDa.begin(); |
@@ -120,22 +121,22 @@ void SendWidget::slotBTDevices( const QMap<QString, QString>& str ) { | |||
120 | int id = m_devBox->addDevice( it.key(), DeviceBox::BT, tr("Click to beam") ); | 121 | int id = m_devBox->addDevice( it.key(), DeviceBox::BT, tr("Click to beam") ); |
121 | m_bt.insert( id, Pair( it.key(), it.data() ) ); | 122 | m_bt.insert( id, Pair( it.key(), it.data() ) ); |
122 | } | 123 | } |
123 | m_devBox->removeDevice( m_btDeSearch ); | 124 | m_devBox->removeDevice( m_btDeSearch ); |
124 | } | 125 | } |
125 | void SendWidget::slotSelectedDevice( int name, int dev ) { | 126 | void SendWidget::slotSelectedDevice( int name, int dev ) { |
126 | qWarning("Start beam? %d %d", name, dev ); | 127 | owarn << "Start beam? " << name << " " << dev << "" << oendl; |
127 | if ( name == m_irDeSearch ) { | 128 | if ( name == m_irDeSearch ) { |
128 | for (QMap<int, QString>::Iterator it= m_irDa.begin(); it != m_irDa.end(); ++it ) | 129 | for (QMap<int, QString>::Iterator it= m_irDa.begin(); it != m_irDa.end(); ++it ) |
129 | m_devBox->removeDevice( it.key() ); | 130 | m_devBox->removeDevice( it.key() ); |
130 | 131 | ||
131 | QCopEnvelope e2("QPE/IrDaApplet", "listDevices()"); | 132 | QCopEnvelope e2("QPE/IrDaApplet", "listDevices()"); |
132 | } | 133 | } |
133 | } | 134 | } |
134 | void SendWidget::dispatchIrda( const QCString& str, const QByteArray& ar ) { | 135 | void SendWidget::dispatchIrda( const QCString& str, const QByteArray& ar ) { |
135 | qWarning("dispatch irda %s", str.data() ); | 136 | owarn << "dispatch irda " << str.data() << "" << oendl; |
136 | if ( str == "devices(QStringList)" ) { | 137 | if ( str == "devices(QStringList)" ) { |
137 | QDataStream stream( ar, IO_ReadOnly ); | 138 | QDataStream stream( ar, IO_ReadOnly ); |
138 | QStringList list; | 139 | QStringList list; |
139 | stream >> list; | 140 | stream >> list; |
140 | slotIrDaDevices( list ); | 141 | slotIrDaDevices( list ); |
141 | } | 142 | } |
@@ -144,13 +145,13 @@ void SendWidget::dispatchBt( const QCString&, const QByteArray& ) { | |||
144 | 145 | ||
145 | } | 146 | } |
146 | void SendWidget::slotIrError( int ) { | 147 | void SendWidget::slotIrError( int ) { |
147 | 148 | ||
148 | } | 149 | } |
149 | void SendWidget::slotIrSent( bool b) { | 150 | void SendWidget::slotIrSent( bool b) { |
150 | qWarning("irda sent!!"); | 151 | owarn << "irda sent!!" << oendl; |
151 | QString text = b ? tr("Sent") : tr("Failure"); | 152 | QString text = b ? tr("Sent") : tr("Failure"); |
152 | m_devBox->setStatus( m_irDaIt.key(), text ); | 153 | m_devBox->setStatus( m_irDaIt.key(), text ); |
153 | ++m_irDaIt; | 154 | ++m_irDaIt; |
154 | slotStartIrda(); | 155 | slotStartIrda(); |
155 | } | 156 | } |
156 | void SendWidget::slotIrTry(unsigned int trI) { | 157 | void SendWidget::slotIrTry(unsigned int trI) { |
@@ -201,13 +202,13 @@ void DeviceBox::removeDevice( int id ) { | |||
201 | void DeviceBox::setStatus( int id, const QString& status ) { | 202 | void DeviceBox::setStatus( int id, const QString& status ) { |
202 | if ( !m_dev.contains(id) ) return; | 203 | if ( !m_dev.contains(id) ) return; |
203 | m_dev[id].setStatus(status ); | 204 | m_dev[id].setStatus(status ); |
204 | setText( allText() ); | 205 | setText( allText() ); |
205 | } | 206 | } |
206 | void DeviceBox::setSource( const QString& str ) { | 207 | void DeviceBox::setSource( const QString& str ) { |
207 | qWarning("SetSource:%d", str.toInt() ); | 208 | owarn << "SetSource:" << str.toInt() << "" << oendl; |
208 | int id = str.toInt(); | 209 | int id = str.toInt(); |
209 | emit selectedDevice( id, m_dev[id].device() ); | 210 | emit selectedDevice( id, m_dev[id].device() ); |
210 | } | 211 | } |
211 | int DeviceBox::idFor ( int id ) { | 212 | int DeviceBox::idFor ( int id ) { |
212 | static int irId = 1501; | 213 | static int irId = 1501; |
213 | static int irBT = 1001; | 214 | static int irBT = 1001; |