-rw-r--r-- | noncore/apps/opie-console/test/console.pro | 4 | ||||
-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, 40 insertions, 3 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 | |||
@@ -2,10 +2,10 @@ TEMPLATE = app | |||
2 | #CONFIG = qt warn_on release | 2 | #CONFIG = qt warn_on release |
3 | CONFIG = qt debug | 3 | CONFIG = qt debug |
4 | #DESTDIR = $(OPIEDIR)/bin | 4 | #DESTDIR = $(OPIEDIR)/bin |
5 | HEADERS = ../io_layer.h ../io_serial.h \ | 5 | HEADERS = ../io_layer.h ../io_serial.h ../sz_transfer.h ../file_layer.h\ |
6 | senderui.h ../profile.h | 6 | senderui.h ../profile.h |
7 | SOURCES = ../io_layer.cpp ../io_serial.cpp \ | 7 | SOURCES = ../io_layer.cpp ../io_serial.cpp \ |
8 | ../profile.cpp \ | 8 | ../profile.cpp ../sz_transfer.cpp ../file_layer.cpp\ |
9 | main.cpp senderui.cpp | 9 | main.cpp senderui.cpp |
10 | INTERFACES = sender.ui | 10 | INTERFACES = sender.ui |
11 | INCLUDEPATH += $(OPIEDIR)/include | 11 | 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 @@ | |||
46 | <string>&Send</string> | 46 | <string>&Send</string> |
47 | </property> | 47 | </property> |
48 | </widget> | 48 | </widget> |
49 | <widget> | ||
50 | <class>QPushButton</class> | ||
51 | <property stdset="1"> | ||
52 | <name>name</name> | ||
53 | <cstring>PushButton2</cstring> | ||
54 | </property> | ||
55 | <property stdset="1"> | ||
56 | <name>text</name> | ||
57 | <string>Send &File</string> | ||
58 | </property> | ||
59 | </widget> | ||
49 | </vbox> | 60 | </vbox> |
50 | </widget> | 61 | </widget> |
51 | <connections> | 62 | <connections> |
@@ -56,5 +67,12 @@ | |||
56 | <slot>slotSend()</slot> | 67 | <slot>slotSend()</slot> |
57 | </connection> | 68 | </connection> |
58 | <slot access="public">slotSend()</slot> | 69 | <slot access="public">slotSend()</slot> |
70 | <connection> | ||
71 | <sender>PushButton2</sender> | ||
72 | <signal>clicked()</signal> | ||
73 | <receiver>Form1</receiver> | ||
74 | <slot>slotSendFile()</slot> | ||
75 | </connection> | ||
76 | <slot access="public">slotSendFile()</slot> | ||
59 | </connections> | 77 | </connections> |
60 | </UI> | 78 | </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 | |||
@@ -5,6 +5,7 @@ | |||
5 | 5 | ||
6 | #include "../profile.h" | 6 | #include "../profile.h" |
7 | #include "../io_serial.h" | 7 | #include "../io_serial.h" |
8 | #include "../sz_transfer.h" | ||
8 | 9 | ||
9 | 10 | ||
10 | #include "senderui.h" | 11 | #include "senderui.h" |
@@ -14,7 +15,7 @@ SenderUI::SenderUI() | |||
14 | 15 | ||
15 | /* we do that manually */ | 16 | /* we do that manually */ |
16 | Profile prof; | 17 | Profile prof; |
17 | QString str = "/dev/ttyS0"; | 18 | QString str = "/dev/ttyS1"; |
18 | prof.writeEntry("Device",str ); | 19 | prof.writeEntry("Device",str ); |
19 | prof.writeEntry("Baud", 115200 ); | 20 | prof.writeEntry("Baud", 115200 ); |
20 | 21 | ||
@@ -34,6 +35,15 @@ SenderUI::SenderUI() | |||
34 | SenderUI::~SenderUI() { | 35 | SenderUI::~SenderUI() { |
35 | 36 | ||
36 | } | 37 | } |
38 | void SenderUI::slotSendFile() { | ||
39 | |||
40 | sz = new SzTransfer(SzTransfer::SZ, ser); | ||
41 | sz->sendFile("/home/jake/test"); | ||
42 | |||
43 | connect (sz, SIGNAL(sent()), | ||
44 | this, SLOT(fileTransComplete())); | ||
45 | } | ||
46 | |||
37 | void SenderUI::slotSend() { | 47 | void SenderUI::slotSend() { |
38 | QCString str = MultiLineEdit1->text().utf8(); | 48 | QCString str = MultiLineEdit1->text().utf8(); |
39 | qWarning("sending: %s", str.data() ); | 49 | qWarning("sending: %s", str.data() ); |
@@ -45,3 +55,8 @@ void SenderUI::got(const QByteArray& ar) { | |||
45 | } | 55 | } |
46 | //printf("\n"); | 56 | //printf("\n"); |
47 | } | 57 | } |
58 | |||
59 | void SenderUI::fileTransComplete() { | ||
60 | |||
61 | qWarning("file transfer compete"); | ||
62 | } | ||
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 @@ | |||
6 | #include "sender.h" | 6 | #include "sender.h" |
7 | 7 | ||
8 | class IOSerial; | 8 | class IOSerial; |
9 | class SzTransfer; | ||
9 | class SenderUI : public Sender { | 10 | class SenderUI : public Sender { |
10 | Q_OBJECT | 11 | Q_OBJECT |
11 | public: | 12 | public: |
@@ -13,10 +14,13 @@ public: | |||
13 | ~SenderUI(); | 14 | ~SenderUI(); |
14 | 15 | ||
15 | public slots: | 16 | public slots: |
17 | void slotSendFile(); | ||
16 | void slotSend(); | 18 | void slotSend(); |
17 | void got(const QByteArray& ); | 19 | void got(const QByteArray& ); |
20 | void fileTransComplete(); | ||
18 | private: | 21 | private: |
19 | IOSerial* ser; | 22 | IOSerial* ser; |
23 | SzTransfer* sz; | ||
20 | }; | 24 | }; |
21 | 25 | ||
22 | 26 | ||