author | mickeyl <mickeyl> | 2006-07-07 10:39:20 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2006-07-07 10:39:20 (UTC) |
commit | 043999046de3e7088ef386f18348ebe4484b0e65 (patch) (unidiff) | |
tree | c46908a6ccc183713b98c2ccbf4e0134c74d66b1 | |
parent | 9fb74057cd43bf6ac0cb50c617f9146457367cbc (diff) | |
download | opie-043999046de3e7088ef386f18348ebe4484b0e65.zip opie-043999046de3e7088ef386f18348ebe4484b0e65.tar.gz opie-043999046de3e7088ef386f18348ebe4484b0e65.tar.bz2 |
s/Resource/OResource/
-rw-r--r-- | core/obex/obexsend.cpp | 10 | ||||
-rw-r--r-- | noncore/net/opietooth/applet/bluezapplet.cpp | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/core/obex/obexsend.cpp b/core/obex/obexsend.cpp index 9a30a0a..2512de3 100644 --- a/core/obex/obexsend.cpp +++ b/core/obex/obexsend.cpp | |||
@@ -1,38 +1,38 @@ | |||
1 | // 7-Jul-2005 mbh@sdgsystems.com: replace hand coded form with one | 1 | // 7-Jul-2005 mbh@sdgsystems.com: replace hand coded form with one |
2 | // generated via QT2 Designer. The new form supports | 2 | // generated via QT2 Designer. The new form supports |
3 | // selection of target devices, as opposed to sending to | 3 | // selection of target devices, as opposed to sending to |
4 | // all. | 4 | // all. |
5 | 5 | ||
6 | #include "obex.h" | 6 | #include "obex.h" |
7 | #include "btobex.h" | 7 | #include "btobex.h" |
8 | #include "obexsend.h" | 8 | #include "obexsend.h" |
9 | using namespace OpieObex; | 9 | using namespace OpieObex; |
10 | 10 | ||
11 | /* OPIE */ | 11 | /* OPIE */ |
12 | #include <opie2/odebug.h> | 12 | #include <opie2/odebug.h> |
13 | #include <qpe/qcopenvelope_qws.h> | 13 | #include <qpe/qcopenvelope_qws.h> |
14 | #include <qpe/resource.h> | 14 | #include <opie2/oresource.h> |
15 | 15 | ||
16 | using namespace Opie::Core; | 16 | 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 | 23 | ||
24 | #include <unistd.h> | 24 | #include <unistd.h> |
25 | /* TRANSLATOR OpieObex::SendWidget */ | 25 | /* TRANSLATOR OpieObex::SendWidget */ |
26 | 26 | ||
27 | SendWidget::SendWidget( QWidget* parent, const char* name ) | 27 | SendWidget::SendWidget( QWidget* parent, const char* name ) |
28 | : obexSendBase( parent, name ) { | 28 | : obexSendBase( parent, name ) { |
29 | initUI(); | 29 | initUI(); |
30 | } | 30 | } |
31 | SendWidget::~SendWidget() { | 31 | SendWidget::~SendWidget() { |
32 | } | 32 | } |
33 | void SendWidget::initUI() { | 33 | void SendWidget::initUI() { |
34 | m_obex = new Obex(this, "obex"); | 34 | m_obex = new Obex(this, "obex"); |
35 | connect(m_obex, SIGNAL(error(int) ), | 35 | connect(m_obex, SIGNAL(error(int) ), |
36 | this, SLOT(slotIrError(int) ) ); | 36 | this, SLOT(slotIrError(int) ) ); |
37 | connect(m_obex, SIGNAL(sent(bool) ), | 37 | connect(m_obex, SIGNAL(sent(bool) ), |
38 | this, SLOT(slotIrSent(bool) ) ); | 38 | this, SLOT(slotIrSent(bool) ) ); |
@@ -53,49 +53,49 @@ void SendWidget::initUI() { | |||
53 | 53 | ||
54 | chan = new QCopChannel("QPE/BluetoothBack", this ); | 54 | chan = new QCopChannel("QPE/BluetoothBack", this ); |
55 | connect(chan, SIGNAL(received(const QCString&,const QByteArray&) ), | 55 | connect(chan, SIGNAL(received(const QCString&,const QByteArray&) ), |
56 | this, SLOT(dispatchBt(const QCString&,const QByteArray&) ) ); | 56 | this, SLOT(dispatchBt(const QCString&,const QByteArray&) ) ); |
57 | 57 | ||
58 | } | 58 | } |
59 | 59 | ||
60 | /* | 60 | /* |
61 | * in send we'll first set everything up | 61 | * in send we'll first set everything up |
62 | * and then wait for a list of devices. | 62 | * and then wait for a list of devices. |
63 | */ | 63 | */ |
64 | void SendWidget::send( const QString& file, const QString& desc ) { | 64 | void SendWidget::send( const QString& file, const QString& desc ) { |
65 | m_file = file; | 65 | m_file = file; |
66 | m_irDa.clear(); | 66 | m_irDa.clear(); |
67 | m_start = 0; | 67 | m_start = 0; |
68 | 68 | ||
69 | fileToSend->setText(desc.isEmpty() ? file : desc ); | 69 | fileToSend->setText(desc.isEmpty() ? file : desc ); |
70 | scan_for_receivers(); | 70 | scan_for_receivers(); |
71 | } | 71 | } |
72 | 72 | ||
73 | int SendWidget::addReceiver(const char *r, const char *icon) | 73 | int SendWidget::addReceiver(const char *r, const char *icon) |
74 | { | 74 | { |
75 | QListViewItem * item = new QListViewItem( receiverList, 0 ); | 75 | QListViewItem * item = new QListViewItem( receiverList, 0 ); |
76 | item->setText( 0, r); | 76 | item->setText( 0, r); |
77 | item->setPixmap( 1, Resource::loadPixmap( icon ) ); | 77 | item->setPixmap( 1, OResource::loadPixmap( icon ) ); |
78 | 78 | ||
79 | int id=receivers.count(); | 79 | int id=receivers.count(); |
80 | receivers[id]=item; | 80 | receivers[id]=item; |
81 | return id; | 81 | return id; |
82 | } | 82 | } |
83 | 83 | ||
84 | bool SendWidget::receiverSelected(int id) | 84 | bool SendWidget::receiverSelected(int id) |
85 | { | 85 | { |
86 | return (bool)(receivers[id]->pixmap(2) != NULL); | 86 | return (bool)(receivers[id]->pixmap(2) != NULL); |
87 | } | 87 | } |
88 | 88 | ||
89 | void SendWidget::setReceiverStatus( int id, const QString& status ) { | 89 | void 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 | } |
93 | 93 | ||
94 | void SendWidget::slotIrDaDevices( const QStringList& list) { | 94 | void SendWidget::slotIrDaDevices( const QStringList& list) { |
95 | for (QStringList::ConstIterator it = list.begin(); | 95 | for (QStringList::ConstIterator it = list.begin(); |
96 | it != list.end(); ++it ) { | 96 | it != list.end(); ++it ) { |
97 | int id = addReceiver(*it, "obex/irda.png"); | 97 | int id = addReceiver(*it, "obex/irda.png"); |
98 | m_irDa.insert( id, (*it) ); | 98 | m_irDa.insert( id, (*it) ); |
99 | } | 99 | } |
100 | irdaStatus->setText( tr("ready.")); | 100 | irdaStatus->setText( tr("ready.")); |
101 | m_irDaIt = m_irDa.begin(); | 101 | m_irDaIt = m_irDa.begin(); |
@@ -201,52 +201,52 @@ void SendWidget::scan_for_receivers() | |||
201 | else | 201 | else |
202 | { | 202 | { |
203 | QCopEnvelope e1("QPE/IrDaApplet", "enableIrda()"); | 203 | QCopEnvelope e1("QPE/IrDaApplet", "enableIrda()"); |
204 | irdaStatus->setText(tr("searching...")); | 204 | irdaStatus->setText(tr("searching...")); |
205 | sendButton->setEnabled( true ); | 205 | sendButton->setEnabled( true ); |
206 | QCopEnvelope e2("QPE/IrDaApplet", "listDevices()"); | 206 | QCopEnvelope e2("QPE/IrDaApplet", "listDevices()"); |
207 | } | 207 | } |
208 | 208 | ||
209 | if ( !QCopChannel::isRegistered("QPE/Bluetooth") ) | 209 | if ( !QCopChannel::isRegistered("QPE/Bluetooth") ) |
210 | { | 210 | { |
211 | btStatus->setText(tr("not enabled.")); | 211 | btStatus->setText(tr("not enabled.")); |
212 | } | 212 | } |
213 | else | 213 | else |
214 | { | 214 | { |
215 | QCopEnvelope e1("QPE/Bluetooth", "enableBluetooth()"); | 215 | QCopEnvelope e1("QPE/Bluetooth", "enableBluetooth()"); |
216 | btStatus->setText(tr("searching...")); | 216 | btStatus->setText(tr("searching...")); |
217 | sendButton->setEnabled( true ); | 217 | sendButton->setEnabled( true ); |
218 | QCopEnvelope e3("QPE/Bluetooth", "listDevices()"); | 218 | QCopEnvelope e3("QPE/Bluetooth", "listDevices()"); |
219 | } | 219 | } |
220 | } | 220 | } |
221 | 221 | ||
222 | void SendWidget::toggle_receiver(QListViewItem* item) | 222 | void SendWidget::toggle_receiver(QListViewItem* item) |
223 | { | 223 | { |
224 | // toggle the state of an individual receiver. | 224 | // toggle the state of an individual receiver. |
225 | if(item->pixmap(2)) | 225 | if (item->pixmap(2)) |
226 | item->setPixmap(2,QPixmap()); | 226 | item->setPixmap(2, QPixmap()); |
227 | else | 227 | else |
228 | item->setPixmap(2,Resource::loadPixmap("obex/check.png")); | 228 | item->setPixmap(2, OResource::loadPixmap("obex/check.png")); |
229 | } | 229 | } |
230 | 230 | ||
231 | 231 | ||
232 | void SendWidget::closeEvent( QCloseEvent* evt) { | 232 | void SendWidget::closeEvent( QCloseEvent* evt) { |
233 | delete m_obex; | 233 | delete m_obex; |
234 | m_obex = NULL; | 234 | m_obex = NULL; |
235 | delete m_btobex; | 235 | delete m_btobex; |
236 | m_btobex = NULL; | 236 | m_btobex = NULL; |
237 | obexSendBase::closeEvent(evt); | 237 | obexSendBase::closeEvent(evt); |
238 | { | 238 | { |
239 | QCopEnvelope e("QPE/IrDaApplet", "disableIrda()"); | 239 | QCopEnvelope e("QPE/IrDaApplet", "disableIrda()"); |
240 | } | 240 | } |
241 | { | 241 | { |
242 | QCopEnvelope e("QPE/Bluetooth", "disableBluetooth()"); | 242 | QCopEnvelope e("QPE/Bluetooth", "disableBluetooth()"); |
243 | } | 243 | } |
244 | } | 244 | } |
245 | 245 | ||
246 | void SendWidget::userDone() { | 246 | void SendWidget::userDone() { |
247 | close(); | 247 | close(); |
248 | } | 248 | } |
249 | 249 | ||
250 | QString SendWidget::file()const { | 250 | QString SendWidget::file()const { |
251 | return m_file; | 251 | return m_file; |
252 | } | 252 | } |
diff --git a/noncore/net/opietooth/applet/bluezapplet.cpp b/noncore/net/opietooth/applet/bluezapplet.cpp index 91ab2e1..8498afc 100644 --- a/noncore/net/opietooth/applet/bluezapplet.cpp +++ b/noncore/net/opietooth/applet/bluezapplet.cpp | |||
@@ -48,49 +48,49 @@ using namespace Opie::Core; | |||
48 | #include <qlayout.h> | 48 | #include <qlayout.h> |
49 | #include <qframe.h> | 49 | #include <qframe.h> |
50 | #include <qpixmap.h> | 50 | #include <qpixmap.h> |
51 | #include <qstring.h> | 51 | #include <qstring.h> |
52 | #include <qtimer.h> | 52 | #include <qtimer.h> |
53 | #include <qpopupmenu.h> | 53 | #include <qpopupmenu.h> |
54 | #include <qmessagebox.h> | 54 | #include <qmessagebox.h> |
55 | 55 | ||
56 | /* STD */ | 56 | /* STD */ |
57 | #include <device.h> | 57 | #include <device.h> |
58 | 58 | ||
59 | namespace OpieTooth { | 59 | namespace OpieTooth { |
60 | BluezApplet::BluezApplet( QWidget *parent, const char *name ) : QWidget( parent, name ) { | 60 | BluezApplet::BluezApplet( QWidget *parent, const char *name ) : QWidget( parent, name ) { |
61 | setFixedHeight( AppLnk::smallIconSize() ); | 61 | setFixedHeight( AppLnk::smallIconSize() ); |
62 | setFixedWidth( AppLnk::smallIconSize() ); | 62 | setFixedWidth( AppLnk::smallIconSize() ); |
63 | #if OPIE_VERSION < 102010 | 63 | #if OPIE_VERSION < 102010 |
64 | bluezOnPixmap = Resource::loadPixmap( "bluetoothapplet/bluezon" ); | 64 | bluezOnPixmap = Resource::loadPixmap( "bluetoothapplet/bluezon" ); |
65 | bluezOffPixmap = Resource::loadPixmap( "bluetoothapplet/bluezoff" ); | 65 | bluezOffPixmap = Resource::loadPixmap( "bluetoothapplet/bluezoff" ); |
66 | bluezDiscoveryOnPixmap = Resource::loadPixmap( "bluetoothapplet/magglass.png" ); | 66 | bluezDiscoveryOnPixmap = Resource::loadPixmap( "bluetoothapplet/magglass.png" ); |
67 | bluezReceiveOnPixmap = Resource::loadPixmap( "bluetoothapplet/receive.png" ); | 67 | bluezReceiveOnPixmap = Resource::loadPixmap( "bluetoothapplet/receive.png" ); |
68 | #else | 68 | #else |
69 | bluezOnPixmap = OResource::loadImage( "bluetoothapplet/bluezon", OResource::SmallIcon ); | 69 | bluezOnPixmap = OResource::loadImage( "bluetoothapplet/bluezon", OResource::SmallIcon ); |
70 | bluezOffPixmap = OResource::loadImage( "bluetoothapplet/bluezoff", Opie::Core::OResource::SmallIcon ); | 70 | bluezOffPixmap = OResource::loadImage( "bluetoothapplet/bluezoff", Opie::Core::OResource::SmallIcon ); |
71 | bluezDiscoveryOnPixmap = OResource::loadImage( "bluetoothapplet/bluezondiscovery", Opie::Core::OResource::SmallIcon ); | 71 | bluezDiscoveryOnPixmap = OResource::loadImage( "bluetoothapplet/bluezondiscovery", Opie::Core::OResource::SmallIcon ); |
72 | bluezReceiveOnPixmap = Resource::loadImage( "bluetoothapplet/bluezonreceive", Opie::Core::OResource::SmallIcon ); | 72 | bluezReceiveOnPixmap = OResource::loadImage( "bluetoothapplet/bluezonreceive", Opie::Core::OResource::SmallIcon ); |
73 | #endif | 73 | #endif |
74 | startTimer(2000); | 74 | startTimer(2000); |
75 | btDevice = 0; | 75 | btDevice = 0; |
76 | btManager = 0; | 76 | btManager = 0; |
77 | bluezactive = false; | 77 | bluezactive = false; |
78 | bluezDiscoveryActive = false; | 78 | bluezDiscoveryActive = false; |
79 | bluezReceiveActive = false; | 79 | bluezReceiveActive = false; |
80 | bluezReceiveChanged = false; | 80 | bluezReceiveChanged = false; |
81 | doListDevice = false; | 81 | doListDevice = false; |
82 | isScanning = false; | 82 | isScanning = false; |
83 | m_wasOn = false; | 83 | m_wasOn = false; |
84 | m_sync = false; | 84 | m_sync = false; |
85 | 85 | ||
86 | // TODO: determine whether this channel has to be closed at destruction time. | 86 | // TODO: determine whether this channel has to be closed at destruction time. |
87 | QCopChannel* chan = new QCopChannel("QPE/Bluetooth", this ); | 87 | QCopChannel* chan = new QCopChannel("QPE/Bluetooth", this ); |
88 | connect(chan, SIGNAL(received(const QCString&,const QByteArray&) ), | 88 | connect(chan, SIGNAL(received(const QCString&,const QByteArray&) ), |
89 | this, SLOT(slotMessage(const QCString&,const QByteArray&) ) ); | 89 | this, SLOT(slotMessage(const QCString&,const QByteArray&) ) ); |
90 | ::system("/etc/init.d/bluetooth stop >/dev/null 2>/dev/null"); | 90 | ::system("/etc/init.d/bluetooth stop >/dev/null 2>/dev/null"); |
91 | } | 91 | } |
92 | 92 | ||
93 | BluezApplet::~BluezApplet() { | 93 | BluezApplet::~BluezApplet() { |
94 | if ( btDevice ) { | 94 | if ( btDevice ) { |
95 | ::system("/etc/init.d/bluetooth stop >/dev/null 2>/dev/null"); | 95 | ::system("/etc/init.d/bluetooth stop >/dev/null 2>/dev/null"); |
96 | delete btDevice; | 96 | delete btDevice; |