From 0f5a65dda7268881906743487672543ba8d3519f Mon Sep 17 00:00:00 2001 From: hash Date: Wed, 09 Oct 2002 19:37:41 +0000 Subject: added a file transfer button --- diff --git a/noncore/apps/opie-console/test/console.pro b/noncore/apps/opie-console/test/console.pro index 721b820..b10b651 100644 --- a/noncore/apps/opie-console/test/console.pro +++ b/noncore/apps/opie-console/test/console.pro @@ -2,10 +2,10 @@ TEMPLATE = app #CONFIG = qt warn_on release CONFIG = qt debug #DESTDIR = $(OPIEDIR)/bin -HEADERS = ../io_layer.h ../io_serial.h \ - senderui.h ../profile.h +HEADERS = ../io_layer.h ../io_serial.h ../sz_transfer.h ../file_layer.h\ + senderui.h ../profile.h SOURCES = ../io_layer.cpp ../io_serial.cpp \ - ../profile.cpp \ + ../profile.cpp ../sz_transfer.cpp ../file_layer.cpp\ main.cpp senderui.cpp INTERFACES = sender.ui INCLUDEPATH += $(OPIEDIR)/include diff --git a/noncore/apps/opie-console/test/sender.ui b/noncore/apps/opie-console/test/sender.ui index 092f6e3..b946b81 100644 --- a/noncore/apps/opie-console/test/sender.ui +++ b/noncore/apps/opie-console/test/sender.ui @@ -46,6 +46,17 @@ &Send + + QPushButton + + name + PushButton2 + + + text + Send &File + + @@ -56,5 +67,12 @@ slotSend() slotSend() + + PushButton2 + clicked() + Form1 + slotSendFile() + + slotSendFile() diff --git a/noncore/apps/opie-console/test/senderui.cpp b/noncore/apps/opie-console/test/senderui.cpp index fc93c04..24d3eb2 100644 --- a/noncore/apps/opie-console/test/senderui.cpp +++ b/noncore/apps/opie-console/test/senderui.cpp @@ -5,6 +5,7 @@ #include "../profile.h" #include "../io_serial.h" +#include "../sz_transfer.h" #include "senderui.h" @@ -14,7 +15,7 @@ SenderUI::SenderUI() /* we do that manually */ Profile prof; - QString str = "/dev/ttyS0"; + QString str = "/dev/ttyS1"; prof.writeEntry("Device",str ); prof.writeEntry("Baud", 115200 ); @@ -34,6 +35,15 @@ SenderUI::SenderUI() SenderUI::~SenderUI() { } +void SenderUI::slotSendFile() { + + sz = new SzTransfer(SzTransfer::SZ, ser); + sz->sendFile("/home/jake/test"); + + connect (sz, SIGNAL(sent()), + this, SLOT(fileTransComplete())); +} + void SenderUI::slotSend() { QCString str = MultiLineEdit1->text().utf8(); qWarning("sending: %s", str.data() ); @@ -45,3 +55,8 @@ void SenderUI::got(const QByteArray& ar) { } //printf("\n"); } + +void SenderUI::fileTransComplete() { + + qWarning("file transfer compete"); +} diff --git a/noncore/apps/opie-console/test/senderui.h b/noncore/apps/opie-console/test/senderui.h index bc69f5d..f6230cc 100644 --- a/noncore/apps/opie-console/test/senderui.h +++ b/noncore/apps/opie-console/test/senderui.h @@ -6,6 +6,7 @@ #include "sender.h" class IOSerial; +class SzTransfer; class SenderUI : public Sender { Q_OBJECT public: @@ -13,10 +14,13 @@ public: ~SenderUI(); public slots: + void slotSendFile(); void slotSend(); void got(const QByteArray& ); + void fileTransComplete(); private: IOSerial* ser; + SzTransfer* sz; }; -- cgit v0.9.0.2