summaryrefslogtreecommitdiff
authorhash <hash>2002-10-09 19:37:41 (UTC)
committer hash <hash>2002-10-09 19:37:41 (UTC)
commit0f5a65dda7268881906743487672543ba8d3519f (patch) (unidiff)
tree47ee29dde931539505a9dfc990d344ce8309ea5f
parent3689213cd06e8655b3f338ad170ad4e0fa040b80 (diff)
downloadopie-0f5a65dda7268881906743487672543ba8d3519f.zip
opie-0f5a65dda7268881906743487672543ba8d3519f.tar.gz
opie-0f5a65dda7268881906743487672543ba8d3519f.tar.bz2
added a file transfer button
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/test/console.pro6
-rw-r--r--noncore/apps/opie-console/test/sender.ui18
-rw-r--r--noncore/apps/opie-console/test/senderui.cpp17
-rw-r--r--noncore/apps/opie-console/test/senderui.h4
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
@@ -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
5HEADERS = ../io_layer.h ../io_serial.h \ 5HEADERS = ../io_layer.h ../io_serial.h ../sz_transfer.h ../file_layer.h\
6 senderui.h ../profile.h 6 senderui.h ../profile.h
7SOURCES = ../io_layer.cpp ../io_serial.cpp \ 7SOURCES = ../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
10INTERFACES = sender.ui 10INTERFACES = sender.ui
11INCLUDEPATH += $(OPIEDIR)/include 11INCLUDEPATH += $(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>&amp;Send</string> 46 <string>&amp;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 &amp;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()
34SenderUI::~SenderUI() { 35SenderUI::~SenderUI() {
35 36
36} 37}
38void 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
37void SenderUI::slotSend() { 47void 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
59void 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
8class IOSerial; 8class IOSerial;
9class SzTransfer;
9class SenderUI : public Sender { 10class SenderUI : public Sender {
10 Q_OBJECT 11 Q_OBJECT
11public: 12public:
@@ -13,10 +14,13 @@ public:
13 ~SenderUI(); 14 ~SenderUI();
14 15
15public slots: 16public slots:
17 void slotSendFile();
16 void slotSend(); 18 void slotSend();
17 void got(const QByteArray& ); 19 void got(const QByteArray& );
20 void fileTransComplete();
18private: 21private:
19 IOSerial* ser; 22 IOSerial* ser;
23 SzTransfer* sz;
20}; 24};
21 25
22 26