Diffstat (limited to 'noncore/apps/opie-console/test') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/test/console.pro | 6 | ||||
-rw-r--r-- | noncore/apps/opie-console/test/sender.ui | 18 | ||||
-rw-r--r-- | noncore/apps/opie-console/test/senderui.cpp | 17 | ||||
-rw-r--r-- | noncore/apps/opie-console/test/senderui.h | 4 |
4 files changed, 41 insertions, 4 deletions
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 @@ -1,12 +1,12 @@ 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 DEPENDPATH += $(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 @@ -45,8 +45,19 @@ <name>text</name> <string>&Send</string> </property> </widget> + <widget> + <class>QPushButton</class> + <property stdset="1"> + <name>name</name> + <cstring>PushButton2</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Send &File</string> + </property> + </widget> </vbox> </widget> <connections> <connection> @@ -55,6 +66,13 @@ <receiver>Form1</receiver> <slot>slotSend()</slot> </connection> <slot access="public">slotSend()</slot> + <connection> + <sender>PushButton2</sender> + <signal>clicked()</signal> + <receiver>Form1</receiver> + <slot>slotSendFile()</slot> + </connection> + <slot access="public">slotSendFile()</slot> </connections> </UI> 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 @@ -4,8 +4,9 @@ #include <qmultilineedit.h> #include "../profile.h" #include "../io_serial.h" +#include "../sz_transfer.h" #include "senderui.h" @@ -13,9 +14,9 @@ SenderUI::SenderUI() : Sender() { /* we do that manually */ Profile prof; - QString str = "/dev/ttyS0"; + QString str = "/dev/ttyS1"; prof.writeEntry("Device",str ); prof.writeEntry("Baud", 115200 ); qWarning("prof " + prof.readEntry("Device") + " " + str); @@ -33,8 +34,17 @@ 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() ); ser->send( str ); @@ -44,4 +54,9 @@ void SenderUI::got(const QByteArray& ar) { printf("%c", ar[i] ); } //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 @@ -5,19 +5,23 @@ #include "sender.h" class IOSerial; +class SzTransfer; class SenderUI : public Sender { Q_OBJECT public: SenderUI(); ~SenderUI(); public slots: + void slotSendFile(); void slotSend(); void got(const QByteArray& ); + void fileTransComplete(); private: IOSerial* ser; + SzTransfer* sz; }; #endif |