author | harlekin <harlekin> | 2002-06-12 22:30:51 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-06-12 22:30:51 (UTC) |
commit | 7239ae505999b64c74479c460daba256baf82798 (patch) (side-by-side diff) | |
tree | 6f140a09edb1aa7d6d12e7932169b3ae9db1e853 /core/applets/obex/obeximpl.cc | |
parent | 72a7f7c6450033e3a2411c29b1f5505725c95241 (diff) | |
download | opie-7239ae505999b64c74479c460daba256baf82798.zip opie-7239ae505999b64c74479c460daba256baf82798.tar.gz opie-7239ae505999b64c74479c460daba256baf82798.tar.bz2 |
some gui updates
Diffstat (limited to 'core/applets/obex/obeximpl.cc') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/applets/obex/obeximpl.cc | 27 |
1 files changed, 24 insertions, 3 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,9 +1,10 @@ #include <qdatastream.h> #include <qpe/qcom.h> +#include <qlabel.h> #include "obex.h" #include "obeximpl.h" @@ -11,19 +12,22 @@ using namespace OpieObex; ObexImpl::ObexImpl( ) : QObject() { // register to a channel qWarning( "c'tor" ); m_obex = new Obex(this, "obex"); + m_sendgui = new ObexDlg(); + m_recvgui = new ObexInc(); m_chan = new QCopChannel("QPE/Obex" ); connect(m_chan, SIGNAL(received(const QCString&, const QByteArray& ) ), this, SLOT(slotMessage(const QCString&, const QByteArray&) ) ); } ObexImpl::~ObexImpl() { delete m_obex; delete m_chan; + delete m_sendgui; } QRESULT ObexImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) { *iface = 0; if( uuid == IID_QUnknown ) *iface = this; else if( uuid == IID_ObexInterface ) @@ -40,19 +44,36 @@ void ObexImpl::slotMessage( const QCString& msg, const QByteArray&data ) { qWarning("Message %s", msg.data() ); if(msg == "send(QString,QString,QString)" ) { QString desc; stream >> desc; QString filename; stream >> filename; + m_sendgui->showMaximized(); + m_sendgui->lblPath->setText(filename); + connect( (QObject*)m_sendgui->PushButton2, SIGNAL(clicked()), + this, SLOT(slotCancelSend())); m_obex->send(filename ); - // QCopEnvelope e ("QPE/Obex", "done(QString)" ); but this into a slot + // QCopEnvelope e ("QPE/Obex", "done(QString)" ); //but this into a slot //e << filename; + }else if(msg == "receive(bool)" ) { // open a GUI - m_obex->receive(); - ; + m_recvgui->showMaximized(); + m_obex->receive(); + + } else if (msg =="done(QString)") { + QString filename; + stream >> filename; + m_sendgui->lblPath->setText(tr("Done transfering " + filename)); + } } +void ObexImpl::slotCancelSend() { + // cancel sync process too + m_sendgui->hide(); +} + + Q_EXPORT_INTERFACE() { Q_CREATE_INSTANCE( ObexImpl ) } |