summaryrefslogtreecommitdiff
path: root/core/applets/obex/obeximpl.cc
authorharlekin <harlekin>2002-06-12 22:30:51 (UTC)
committer harlekin <harlekin>2002-06-12 22:30:51 (UTC)
commit7239ae505999b64c74479c460daba256baf82798 (patch) (unidiff)
tree6f140a09edb1aa7d6d12e7932169b3ae9db1e853 /core/applets/obex/obeximpl.cc
parent72a7f7c6450033e3a2411c29b1f5505725c95241 (diff)
downloadopie-7239ae505999b64c74479c460daba256baf82798.zip
opie-7239ae505999b64c74479c460daba256baf82798.tar.gz
opie-7239ae505999b64c74479c460daba256baf82798.tar.bz2
some gui updates
Diffstat (limited to 'core/applets/obex/obeximpl.cc') (more/less context) (show whitespace changes)
-rw-r--r--core/applets/obex/obeximpl.cc25
1 files changed, 23 insertions, 2 deletions
diff --git a/core/applets/obex/obeximpl.cc b/core/applets/obex/obeximpl.cc
index e787fca..616f3b1 100644
--- a/core/applets/obex/obeximpl.cc
+++ b/core/applets/obex/obeximpl.cc
@@ -1,6 +1,7 @@
1 1
2#include <qdatastream.h> 2#include <qdatastream.h>
3#include <qpe/qcom.h> 3#include <qpe/qcom.h>
4#include <qlabel.h>
4 5
5#include "obex.h" 6#include "obex.h"
6#include "obeximpl.h" 7#include "obeximpl.h"
@@ -14,6 +15,8 @@ ObexImpl::ObexImpl( )
14 // register to a channel 15 // register to a channel
15 qWarning( "c'tor" ); 16 qWarning( "c'tor" );
16 m_obex = new Obex(this, "obex"); 17 m_obex = new Obex(this, "obex");
18 m_sendgui = new ObexDlg();
19 m_recvgui = new ObexInc();
17 m_chan = new QCopChannel("QPE/Obex" ); 20 m_chan = new QCopChannel("QPE/Obex" );
18 connect(m_chan, SIGNAL(received(const QCString&, const QByteArray& ) ), 21 connect(m_chan, SIGNAL(received(const QCString&, const QByteArray& ) ),
19 this, SLOT(slotMessage(const QCString&, const QByteArray&) ) ); 22 this, SLOT(slotMessage(const QCString&, const QByteArray&) ) );
@@ -21,6 +24,7 @@ ObexImpl::ObexImpl( )
21ObexImpl::~ObexImpl() { 24ObexImpl::~ObexImpl() {
22 delete m_obex; 25 delete m_obex;
23 delete m_chan; 26 delete m_chan;
27 delete m_sendgui;
24} 28}
25QRESULT ObexImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) { 29QRESULT ObexImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) {
26 *iface = 0; 30 *iface = 0;
@@ -43,15 +47,32 @@ void ObexImpl::slotMessage( const QCString& msg, const QByteArray&data ) {
43 stream >> desc; 47 stream >> desc;
44 QString filename; 48 QString filename;
45 stream >> filename; 49 stream >> filename;
50 m_sendgui->showMaximized();
51 m_sendgui->lblPath->setText(filename);
52 connect( (QObject*)m_sendgui->PushButton2, SIGNAL(clicked()),
53 this, SLOT(slotCancelSend()));
46 m_obex->send(filename ); 54 m_obex->send(filename );
47 // QCopEnvelope e ("QPE/Obex", "done(QString)" ); but this into a slot 55 // QCopEnvelope e ("QPE/Obex", "done(QString)" ); //but this into a slot
48 //e << filename; 56 //e << filename;
57
49 }else if(msg == "receive(bool)" ) { // open a GUI 58 }else if(msg == "receive(bool)" ) { // open a GUI
59 m_recvgui->showMaximized();
50 m_obex->receive(); 60 m_obex->receive();
51 ; 61
62 } else if (msg =="done(QString)") {
63 QString filename;
64 stream >> filename;
65 m_sendgui->lblPath->setText(tr("Done transfering " + filename));
66
67 }
52 } 68 }
69
70void ObexImpl::slotCancelSend() {
71 // cancel sync process too
72 m_sendgui->hide();
53} 73}
54 74
75
55Q_EXPORT_INTERFACE() 76Q_EXPORT_INTERFACE()
56{ 77{
57 Q_CREATE_INSTANCE( ObexImpl ) 78 Q_CREATE_INSTANCE( ObexImpl )