author | drw <drw> | 2004-02-23 17:41:08 (UTC) |
---|---|---|
committer | drw <drw> | 2004-02-23 17:41:08 (UTC) |
commit | 0259f547f4dea6e10df1e02ee78b343137de24ed (patch) (unidiff) | |
tree | c09a0a69c8dfe397238bf476a849875306072855 | |
parent | d1e639b1272a6ba18ebe3fc982148ce0cb5c8c84 (diff) | |
download | opie-0259f547f4dea6e10df1e02ee78b343137de24ed.zip opie-0259f547f4dea6e10df1e02ee78b343137de24ed.tar.gz opie-0259f547f4dea6e10df1e02ee78b343137de24ed.tar.bz2 |
Opie Console: libopie->libopie2
-rw-r--r-- | noncore/apps/opie-console/config.in | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/file_layer.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/filetransfer.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/filetransfer.h | 3 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_bt.h | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_irda.h | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_modem.h | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 74 | ||||
-rw-r--r-- | noncore/apps/opie-console/opie-console.control | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/opie-console.pro | 112 | ||||
-rw-r--r-- | noncore/apps/opie-console/profileeditordialog.h | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/sz_transfer.cpp | 1 | ||||
-rw-r--r-- | noncore/apps/opie-console/sz_transfer.h | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/tabwidget.h | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/test/console.pro | 10 | ||||
-rw-r--r-- | noncore/apps/opie-console/test/senderui.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/transferdialog.cpp | 416 |
17 files changed, 318 insertions, 322 deletions
diff --git a/noncore/apps/opie-console/config.in b/noncore/apps/opie-console/config.in index 521154d..b5702a9 100644 --- a/noncore/apps/opie-console/config.in +++ b/noncore/apps/opie-console/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config OPIE-CONSOLE | 1 | config OPIE-CONSOLE |
2 | boolean "opie-console (scriptable terminal program)" | 2 | boolean "opie-console (scriptable terminal program)" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI |
diff --git a/noncore/apps/opie-console/file_layer.cpp b/noncore/apps/opie-console/file_layer.cpp index 9ddef80..870e913 100644 --- a/noncore/apps/opie-console/file_layer.cpp +++ b/noncore/apps/opie-console/file_layer.cpp | |||
@@ -1,22 +1,20 @@ | |||
1 | #include <opie/oprocess.h> | ||
2 | |||
3 | #include "file_layer.h" | 1 | #include "file_layer.h" |
4 | 2 | ||
5 | FileTransferLayer::FileTransferLayer(IOLayer *layer) | 3 | FileTransferLayer::FileTransferLayer(IOLayer *layer) |
6 | : QObject(), m_layer( layer ) | 4 | : QObject(), m_layer( layer ) |
7 | { | 5 | { |
8 | } | 6 | } |
9 | 7 | ||
10 | FileTransferLayer::~FileTransferLayer() { | 8 | FileTransferLayer::~FileTransferLayer() { |
11 | } | 9 | } |
12 | 10 | ||
13 | void FileTransferLayer::sendFile(const QFile&) { | 11 | void FileTransferLayer::sendFile(const QFile&) { |
14 | 12 | ||
15 | } | 13 | } |
16 | 14 | ||
17 | void FileTransferLayer::sendFile(const QString&) { | 15 | void FileTransferLayer::sendFile(const QString&) { |
18 | } | 16 | } |
19 | 17 | ||
20 | IOLayer* FileTransferLayer::layer() { | 18 | IOLayer* FileTransferLayer::layer() { |
21 | return m_layer; | 19 | return m_layer; |
22 | } | 20 | } |
diff --git a/noncore/apps/opie-console/filetransfer.cpp b/noncore/apps/opie-console/filetransfer.cpp index 347d6e0..7eebc65 100644 --- a/noncore/apps/opie-console/filetransfer.cpp +++ b/noncore/apps/opie-console/filetransfer.cpp | |||
@@ -1,42 +1,40 @@ | |||
1 | #include <stdio.h> | 1 | #include <stdio.h> |
2 | #include <stdlib.h> | 2 | #include <stdlib.h> |
3 | #include <errno.h> | 3 | #include <errno.h> |
4 | #include <fcntl.h> | 4 | #include <fcntl.h> |
5 | #include <unistd.h> | 5 | #include <unistd.h> |
6 | 6 | ||
7 | #include <qsocketnotifier.h> | 7 | #include <qsocketnotifier.h> |
8 | 8 | ||
9 | #include <opie/oprocess.h> | ||
10 | |||
11 | #include "procctl.h" | 9 | #include "procctl.h" |
12 | #include "filetransfer.h" | 10 | #include "filetransfer.h" |
13 | 11 | ||
14 | 12 | ||
15 | FileTransfer::FileTransfer( Type t, IOLayer* lay ) | 13 | FileTransfer::FileTransfer( Type t, IOLayer* lay ) |
16 | : FileTransferLayer( lay ), m_type( t ), m_pid ( 0 ) { | 14 | : FileTransferLayer( lay ), m_type( t ), m_pid ( 0 ) { |
17 | signal(SIGPIPE, SIG_IGN ); | 15 | signal(SIGPIPE, SIG_IGN ); |
18 | 16 | ||
19 | m_pid = 0; | 17 | m_pid = 0; |
20 | m_not = 0l; | 18 | m_not = 0l; |
21 | m_proc = 0l; | 19 | m_proc = 0l; |
22 | } | 20 | } |
23 | FileTransfer::~FileTransfer() { | 21 | FileTransfer::~FileTransfer() { |
24 | } | 22 | } |
25 | 23 | ||
26 | /** | 24 | /** |
27 | * now we will send the file. | 25 | * now we will send the file. |
28 | * | 26 | * |
29 | * we request an fd. The IOLayer should be closed | 27 | * we request an fd. The IOLayer should be closed |
30 | * then we will setup a pipe for progress communication | 28 | * then we will setup a pipe for progress communication |
31 | * then we will dup2 the m_fd in the forked process | 29 | * then we will dup2 the m_fd in the forked process |
32 | * to do direct IO from and to the fd | 30 | * to do direct IO from and to the fd |
33 | */ | 31 | */ |
34 | void FileTransfer::sendFile( const QString& file ) { | 32 | void FileTransfer::sendFile( const QString& file ) { |
35 | m_prog =-1; | 33 | m_prog =-1; |
36 | m_fd = layer()->rawIO(); | 34 | m_fd = layer()->rawIO(); |
37 | // | 35 | // |
38 | // m_fd = ::open("/dev/ttyS0", O_RDWR); | 36 | // m_fd = ::open("/dev/ttyS0", O_RDWR); |
39 | 37 | ||
40 | m_file = file; | 38 | m_file = file; |
41 | if ( pipe( m_comm ) < 0 ) | 39 | if ( pipe( m_comm ) < 0 ) |
42 | m_comm[0] = m_comm[1] = 0; | 40 | m_comm[0] = m_comm[1] = 0; |
diff --git a/noncore/apps/opie-console/filetransfer.h b/noncore/apps/opie-console/filetransfer.h index 8f55041..3b79cda 100644 --- a/noncore/apps/opie-console/filetransfer.h +++ b/noncore/apps/opie-console/filetransfer.h | |||
@@ -1,44 +1,45 @@ | |||
1 | #ifndef OPIE_FILE_TRANSFER_H | 1 | #ifndef OPIE_FILE_TRANSFER_H |
2 | #define OPIE_FILE_TRANSFER_H | 2 | #define OPIE_FILE_TRANSFER_H |
3 | 3 | ||
4 | #include <sys/types.h> | 4 | #include <sys/types.h> |
5 | 5 | ||
6 | #include <opie2/oprocess.h> | ||
7 | |||
6 | #include <qfile.h> | 8 | #include <qfile.h> |
7 | #include <qstringlist.h> | 9 | #include <qstringlist.h> |
8 | 10 | ||
9 | #include "file_layer.h" | 11 | #include "file_layer.h" |
10 | 12 | ||
11 | class QSocketNotifier; | 13 | class QSocketNotifier; |
12 | class OProcess; | ||
13 | class FileTransferControl; | 14 | class FileTransferControl; |
14 | class FileTransfer : public FileTransferLayer{ | 15 | class FileTransfer : public FileTransferLayer{ |
15 | Q_OBJECT | 16 | Q_OBJECT |
16 | friend class FileTransferControl; | 17 | friend class FileTransferControl; |
17 | public: | 18 | public: |
18 | enum Type { | 19 | enum Type { |
19 | SZ = 0, | 20 | SZ = 0, |
20 | SX, | 21 | SX, |
21 | SY | 22 | SY |
22 | }; | 23 | }; |
23 | FileTransfer( Type t, IOLayer* ); | 24 | FileTransfer( Type t, IOLayer* ); |
24 | ~FileTransfer(); | 25 | ~FileTransfer(); |
25 | 26 | ||
26 | void sendFile( const QString& file ); | 27 | void sendFile( const QString& file ); |
27 | void sendFile( const QFile& ); | 28 | void sendFile( const QFile& ); |
28 | void cancel(); | 29 | void cancel(); |
29 | 30 | ||
30 | private slots: | 31 | private slots: |
31 | void setupChild(); | 32 | void setupChild(); |
32 | void slotRead(); | 33 | void slotRead(); |
33 | void slotProgress( const QStringList& ); | 34 | void slotProgress( const QStringList& ); |
34 | void slotExec(); | 35 | void slotExec(); |
35 | private: | 36 | private: |
36 | Type m_type; | 37 | Type m_type; |
37 | pid_t m_pid; | 38 | pid_t m_pid; |
38 | int m_fd; | 39 | int m_fd; |
39 | int m_prog; | 40 | int m_prog; |
40 | int m_info[2]; | 41 | int m_info[2]; |
41 | int m_comm[2]; | 42 | int m_comm[2]; |
42 | int m_term[2]; | 43 | int m_term[2]; |
43 | QString m_file; | 44 | QString m_file; |
44 | QSocketNotifier *m_not; | 45 | QSocketNotifier *m_not; |
diff --git a/noncore/apps/opie-console/io_bt.h b/noncore/apps/opie-console/io_bt.h index 239eefb..df6dd38 100644 --- a/noncore/apps/opie-console/io_bt.h +++ b/noncore/apps/opie-console/io_bt.h | |||
@@ -1,36 +1,36 @@ | |||
1 | #ifndef OPIE_IO_BT | 1 | #ifndef OPIE_IO_BT |
2 | #define OPIE_IO_BT | 2 | #define OPIE_IO_BT |
3 | 3 | ||
4 | #include <opie/oprocess.h> | 4 | #include <opie2/oprocess.h> |
5 | #include "io_serial.h" | 5 | #include "io_serial.h" |
6 | 6 | ||
7 | /* Default values to be used if the profile information is incomplete */ | 7 | /* Default values to be used if the profile information is incomplete */ |
8 | #define BT_DEFAULT_DEVICE "/dev/ttyU0" | 8 | #define BT_DEFAULT_DEVICE "/dev/ttyU0" |
9 | #define BT_DEFAULT_BAUD 9600 | 9 | #define BT_DEFAULT_BAUD 9600 |
10 | #define BT_DEFAULT_PARITY 0 | 10 | #define BT_DEFAULT_PARITY 0 |
11 | #define BT_DEFAULT_DBITS 8 | 11 | #define BT_DEFAULT_DBITS 8 |
12 | #define BT_DEFAULT_SBITS 1 | 12 | #define BT_DEFAULT_SBITS 1 |
13 | #define BT_DEFAULT_FLOW 0 | 13 | #define BT_DEFAULT_FLOW 0 |
14 | #define BT_DEFAULT_MAC 0 | 14 | #define BT_DEFAULT_MAC 0 |
15 | 15 | ||
16 | 16 | ||
17 | /* IOSerial implements a RS232 IO Layer */ | 17 | /* IOSerial implements a RS232 IO Layer */ |
18 | 18 | ||
19 | class IOBt : public IOSerial { | 19 | class IOBt : public IOSerial { |
20 | 20 | ||
21 | Q_OBJECT | 21 | Q_OBJECT |
22 | 22 | ||
23 | public: | 23 | public: |
24 | 24 | ||
25 | IOBt(const Profile &); | 25 | IOBt(const Profile &); |
26 | ~IOBt(); | 26 | ~IOBt(); |
27 | 27 | ||
28 | virtual QString identifier() const; | 28 | virtual QString identifier() const; |
29 | virtual QString name() const; | 29 | virtual QString name() const; |
30 | virtual QBitArray supports() const; | 30 | virtual QBitArray supports() const; |
31 | virtual bool isConnected(); | 31 | virtual bool isConnected(); |
32 | 32 | ||
33 | signals: | 33 | signals: |
34 | void received(const QByteArray &); | 34 | void received(const QByteArray &); |
35 | void error(int, const QString &); | 35 | void error(int, const QString &); |
36 | 36 | ||
diff --git a/noncore/apps/opie-console/io_irda.h b/noncore/apps/opie-console/io_irda.h index 14b1ae3..69bed7d 100644 --- a/noncore/apps/opie-console/io_irda.h +++ b/noncore/apps/opie-console/io_irda.h | |||
@@ -1,36 +1,36 @@ | |||
1 | #ifndef OPIE_IO_IRDA | 1 | #ifndef OPIE_IO_IRDA |
2 | #define OPIE_IO_IRDA | 2 | #define OPIE_IO_IRDA |
3 | 3 | ||
4 | #include <opie/oprocess.h> | 4 | #include <opie2/oprocess.h> |
5 | #include "io_serial.h" | 5 | #include "io_serial.h" |
6 | 6 | ||
7 | /* Default values to be used if the profile information is incomplete */ | 7 | /* Default values to be used if the profile information is incomplete */ |
8 | #define IRDA_DEFAULT_DEVICE "/dev/ircomm0" | 8 | #define IRDA_DEFAULT_DEVICE "/dev/ircomm0" |
9 | #define IRDA_DEFAULT_BAUD 9600 | 9 | #define IRDA_DEFAULT_BAUD 9600 |
10 | #define IRDA_DEFAULT_PARITY 0 | 10 | #define IRDA_DEFAULT_PARITY 0 |
11 | #define IRDA_DEFAULT_DBITS 8 | 11 | #define IRDA_DEFAULT_DBITS 8 |
12 | #define IRDA_DEFAULT_SBITS 1 | 12 | #define IRDA_DEFAULT_SBITS 1 |
13 | #define IRDA_DEFAULT_FLOW 0 | 13 | #define IRDA_DEFAULT_FLOW 0 |
14 | 14 | ||
15 | /* IOSerial implements a RS232 IO Layer */ | 15 | /* IOSerial implements a RS232 IO Layer */ |
16 | 16 | ||
17 | class IOIrda : public IOSerial { | 17 | class IOIrda : public IOSerial { |
18 | 18 | ||
19 | Q_OBJECT | 19 | Q_OBJECT |
20 | 20 | ||
21 | public: | 21 | public: |
22 | 22 | ||
23 | IOIrda(const Profile &); | 23 | IOIrda(const Profile &); |
24 | ~IOIrda(); | 24 | ~IOIrda(); |
25 | 25 | ||
26 | virtual QString identifier() const; | 26 | virtual QString identifier() const; |
27 | virtual QString name() const; | 27 | virtual QString name() const; |
28 | virtual QBitArray supports() const; | 28 | virtual QBitArray supports() const; |
29 | virtual bool isConnected(); | 29 | virtual bool isConnected(); |
30 | 30 | ||
31 | signals: | 31 | signals: |
32 | void received(const QByteArray &); | 32 | void received(const QByteArray &); |
33 | void error(int, const QString &); | 33 | void error(int, const QString &); |
34 | 34 | ||
35 | public slots: | 35 | public slots: |
36 | virtual void send( const QByteArray& ); | 36 | virtual void send( const QByteArray& ); |
diff --git a/noncore/apps/opie-console/io_modem.h b/noncore/apps/opie-console/io_modem.h index 2a926df..96ec3ef 100644 --- a/noncore/apps/opie-console/io_modem.h +++ b/noncore/apps/opie-console/io_modem.h | |||
@@ -1,74 +1,74 @@ | |||
1 | #ifndef OPIE_IO_MODEM | 1 | #ifndef OPIE_IO_MODEM |
2 | #define OPIE_IO_MODEM | 2 | #define OPIE_IO_MODEM |
3 | 3 | ||
4 | #include <opie/oprocess.h> | 4 | #include <opie2/oprocess.h> |
5 | #include "io_serial.h" | 5 | #include "io_serial.h" |
6 | #include "profile.h" | 6 | #include "profile.h" |
7 | 7 | ||
8 | /* Default values to be used if the profile information is incomplete */ | 8 | /* Default values to be used if the profile information is incomplete */ |
9 | #define MODEM_DEFAULT_DEVICE "/dev/ttyS0" | 9 | #define MODEM_DEFAULT_DEVICE "/dev/ttyS0" |
10 | #define MODEM_DEFAULT_BAUD 9600 | 10 | #define MODEM_DEFAULT_BAUD 9600 |
11 | #define MODEM_DEFAULT_PARITY 0 | 11 | #define MODEM_DEFAULT_PARITY 0 |
12 | #define MODEM_DEFAULT_DBITS 8 | 12 | #define MODEM_DEFAULT_DBITS 8 |
13 | #define MODEM_DEFAULT_SBITS 1 | 13 | #define MODEM_DEFAULT_SBITS 1 |
14 | #define MODEM_DEFAULT_FLOW 0 | 14 | #define MODEM_DEFAULT_FLOW 0 |
15 | 15 | ||
16 | #define MODEM_DEFAULT_INIT_STRING "AT" | 16 | #define MODEM_DEFAULT_INIT_STRING "AT" |
17 | #define MODEM_DEFAULT_RESET_STRING "ATZ~" | 17 | #define MODEM_DEFAULT_RESET_STRING "ATZ~" |
18 | #define MODEM_DEFAULT_DIAL_PREFIX1 "ATDT" | 18 | #define MODEM_DEFAULT_DIAL_PREFIX1 "ATDT" |
19 | #define MODEM_DEFAULT_DIAL_SUFFIX1 "" | 19 | #define MODEM_DEFAULT_DIAL_SUFFIX1 "" |
20 | #define MODEM_DEFAULT_DIAL_PREFIX2 "" | 20 | #define MODEM_DEFAULT_DIAL_PREFIX2 "" |
21 | #define MODEM_DEFAULT_DIAL_SUFFIX2 "" | 21 | #define MODEM_DEFAULT_DIAL_SUFFIX2 "" |
22 | #define MODEM_DEFAULT_DIAL_PREFIX3 "" | 22 | #define MODEM_DEFAULT_DIAL_PREFIX3 "" |
23 | #define MODEM_DEFAULT_DIAL_SUFFIX3 "" | 23 | #define MODEM_DEFAULT_DIAL_SUFFIX3 "" |
24 | #define MODEM_DEFAULT_CONNECT_STRING "CONNECT" | 24 | #define MODEM_DEFAULT_CONNECT_STRING "CONNECT" |
25 | #define MODEM_DEFAULT_HANGUP_STRING "+++ATH" | 25 | #define MODEM_DEFAULT_HANGUP_STRING "+++ATH" |
26 | #define MODEM_DEFAULT_CANCEL_STRING "" | 26 | #define MODEM_DEFAULT_CANCEL_STRING "" |
27 | #define MODEM_DEFAULT_DIAL_TIME 45 | 27 | #define MODEM_DEFAULT_DIAL_TIME 45 |
28 | #define MODEM_DEFAULT_DELAY_REDIAL 2 | 28 | #define MODEM_DEFAULT_DELAY_REDIAL 2 |
29 | #define MODEM_DEFAULT_NUMBER_TRIES 10 | 29 | #define MODEM_DEFAULT_NUMBER_TRIES 10 |
30 | #define MODEM_DEFAULT_DTR_DROP_TIME 1 | 30 | #define MODEM_DEFAULT_DTR_DROP_TIME 1 |
31 | #define MODEM_DEFAULT_BPS_DETECT 0 // bool | 31 | #define MODEM_DEFAULT_BPS_DETECT 0 // bool |
32 | #define MODEM_DEFAULT_DCD_LINES 1 //bool | 32 | #define MODEM_DEFAULT_DCD_LINES 1 //bool |
33 | #define MODEM_DEFAULT_MULTI_LINE_UNTAG 0 // bool | 33 | #define MODEM_DEFAULT_MULTI_LINE_UNTAG 0 // bool |
34 | 34 | ||
35 | /* IOSerial implements a RS232 IO Layer */ | 35 | /* IOSerial implements a RS232 IO Layer */ |
36 | 36 | ||
37 | class IOModem : public IOSerial { | 37 | class IOModem : public IOSerial { |
38 | 38 | ||
39 | Q_OBJECT | 39 | Q_OBJECT |
40 | 40 | ||
41 | public: | 41 | public: |
42 | 42 | ||
43 | IOModem(const Profile &); | 43 | IOModem(const Profile &); |
44 | ~IOModem(); | 44 | ~IOModem(); |
45 | 45 | ||
46 | virtual QString identifier() const; | 46 | virtual QString identifier() const; |
47 | virtual QString name() const; | 47 | virtual QString name() const; |
48 | virtual QBitArray supports() const; | 48 | virtual QBitArray supports() const; |
49 | virtual bool isConnected(); | 49 | virtual bool isConnected(); |
50 | 50 | ||
51 | signals: | 51 | signals: |
52 | void received(const QByteArray &); | 52 | void received(const QByteArray &); |
53 | void error(int, const QString &); | 53 | void error(int, const QString &); |
54 | 54 | ||
55 | public slots: | 55 | public slots: |
56 | virtual void send( const QByteArray& ); | 56 | virtual void send( const QByteArray& ); |
57 | virtual bool open(); | 57 | virtual bool open(); |
58 | virtual void close(); | 58 | virtual void close(); |
59 | virtual void reload(const Profile &); | 59 | virtual void reload(const Profile &); |
60 | 60 | ||
61 | private: | 61 | private: |
62 | 62 | ||
63 | QString m_initString, m_resetString, m_dialPref1, m_dialSuf1, m_dialPref2, | 63 | QString m_initString, m_resetString, m_dialPref1, m_dialSuf1, m_dialPref2, |
64 | m_dialSuf2, m_dialPref3, m_dialSuf3, m_connect, m_hangup, m_cancel; | 64 | m_dialSuf2, m_dialPref3, m_dialSuf3, m_connect, m_hangup, m_cancel; |
65 | int m_dialTime, m_delayRedial, m_numberTries, m_dtrDropTime, | 65 | int m_dialTime, m_delayRedial, m_numberTries, m_dtrDropTime, |
66 | m_bpsDetect, m_dcdLines, m_multiLineUntag; | 66 | m_bpsDetect, m_dcdLines, m_multiLineUntag; |
67 | Profile m_profile; | 67 | Profile m_profile; |
68 | 68 | ||
69 | private slots: | 69 | private slots: |
70 | void slotExited(OProcess* proc); | 70 | void slotExited(OProcess* proc); |
71 | 71 | ||
72 | }; | 72 | }; |
73 | 73 | ||
74 | #endif | 74 | #endif |
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 3fe9040..0a475d8 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp | |||
@@ -1,45 +1,45 @@ | |||
1 | #include <assert.h> | 1 | #include <assert.h> |
2 | 2 | ||
3 | #include <qaction.h> | 3 | #include <qaction.h> |
4 | #include <qmenubar.h> | 4 | #include <qmenubar.h> |
5 | #include <qtoolbar.h> | 5 | #include <qtoolbar.h> |
6 | #include <qmessagebox.h> | 6 | #include <qmessagebox.h> |
7 | #include <qwhatsthis.h> | 7 | #include <qwhatsthis.h> |
8 | #include <qfileinfo.h> | 8 | #include <qfileinfo.h> |
9 | 9 | ||
10 | #include <qpe/filemanager.h> | 10 | #include <qpe/filemanager.h> |
11 | #include <qpe/qpeapplication.h> | 11 | #include <qpe/qpeapplication.h> |
12 | 12 | ||
13 | #include <opie/ofiledialog.h> | 13 | #include <opie2/ofiledialog.h> |
14 | 14 | ||
15 | #include "TEmulation.h" | 15 | #include "TEmulation.h" |
16 | #include "profileeditordialog.h" | 16 | #include "profileeditordialog.h" |
17 | #include "configdialog.h" | 17 | #include "configdialog.h" |
18 | #include "default.h" | 18 | #include "default.h" |
19 | #include "profilemanager.h" | 19 | #include "profilemanager.h" |
20 | #include "mainwindow.h" | 20 | #include "mainwindow.h" |
21 | #include "tabwidget.h" | 21 | #include "tabwidget.h" |
22 | #include "transferdialog.h" | 22 | #include "transferdialog.h" |
23 | #include "function_keyboard.h" | 23 | #include "function_keyboard.h" |
24 | #include "emulation_handler.h" | 24 | #include "emulation_handler.h" |
25 | #include "script.h" | 25 | #include "script.h" |
26 | 26 | ||
27 | 27 | ||
28 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { | 28 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { |
29 | KeyTrans::loadAll(); | 29 | KeyTrans::loadAll(); |
30 | for (int i = 0; i < KeyTrans::count(); i++ ) { | 30 | for (int i = 0; i < KeyTrans::count(); i++ ) { |
31 | KeyTrans* s = KeyTrans::find(i ); | 31 | KeyTrans* s = KeyTrans::find(i ); |
32 | assert( s ); | 32 | assert( s ); |
33 | } | 33 | } |
34 | m_factory = new MetaFactory(); | 34 | m_factory = new MetaFactory(); |
35 | Default def(m_factory); | 35 | Default def(m_factory); |
36 | m_sessions.setAutoDelete( TRUE ); | 36 | m_sessions.setAutoDelete( TRUE ); |
37 | m_curSession = 0; | 37 | m_curSession = 0; |
38 | m_manager = new ProfileManager( m_factory ); | 38 | m_manager = new ProfileManager( m_factory ); |
39 | m_manager->load(); | 39 | m_manager->load(); |
40 | m_scriptsData.setAutoDelete(TRUE); | 40 | m_scriptsData.setAutoDelete(TRUE); |
41 | 41 | ||
42 | initUI(); | 42 | initUI(); |
43 | populateProfiles(); | 43 | populateProfiles(); |
44 | populateScripts(); | 44 | populateScripts(); |
45 | } | 45 | } |
@@ -304,65 +304,65 @@ MetaFactory* MainWindow::factory() { | |||
304 | Session* MainWindow::currentSession() { | 304 | Session* MainWindow::currentSession() { |
305 | return m_curSession; | 305 | return m_curSession; |
306 | } | 306 | } |
307 | 307 | ||
308 | QList<Session> MainWindow::sessions() { | 308 | QList<Session> MainWindow::sessions() { |
309 | return m_sessions; | 309 | return m_sessions; |
310 | } | 310 | } |
311 | 311 | ||
312 | void MainWindow::slotNew() { | 312 | void MainWindow::slotNew() { |
313 | ProfileEditorDialog dlg(factory() ); | 313 | ProfileEditorDialog dlg(factory() ); |
314 | dlg.setCaption( tr("New Connection") ); | 314 | dlg.setCaption( tr("New Connection") ); |
315 | int ret = QPEApplication::execDialog( &dlg ); | 315 | int ret = QPEApplication::execDialog( &dlg ); |
316 | 316 | ||
317 | if ( ret == QDialog::Accepted ) { | 317 | if ( ret == QDialog::Accepted ) { |
318 | create( dlg.profile() ); | 318 | create( dlg.profile() ); |
319 | } | 319 | } |
320 | } | 320 | } |
321 | 321 | ||
322 | void MainWindow::slotRecordScript() { | 322 | void MainWindow::slotRecordScript() { |
323 | if (currentSession()) { | 323 | if (currentSession()) { |
324 | currentSession()->emulationHandler()->startRecording(); | 324 | currentSession()->emulationHandler()->startRecording(); |
325 | m_saveScript->setEnabled(true); | 325 | m_saveScript->setEnabled(true); |
326 | m_recordScript->setEnabled(false); | 326 | m_recordScript->setEnabled(false); |
327 | } | 327 | } |
328 | } | 328 | } |
329 | 329 | ||
330 | void MainWindow::slotSaveScript() { | 330 | void MainWindow::slotSaveScript() { |
331 | if (currentSession() && currentSession()->emulationHandler()->isRecording()) { | 331 | if (currentSession() && currentSession()->emulationHandler()->isRecording()) { |
332 | QMap<QString, QStringList> map; | 332 | QMap<QString, QStringList> map; |
333 | QStringList text; | 333 | QStringList text; |
334 | text << "text/plain"; | 334 | text << "text/plain"; |
335 | map.insert(tr("Script"), text ); | 335 | map.insert(tr("Script"), text ); |
336 | QString filename = OFileDialog::getSaveFileName(2, QPEApplication::documentDir(), QString::null, map); | 336 | QString filename = Opie::OFileDialog::getSaveFileName(2, QPEApplication::documentDir(), QString::null, map); |
337 | if (!filename.isEmpty()) { | 337 | if (!filename.isEmpty()) { |
338 | QFileInfo info(filename); | 338 | QFileInfo info(filename); |
339 | if (info.extension(FALSE) != "script") | 339 | if (info.extension(FALSE) != "script") |
340 | filename += ".script"; | 340 | filename += ".script"; |
341 | DocLnk nf; | 341 | DocLnk nf; |
342 | nf.setType("text/plain"); | 342 | nf.setType("text/plain"); |
343 | nf.setFile(filename); | 343 | nf.setFile(filename); |
344 | nf.setName(info.fileName()); | 344 | nf.setName(info.fileName()); |
345 | FileManager fm; | 345 | FileManager fm; |
346 | fm.saveFile(nf, currentSession()->emulationHandler()->script()->script()); | 346 | fm.saveFile(nf, currentSession()->emulationHandler()->script()->script()); |
347 | currentSession()->emulationHandler()->clearScript(); | 347 | currentSession()->emulationHandler()->clearScript(); |
348 | m_saveScript->setEnabled(false); | 348 | m_saveScript->setEnabled(false); |
349 | m_recordScript->setEnabled(true); | 349 | m_recordScript->setEnabled(true); |
350 | populateScripts(); | 350 | populateScripts(); |
351 | } | 351 | } |
352 | } | 352 | } |
353 | } | 353 | } |
354 | 354 | ||
355 | void MainWindow::slotRunScript(int id) { | 355 | void MainWindow::slotRunScript(int id) { |
356 | if (currentSession()) { | 356 | if (currentSession()) { |
357 | int index = m_scriptsPop->indexOf(id); | 357 | int index = m_scriptsPop->indexOf(id); |
358 | DocLnk *lnk = m_scriptsData.at(index); | 358 | DocLnk *lnk = m_scriptsData.at(index); |
359 | QString filePath = lnk->file(); | 359 | QString filePath = lnk->file(); |
360 | Script script(filePath); | 360 | Script script(filePath); |
361 | currentSession()->emulationHandler()->runScript(&script); | 361 | currentSession()->emulationHandler()->runScript(&script); |
362 | } | 362 | } |
363 | } | 363 | } |
364 | 364 | ||
365 | void MainWindow::slotConnect() { | 365 | void MainWindow::slotConnect() { |
366 | if ( currentSession() ) { | 366 | if ( currentSession() ) { |
367 | bool ret = currentSession()->layer()->open(); | 367 | bool ret = currentSession()->layer()->open(); |
368 | if(!ret) QMessageBox::warning(currentSession()->widgetStack(), | 368 | if(!ret) QMessageBox::warning(currentSession()->widgetStack(), |
@@ -418,247 +418,247 @@ void MainWindow::slotQuickLaunch() { | |||
418 | Profile newProf = Profile( "default", "console", "default" , 0, 3, 0 ); | 418 | Profile newProf = Profile( "default", "console", "default" , 0, 3, 0 ); |
419 | newProf.setAutoConnect( true ); | 419 | newProf.setAutoConnect( true ); |
420 | create( newProf ); | 420 | create( newProf ); |
421 | slotSaveSession(); | 421 | slotSaveSession(); |
422 | } | 422 | } |
423 | 423 | ||
424 | } | 424 | } |
425 | 425 | ||
426 | void MainWindow::slotConfigure() { | 426 | void MainWindow::slotConfigure() { |
427 | ConfigDialog conf( manager()->all(), factory() ); | 427 | ConfigDialog conf( manager()->all(), factory() ); |
428 | 428 | ||
429 | int ret = QPEApplication::execDialog( &conf ); | 429 | int ret = QPEApplication::execDialog( &conf ); |
430 | 430 | ||
431 | if ( QDialog::Accepted == ret ) { | 431 | if ( QDialog::Accepted == ret ) { |
432 | manager()->setProfiles( conf.list() ); | 432 | manager()->setProfiles( conf.list() ); |
433 | manager()->save(); | 433 | manager()->save(); |
434 | populateProfiles(); | 434 | populateProfiles(); |
435 | } | 435 | } |
436 | } | 436 | } |
437 | /* | 437 | /* |
438 | * we will remove | 438 | * we will remove |
439 | * this window from the tabwidget | 439 | * this window from the tabwidget |
440 | * remove it from the list | 440 | * remove it from the list |
441 | * delete it | 441 | * delete it |
442 | * and set the currentSession() | 442 | * and set the currentSession() |
443 | */ | 443 | */ |
444 | void MainWindow::slotClose() { | 444 | void MainWindow::slotClose() { |
445 | if (!currentSession() ) | 445 | if (!currentSession() ) |
446 | return; | 446 | return; |
447 | 447 | ||
448 | Session* ses = currentSession(); | 448 | Session* ses = currentSession(); |
449 | qWarning("removing! currentSession %s", currentSession()->name().latin1() ); | 449 | qWarning("removing! currentSession %s", currentSession()->name().latin1() ); |
450 | /* set to NULL to be safe, if its needed slotSessionChanged resets it automatically */ | 450 | /* set to NULL to be safe, if its needed slotSessionChanged resets it automatically */ |
451 | m_curSession = NULL; | 451 | m_curSession = NULL; |
452 | tabWidget()->remove( /*currentSession()*/ses ); | 452 | tabWidget()->remove( /*currentSession()*/ses ); |
453 | /*it's autodelete */ | 453 | /*it's autodelete */ |
454 | m_sessions.remove( ses ); | 454 | m_sessions.remove( ses ); |
455 | qWarning("after remove!!"); | 455 | qWarning("after remove!!"); |
456 | 456 | ||
457 | if (!currentSession() ) { | 457 | if (!currentSession() ) { |
458 | m_connect->setEnabled( false ); | 458 | m_connect->setEnabled( false ); |
459 | m_disconnect->setEnabled( false ); | 459 | m_disconnect->setEnabled( false ); |
460 | m_terminate->setEnabled( false ); | 460 | m_terminate->setEnabled( false ); |
461 | m_transfer->setEnabled( false ); | 461 | m_transfer->setEnabled( false ); |
462 | m_recordScript->setEnabled( false ); | 462 | m_recordScript->setEnabled( false ); |
463 | m_saveScript->setEnabled( false ); | 463 | m_saveScript->setEnabled( false ); |
464 | m_scripts->setItemEnabled(m_runScript_id, false); | 464 | m_scripts->setItemEnabled(m_runScript_id, false); |
465 | m_fullscreen->setEnabled( false ); | 465 | m_fullscreen->setEnabled( false ); |
466 | m_wrap->setEnabled( false ); | 466 | m_wrap->setEnabled( false ); |
467 | m_closewindow->setEnabled( false ); | 467 | m_closewindow->setEnabled( false ); |
468 | } | 468 | } |
469 | 469 | ||
470 | m_kb->loadDefaults(); | 470 | m_kb->loadDefaults(); |
471 | } | 471 | } |
472 | 472 | ||
473 | /* | 473 | /* |
474 | * We will get the name | 474 | * We will get the name |
475 | * Then the profile | 475 | * Then the profile |
476 | * and then we will make a profile | 476 | * and then we will make a profile |
477 | */ | 477 | */ |
478 | void MainWindow::slotProfile( int id) { | 478 | void MainWindow::slotProfile( int id) { |
479 | Profile prof = manager()->profile( m_sessionsPop->text( id) ); | 479 | Profile prof = manager()->profile( m_sessionsPop->text( id) ); |
480 | create( prof ); | 480 | create( prof ); |
481 | } | 481 | } |
482 | 482 | ||
483 | 483 | ||
484 | 484 | ||
485 | void MainWindow::create( const Profile& prof ) { | 485 | void MainWindow::create( const Profile& prof ) { |
486 | if(m_curSession) | 486 | if(m_curSession) |
487 | if(m_curSession->transferDialog()) m_curSession->transferDialog()->hide(); | 487 | if(m_curSession->transferDialog()) m_curSession->transferDialog()->hide(); |
488 | 488 | ||
489 | Session *ses = manager()->fromProfile( prof, tabWidget() ); | 489 | Session *ses = manager()->fromProfile( prof, tabWidget() ); |
490 | 490 | ||
491 | if((!ses) || (!ses->layer()) || (!ses->widgetStack())) | 491 | if((!ses) || (!ses->layer()) || (!ses->widgetStack())) |
492 | { | 492 | { |
493 | QMessageBox::warning(this, | 493 | QMessageBox::warning(this, |
494 | QObject::tr("Session failed"), | 494 | QObject::tr("Session failed"), |
495 | QObject::tr("<qt>Cannot open session: Not all components were found.</qt>")); | 495 | QObject::tr("<qt>Cannot open session: Not all components were found.</qt>")); |
496 | //if(ses) delete ses; | 496 | //if(ses) delete ses; |
497 | return; | 497 | return; |
498 | } | 498 | } |
499 | 499 | ||
500 | m_sessions.append( ses ); | 500 | m_sessions.append( ses ); |
501 | tabWidget()->add( ses ); | 501 | tabWidget()->add( ses ); |
502 | tabWidget()->repaint(); | 502 | tabWidget()->repaint(); |
503 | m_curSession = ses; | 503 | m_curSession = ses; |
504 | 504 | ||
505 | // dicide if its a local term ( then no connction and no tranfer), maybe make a wrapper method out of it | 505 | // dicide if its a local term ( then no connction and no tranfer), maybe make a wrapper method out of it |
506 | m_connect->setEnabled( true ); | 506 | m_connect->setEnabled( true ); |
507 | m_disconnect->setEnabled( false ); | 507 | m_disconnect->setEnabled( false ); |
508 | m_terminate->setEnabled( true ); | 508 | m_terminate->setEnabled( true ); |
509 | m_fullscreen->setEnabled( true ); | 509 | m_fullscreen->setEnabled( true ); |
510 | m_wrap->setEnabled( true ); | 510 | m_wrap->setEnabled( true ); |
511 | m_closewindow->setEnabled( true ); | 511 | m_closewindow->setEnabled( true ); |
512 | m_transfer->setEnabled( false ); | 512 | m_transfer->setEnabled( false ); |
513 | m_recordScript->setEnabled( false ); | 513 | m_recordScript->setEnabled( false ); |
514 | m_saveScript->setEnabled( false ); | 514 | m_saveScript->setEnabled( false ); |
515 | m_scripts->setItemEnabled(m_runScript_id, false); | 515 | m_scripts->setItemEnabled(m_runScript_id, false); |
516 | 516 | ||
517 | // is io_layer wants direct connection, then autoconnect | 517 | // is io_layer wants direct connection, then autoconnect |
518 | //if ( ( m_curSession->layer() )->supports()[0] == 1 ) { | 518 | //if ( ( m_curSession->layer() )->supports()[0] == 1 ) { |
519 | if (prof.autoConnect()) { | 519 | if (prof.autoConnect()) { |
520 | slotConnect(); | 520 | slotConnect(); |
521 | } | 521 | } |
522 | 522 | ||
523 | 523 | ||
524 | QWidget *w = currentSession()->widget(); | 524 | QWidget *w = currentSession()->widget(); |
525 | if(w) w->setFocus(); | 525 | if(w) w->setFocus(); |
526 | 526 | ||
527 | if(currentSession()->profile().readNumEntry("Wrap", 80)){ | 527 | if(currentSession()->profile().readNumEntry("Wrap", 80)){ |
528 | m_isWrapped = true; | 528 | m_isWrapped = true; |
529 | } else { | 529 | } else { |
530 | m_isWrapped = false; | 530 | m_isWrapped = false; |
531 | } | 531 | } |
532 | 532 | ||
533 | m_kb->load(currentSession()->profile()); | 533 | m_kb->load(currentSession()->profile()); |
534 | } | 534 | } |
535 | 535 | ||
536 | void MainWindow::slotTransfer() | 536 | void MainWindow::slotTransfer() |
537 | { | 537 | { |
538 | if ( currentSession() ) { | 538 | if ( currentSession() ) { |
539 | Session *mysession = currentSession(); | 539 | Session *mysession = currentSession(); |
540 | TransferDialog dlg(/*mysession->widgetStack()*/this, this); | 540 | TransferDialog dlg(/*mysession->widgetStack()*/this, this); |
541 | mysession->setTransferDialog(&dlg); | 541 | mysession->setTransferDialog(&dlg); |
542 | //dlg.reparent(mysession->widgetStack(), QPoint(0, 0)); | 542 | //dlg.reparent(mysession->widgetStack(), QPoint(0, 0)); |
543 | //dlg.showMaximized(); | 543 | //dlg.showMaximized(); |
544 | currentSession()->widgetStack()->addWidget(&dlg, -1); | 544 | currentSession()->widgetStack()->addWidget(&dlg, -1); |
545 | dlg.show(); | 545 | dlg.show(); |
546 | //dlg.exec(); | 546 | //dlg.exec(); |
547 | while(dlg.isRunning()) qApp->processEvents(); | 547 | while(dlg.isRunning()) qApp->processEvents(); |
548 | mysession->setTransferDialog(0l); | 548 | mysession->setTransferDialog(0l); |
549 | } | 549 | } |
550 | } | 550 | } |
551 | 551 | ||
552 | 552 | ||
553 | void MainWindow::slotOpenKeb(bool state) { | 553 | void MainWindow::slotOpenKeb(bool state) { |
554 | 554 | ||
555 | if (state) m_keyBar->show(); | 555 | if (state) m_keyBar->show(); |
556 | else m_keyBar->hide(); | 556 | else m_keyBar->hide(); |
557 | 557 | ||
558 | } | 558 | } |
559 | 559 | ||
560 | 560 | ||
561 | void MainWindow::slotOpenButtons( bool state ) { | 561 | void MainWindow::slotOpenButtons( bool state ) { |
562 | 562 | ||
563 | if ( state ) { | 563 | if ( state ) { |
564 | m_buttonBar->show(); | 564 | m_buttonBar->show(); |
565 | } else { | 565 | } else { |
566 | m_buttonBar->hide(); | 566 | m_buttonBar->hide(); |
567 | } | 567 | } |
568 | } | 568 | } |
569 | 569 | ||
570 | 570 | ||
571 | 571 | ||
572 | void MainWindow::slotSessionChanged( Session* ses ) { | 572 | void MainWindow::slotSessionChanged( Session* ses ) { |
573 | qWarning("changed!"); | 573 | qWarning("changed!"); |
574 | 574 | ||
575 | if(m_curSession) | 575 | if(m_curSession) |
576 | if(m_curSession->transferDialog()) m_curSession->transferDialog()->hide(); | 576 | if(m_curSession->transferDialog()) m_curSession->transferDialog()->hide(); |
577 | if(ses) | 577 | if(ses) |
578 | if(ses->transferDialog()) ses->transferDialog()->show(); | 578 | if(ses->transferDialog()) ses->transferDialog()->show(); |
579 | 579 | ||
580 | if ( ses ) { | 580 | if ( ses ) { |
581 | m_curSession = ses; | 581 | m_curSession = ses; |
582 | qDebug(QString("is connected : %1").arg( m_curSession->layer()->isConnected() ) ); | 582 | qDebug(QString("is connected : %1").arg( m_curSession->layer()->isConnected() ) ); |
583 | if ( m_curSession->layer()->isConnected() ) { | 583 | if ( m_curSession->layer()->isConnected() ) { |
584 | m_connect->setEnabled( false ); | 584 | m_connect->setEnabled( false ); |
585 | m_disconnect->setEnabled( true ); | 585 | m_disconnect->setEnabled( true ); |
586 | m_recordScript->setEnabled(!m_curSession->emulationHandler()->isRecording()); | 586 | m_recordScript->setEnabled(!m_curSession->emulationHandler()->isRecording()); |
587 | m_saveScript->setEnabled(m_curSession->emulationHandler()->isRecording()); | 587 | m_saveScript->setEnabled(m_curSession->emulationHandler()->isRecording()); |
588 | m_scripts->setItemEnabled(m_runScript_id, true); | 588 | m_scripts->setItemEnabled(m_runScript_id, true); |
589 | } else { | 589 | } else { |
590 | m_connect->setEnabled( true ); | 590 | m_connect->setEnabled( true ); |
591 | m_disconnect->setEnabled( false ); | 591 | m_disconnect->setEnabled( false ); |
592 | m_recordScript->setEnabled( false ); | 592 | m_recordScript->setEnabled( false ); |
593 | m_saveScript->setEnabled( false ); | 593 | m_saveScript->setEnabled( false ); |
594 | m_scripts->setItemEnabled(m_runScript_id, false); | 594 | m_scripts->setItemEnabled(m_runScript_id, false); |
595 | } | 595 | } |
596 | 596 | ||
597 | if ( ( m_curSession->layer() )->supports()[1] == 0 ) { | 597 | if ( ( m_curSession->layer() )->supports()[1] == 0 ) { |
598 | m_transfer->setEnabled( false ); | 598 | m_transfer->setEnabled( false ); |
599 | } else { | 599 | } else { |
600 | m_transfer->setEnabled( true ); | 600 | m_transfer->setEnabled( true ); |
601 | } | 601 | } |
602 | 602 | ||
603 | QWidget *w = m_curSession->widget(); | 603 | QWidget *w = m_curSession->widget(); |
604 | if(w) w->setFocus(); | 604 | if(w) w->setFocus(); |
605 | 605 | ||
606 | if(currentSession()->profile().readNumEntry("Wrap", 80)){ | 606 | if(currentSession()->profile().readNumEntry("Wrap", 80)){ |
607 | m_isWrapped = true; | 607 | m_isWrapped = true; |
608 | } else { | 608 | } else { |
609 | m_isWrapped = false; | 609 | m_isWrapped = false; |
610 | } | 610 | } |
611 | 611 | ||
612 | m_kb->load(currentSession()->profile()); | 612 | m_kb->load(currentSession()->profile()); |
613 | } | 613 | } |
614 | } | 614 | } |
615 | 615 | ||
616 | void MainWindow::slotWrap() | 616 | void MainWindow::slotWrap() |
617 | { | 617 | { |
618 | if(m_curSession) | 618 | if(m_curSession) |
619 | { | 619 | { |
620 | EmulationHandler *e = m_curSession->emulationHandler(); | 620 | EmulationHandler *e = m_curSession->emulationHandler(); |
621 | if(e) | 621 | if(e) |
622 | { | 622 | { |
623 | if(m_isWrapped) | 623 | if(m_isWrapped) |
624 | { | 624 | { |
625 | e->setWrap(80); | 625 | e->setWrap(80); |
626 | m_isWrapped = false; | 626 | m_isWrapped = false; |
627 | } | 627 | } |
628 | else | 628 | else |
629 | { | 629 | { |
630 | e->setWrap(0); | 630 | e->setWrap(0); |
631 | m_isWrapped = true; | 631 | m_isWrapped = true; |
632 | } | 632 | } |
633 | } | 633 | } |
634 | } | 634 | } |
635 | } | 635 | } |
636 | 636 | ||
637 | void MainWindow::slotFullscreen() { | 637 | void MainWindow::slotFullscreen() { |
638 | 638 | ||
639 | 639 | ||
640 | 640 | ||
641 | if ( m_isFullscreen ) { | 641 | if ( m_isFullscreen ) { |
642 | ( m_curSession->widgetStack() )->reparent( savedParentFullscreen, 0, QPoint(0,0), true ); | 642 | ( m_curSession->widgetStack() )->reparent( savedParentFullscreen, 0, QPoint(0,0), true ); |
643 | ( m_curSession->widgetStack() )->resize( savedParentFullscreen->width(), savedParentFullscreen->height() ); | 643 | ( m_curSession->widgetStack() )->resize( savedParentFullscreen->width(), savedParentFullscreen->height() ); |
644 | ( m_curSession->emulationHandler() )->cornerButton()->hide(); | 644 | ( m_curSession->emulationHandler() )->cornerButton()->hide(); |
645 | disconnect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); | 645 | disconnect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); |
646 | 646 | ||
647 | } else { | 647 | } else { |
648 | savedParentFullscreen = ( m_curSession->widgetStack() )->parentWidget(); | 648 | savedParentFullscreen = ( m_curSession->widgetStack() )->parentWidget(); |
649 | ( m_curSession->widgetStack() )->setFrameStyle( QFrame::NoFrame ); | 649 | ( m_curSession->widgetStack() )->setFrameStyle( QFrame::NoFrame ); |
650 | ( m_curSession->widgetStack() )->reparent( 0, WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop | 650 | ( m_curSession->widgetStack() )->reparent( 0, WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop |
651 | , QPoint(0,0), false ); | 651 | , QPoint(0,0), false ); |
652 | ( m_curSession->widgetStack() )->resize( qApp->desktop()->width(), qApp->desktop()->height() ); | 652 | ( m_curSession->widgetStack() )->resize( qApp->desktop()->width(), qApp->desktop()->height() ); |
653 | ( m_curSession->widgetStack() )->setFocus(); | 653 | ( m_curSession->widgetStack() )->setFocus(); |
654 | ( m_curSession->widgetStack() )->show(); | 654 | ( m_curSession->widgetStack() )->show(); |
655 | 655 | ||
656 | ( ( m_curSession->emulationHandler() )->cornerButton() )->show(); | 656 | ( ( m_curSession->emulationHandler() )->cornerButton() )->show(); |
657 | 657 | ||
658 | connect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); | 658 | connect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); |
659 | } | 659 | } |
660 | 660 | ||
661 | m_isFullscreen = !m_isFullscreen; | 661 | m_isFullscreen = !m_isFullscreen; |
662 | } | 662 | } |
663 | 663 | ||
664 | 664 | ||
@@ -677,52 +677,52 @@ void MainWindow::slotKeyReceived(FKey k, ushort, ushort, bool pressed) { | |||
677 | QApplication::sendEvent((QObject *)m_curSession->widget(), &ke); | 677 | QApplication::sendEvent((QObject *)m_curSession->widget(), &ke); |
678 | ke.ignore(); | 678 | ke.ignore(); |
679 | } | 679 | } |
680 | } | 680 | } |
681 | void MainWindow::slotCopy() { | 681 | void MainWindow::slotCopy() { |
682 | if (!currentSession() ) return; | 682 | if (!currentSession() ) return; |
683 | currentSession()->emulationHandler()->copy(); | 683 | currentSession()->emulationHandler()->copy(); |
684 | } | 684 | } |
685 | void MainWindow::slotPaste() { | 685 | void MainWindow::slotPaste() { |
686 | if (!currentSession() ) return; | 686 | if (!currentSession() ) return; |
687 | currentSession()->emulationHandler()->paste(); | 687 | currentSession()->emulationHandler()->paste(); |
688 | } | 688 | } |
689 | 689 | ||
690 | /* | 690 | /* |
691 | * Save the session | 691 | * Save the session |
692 | */ | 692 | */ |
693 | 693 | ||
694 | void MainWindow::slotSaveSession() { | 694 | void MainWindow::slotSaveSession() { |
695 | if (!currentSession() ) { | 695 | if (!currentSession() ) { |
696 | QMessageBox::information(this, tr("Save Connection"), | 696 | QMessageBox::information(this, tr("Save Connection"), |
697 | tr("<qt>There is no Connection.</qt>"), 1 ); | 697 | tr("<qt>There is no Connection.</qt>"), 1 ); |
698 | return; | 698 | return; |
699 | } | 699 | } |
700 | manager()->add( currentSession()->profile() ); | 700 | manager()->add( currentSession()->profile() ); |
701 | manager()->save(); | 701 | manager()->save(); |
702 | populateProfiles(); | 702 | populateProfiles(); |
703 | } | 703 | } |
704 | void MainWindow::slotSaveHistory() { | 704 | void MainWindow::slotSaveHistory() { |
705 | QMap<QString, QStringList> map; | 705 | QMap<QString, QStringList> map; |
706 | QStringList text; | 706 | QStringList text; |
707 | text << "text/plain"; | 707 | text << "text/plain"; |
708 | map.insert(tr("History"), text ); | 708 | map.insert(tr("History"), text ); |
709 | QString filename = OFileDialog::getSaveFileName(2, QPEApplication::documentDir(), QString::null, map); | 709 | QString filename = Opie::OFileDialog::getSaveFileName(2, QPEApplication::documentDir(), QString::null, map); |
710 | if (filename.isEmpty() ) return; | 710 | if (filename.isEmpty() ) return; |
711 | 711 | ||
712 | QFileInfo info(filename); | 712 | QFileInfo info(filename); |
713 | 713 | ||
714 | DocLnk nf; | 714 | DocLnk nf; |
715 | nf.setType("text/plain"); | 715 | nf.setType("text/plain"); |
716 | nf.setFile(filename); | 716 | nf.setFile(filename); |
717 | nf.setName(info.fileName()); | 717 | nf.setName(info.fileName()); |
718 | 718 | ||
719 | 719 | ||
720 | QFile file(filename); | 720 | QFile file(filename); |
721 | file.open(IO_WriteOnly ); | 721 | file.open(IO_WriteOnly ); |
722 | QTextStream str(&file ); | 722 | QTextStream str(&file ); |
723 | if ( currentSession() ) | 723 | if ( currentSession() ) |
724 | currentSession()->emulationHandler()->emulation()->streamHistory(&str); | 724 | currentSession()->emulationHandler()->emulation()->streamHistory(&str); |
725 | 725 | ||
726 | file.close(); | 726 | file.close(); |
727 | nf.writeLink(); | 727 | nf.writeLink(); |
728 | } | 728 | } |
diff --git a/noncore/apps/opie-console/opie-console.control b/noncore/apps/opie-console/opie-console.control index 5548baf..a7ff1f3 100644 --- a/noncore/apps/opie-console/opie-console.control +++ b/noncore/apps/opie-console/opie-console.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-console | 1 | Package: opie-console |
2 | Files: bin/opie-console apps/Applications/opie-console.desktop pics/console/* | 2 | Files: bin/opie-console apps/Applications/opie-console.desktop pics/console/* |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/applications | 4 | Section: opie/applications |
5 | Maintainer: Opie Team <opie@handhelds.org> | 5 | Maintainer: Opie Team <opie@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: 0.6-$SUB_VERSION | 7 | Version: 0.6-$SUB_VERSION |
8 | Depends: qpe-base, libopie1, opie-console-help-en, lrzsz, opie-keytabs | 8 | Depends: qpe-base, libopiecore2, libopieui2, opie-console-help-en, lrzsz, opie-keytabs |
9 | License: GPL | 9 | License: GPL |
10 | Description: Opie terminal app | 10 | Description: Opie terminal app |
diff --git a/noncore/apps/opie-console/opie-console.pro b/noncore/apps/opie-console/opie-console.pro index ccf2e08..d3d7b25 100644 --- a/noncore/apps/opie-console/opie-console.pro +++ b/noncore/apps/opie-console/opie-console.pro | |||
@@ -1,76 +1,76 @@ | |||
1 | TEMPLATE = app | 1 | TEMPLATE = app |
2 | TMAKE_CXXFLAGS+= -DHAVE_OPENPTY | 2 | TMAKE_CXXFLAGS += -DHAVE_OPENPTY |
3 | CONFIG += qt warn_on release | 3 | CONFIG += qt warn_on release |
4 | #CONFIG = qt debug | 4 | #CONFIG = qt debug |
5 | DESTDIR = $(OPIEDIR)/bin | 5 | DESTDIR = $(OPIEDIR)/bin |
6 | HEADERS = io_layer.h io_serial.h io_irda.h io_bt.h io_modem.h \ | 6 | HEADERS = io_layer.h io_serial.h io_irda.h io_bt.h io_modem.h \ |
7 | file_layer.h filetransfer.h \ | 7 | file_layer.h filetransfer.h \ |
8 | metafactory.h \ | 8 | metafactory.h \ |
9 | session.h \ | 9 | session.h \ |
10 | mainwindow.h \ | 10 | mainwindow.h \ |
11 | profile.h \ | 11 | profile.h \ |
12 | profileconfig.h \ | 12 | profileconfig.h \ |
13 | profilemanager.h \ | 13 | profilemanager.h \ |
14 | tabwidget.h \ | 14 | tabwidget.h \ |
15 | configdialog.h \ | 15 | configdialog.h \ |
16 | keytrans.h \ | 16 | keytrans.h \ |
17 | transferdialog.h \ | 17 | transferdialog.h \ |
18 | profiledialogwidget.h \ | 18 | profiledialogwidget.h \ |
19 | profileeditordialog.h \ | 19 | profileeditordialog.h \ |
20 | default.h \ | 20 | default.h \ |
21 | iolayerbase.h \ | 21 | iolayerbase.h \ |
22 | serialconfigwidget.h irdaconfigwidget.h \ | 22 | serialconfigwidget.h irdaconfigwidget.h \ |
23 | btconfigwidget.h modemconfigwidget.h \ | 23 | btconfigwidget.h modemconfigwidget.h \ |
24 | atconfigdialog.h dialdialog.h \ | 24 | atconfigdialog.h dialdialog.h \ |
25 | procctl.h \ | 25 | procctl.h \ |
26 | function_keyboard.h \ | 26 | function_keyboard.h \ |
27 | receive_layer.h filereceive.h \ | 27 | receive_layer.h filereceive.h \ |
28 | script.h \ | 28 | script.h \ |
29 | dialer.h \ | 29 | dialer.h \ |
30 | terminalwidget.h \ | 30 | terminalwidget.h \ |
31 | emulation_handler.h TECommon.h \ | 31 | emulation_handler.h TECommon.h \ |
32 | TEHistory.h TEScreen.h TEWidget.h \ | 32 | TEHistory.h TEScreen.h TEWidget.h \ |
33 | TEmuVt102.h TEmulation.h MyPty.h \ | 33 | TEmuVt102.h TEmulation.h MyPty.h \ |
34 | consoleconfigwidget.h | 34 | consoleconfigwidget.h |
35 | 35 | ||
36 | SOURCES = io_layer.cpp io_serial.cpp io_irda.cpp io_bt.cpp io_modem.cpp \ | 36 | SOURCES = io_layer.cpp io_serial.cpp io_irda.cpp io_bt.cpp io_modem.cpp \ |
37 | file_layer.cpp filetransfer.cpp \ | 37 | file_layer.cpp filetransfer.cpp \ |
38 | main.cpp \ | 38 | main.cpp \ |
39 | metafactory.cpp \ | 39 | metafactory.cpp \ |
40 | session.cpp \ | 40 | session.cpp \ |
41 | mainwindow.cpp \ | 41 | mainwindow.cpp \ |
42 | profile.cpp \ | 42 | profile.cpp \ |
43 | profileconfig.cpp \ | 43 | profileconfig.cpp \ |
44 | profilemanager.cpp \ | 44 | profilemanager.cpp \ |
45 | tabwidget.cpp \ | 45 | tabwidget.cpp \ |
46 | configdialog.cpp \ | 46 | configdialog.cpp \ |
47 | keytrans.cpp \ | 47 | keytrans.cpp \ |
48 | transferdialog.cpp \ | 48 | transferdialog.cpp \ |
49 | profiledialogwidget.cpp \ | 49 | profiledialogwidget.cpp \ |
50 | profileeditordialog.cpp \ | 50 | profileeditordialog.cpp \ |
51 | iolayerbase.cpp \ | 51 | iolayerbase.cpp \ |
52 | serialconfigwidget.cpp irdaconfigwidget.cpp \ | 52 | serialconfigwidget.cpp irdaconfigwidget.cpp \ |
53 | btconfigwidget.cpp modemconfigwidget.cpp \ | 53 | btconfigwidget.cpp modemconfigwidget.cpp \ |
54 | atconfigdialog.cpp dialdialog.cpp \ | 54 | atconfigdialog.cpp dialdialog.cpp \ |
55 | default.cpp procctl.cpp \ | 55 | default.cpp procctl.cpp \ |
56 | function_keyboard.cpp \ | 56 | function_keyboard.cpp \ |
57 | receive_layer.cpp filereceive.cpp \ | 57 | receive_layer.cpp filereceive.cpp \ |
58 | script.cpp \ | 58 | script.cpp \ |
59 | dialer.cpp \ | 59 | dialer.cpp \ |
60 | terminalwidget.cpp \ | 60 | terminalwidget.cpp \ |
61 | emulation_handler.cpp TEHistory.cpp \ | 61 | emulation_handler.cpp TEHistory.cpp \ |
62 | TEScreen.cpp TEWidget.cpp \ | 62 | TEScreen.cpp TEWidget.cpp \ |
63 | TEmuVt102.cpp TEmulation.cpp MyPty.cpp \ | 63 | TEmuVt102.cpp TEmulation.cpp MyPty.cpp \ |
64 | consoleconfigwidget.cpp | 64 | consoleconfigwidget.cpp |
65 | 65 | ||
66 | 66 | ||
67 | INTERFACES = configurebase.ui editbase.ui | 67 | INTERFACES = configurebase.ui editbase.ui |
68 | INCLUDEPATH += $(OPIEDIR)/include | 68 | INCLUDEPATH += $(OPIEDIR)/include |
69 | DEPENDPATH += $(OPIEDIR)/include | 69 | DEPENDPATH += $(OPIEDIR)/include |
70 | LIBS += -lqpe -lopie -lutil | 70 | LIBS += -lqpe -lopiecore2 -lopieui2 -lutil |
71 | TARGET = opie-console | 71 | TARGET = opie-console |
72 | 72 | ||
73 | 73 | ||
74 | 74 | ||
75 | 75 | ||
76 | include ( $(OPIEDIR)/include.pro ) | 76 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/apps/opie-console/profileeditordialog.h b/noncore/apps/opie-console/profileeditordialog.h index c731747..97bd650 100644 --- a/noncore/apps/opie-console/profileeditordialog.h +++ b/noncore/apps/opie-console/profileeditordialog.h | |||
@@ -1,37 +1,37 @@ | |||
1 | #ifndef PROFILE_EDITOR_DIALOG | 1 | #ifndef PROFILE_EDITOR_DIALOG |
2 | #define PROFILE_EDITOR_DIALOG | 2 | #define PROFILE_EDITOR_DIALOG |
3 | 3 | ||
4 | #include <qdialog.h> | 4 | #include <qdialog.h> |
5 | #include <opie/otabwidget.h> | 5 | #include <opie2/otabwidget.h> |
6 | 6 | ||
7 | #include "profile.h" | 7 | #include "profile.h" |
8 | 8 | ||
9 | class MetaFactory; | 9 | class MetaFactory; |
10 | class EditBase; | 10 | class EditBase; |
11 | class QTabWidget; | 11 | class QTabWidget; |
12 | class QHBoxLayout; | 12 | class QHBoxLayout; |
13 | class QLineEdit; | 13 | class QLineEdit; |
14 | class QComboBox; | 14 | class QComboBox; |
15 | class QCheckBox; | 15 | class QCheckBox; |
16 | class QLabel; | 16 | class QLabel; |
17 | class QScrollView; | 17 | class QScrollView; |
18 | class ProfileDialogWidget; | 18 | class ProfileDialogWidget; |
19 | 19 | ||
20 | class ProfileEditorDialog : public QDialog { | 20 | class ProfileEditorDialog : public QDialog { |
21 | Q_OBJECT | 21 | Q_OBJECT |
22 | public: | 22 | public: |
23 | ProfileEditorDialog(MetaFactory* fact, | 23 | ProfileEditorDialog(MetaFactory* fact, |
24 | const Profile& prof ); | 24 | const Profile& prof ); |
25 | ProfileEditorDialog(MetaFactory* fact ); | 25 | ProfileEditorDialog(MetaFactory* fact ); |
26 | ~ProfileEditorDialog(); | 26 | ~ProfileEditorDialog(); |
27 | Profile profile()const; | 27 | Profile profile()const; |
28 | 28 | ||
29 | 29 | ||
30 | 30 | ||
31 | public slots: | 31 | public slots: |
32 | void accept(); | 32 | void accept(); |
33 | 33 | ||
34 | private slots: | 34 | private slots: |
35 | void slotConActivated(const QString& ); | 35 | void slotConActivated(const QString& ); |
36 | void slotTermActivated( const QString& ); | 36 | void slotTermActivated( const QString& ); |
37 | void slotKeyActivated(const QString&); | 37 | void slotKeyActivated(const QString&); |
diff --git a/noncore/apps/opie-console/sz_transfer.cpp b/noncore/apps/opie-console/sz_transfer.cpp index 0a315cf..c47e73e 100644 --- a/noncore/apps/opie-console/sz_transfer.cpp +++ b/noncore/apps/opie-console/sz_transfer.cpp | |||
@@ -1,36 +1,35 @@ | |||
1 | 1 | ||
2 | #include "sz_transfer.h" | 2 | #include "sz_transfer.h" |
3 | #include <qfile.h> | 3 | #include <qfile.h> |
4 | #include <opie/oprocess.h> | ||
5 | #include <stdio.h> | 4 | #include <stdio.h> |
6 | #include <sys/termios.h> | 5 | #include <sys/termios.h> |
7 | 6 | ||
8 | 7 | ||
9 | 8 | ||
10 | SzTransfer::SzTransfer(Type t, IOLayer *layer) : FileTransferLayer(layer), m_t(t) | 9 | SzTransfer::SzTransfer(Type t, IOLayer *layer) : FileTransferLayer(layer), m_t(t) |
11 | { | 10 | { |
12 | } | 11 | } |
13 | 12 | ||
14 | SzTransfer::~SzTransfer() { | 13 | SzTransfer::~SzTransfer() { |
15 | } | 14 | } |
16 | 15 | ||
17 | void SzTransfer::sendFile(const QFile& file) { | 16 | void SzTransfer::sendFile(const QFile& file) { |
18 | 17 | ||
19 | sendFile(file.name()); | 18 | sendFile(file.name()); |
20 | } | 19 | } |
21 | 20 | ||
22 | void SzTransfer::sendFile(const QString& file) { | 21 | void SzTransfer::sendFile(const QString& file) { |
23 | 22 | ||
24 | //setcbreak(2); /* raw no echo */ | 23 | //setcbreak(2); /* raw no echo */ |
25 | 24 | ||
26 | proc = new OProcess; | 25 | proc = new OProcess; |
27 | *proc << "sz"; | 26 | *proc << "sz"; |
28 | *proc << "-v" << "-v" << "-b" << file; | 27 | *proc << "-v" << "-v" << "-b" << file; |
29 | connect(proc, SIGNAL(processExited(OProcess *)), | 28 | connect(proc, SIGNAL(processExited(OProcess *)), |
30 | this, SLOT(sent())); | 29 | this, SLOT(sent())); |
31 | connect(proc, SIGNAL(receivedStdout(OProcess *, char *, int)), | 30 | connect(proc, SIGNAL(receivedStdout(OProcess *, char *, int)), |
32 | this, SLOT(SzReceivedStdout(OProcess *, char *, int))); | 31 | this, SLOT(SzReceivedStdout(OProcess *, char *, int))); |
33 | connect(proc, SIGNAL(receivedStderr(OProcess *, char *, int)), | 32 | connect(proc, SIGNAL(receivedStderr(OProcess *, char *, int)), |
34 | this, SLOT(SzReceivedStderr(OProcess *, char *, int))); | 33 | this, SLOT(SzReceivedStderr(OProcess *, char *, int))); |
35 | connect(layer(), SIGNAL(received(const QByteArray &)), | 34 | connect(layer(), SIGNAL(received(const QByteArray &)), |
36 | this, SLOT(receivedStdin(const QByteArray &))); | 35 | this, SLOT(receivedStdin(const QByteArray &))); |
diff --git a/noncore/apps/opie-console/sz_transfer.h b/noncore/apps/opie-console/sz_transfer.h index d3e6621..aa97c32 100644 --- a/noncore/apps/opie-console/sz_transfer.h +++ b/noncore/apps/opie-console/sz_transfer.h | |||
@@ -1,37 +1,37 @@ | |||
1 | #ifndef OPIE_FL_SZ_H | 1 | #ifndef OPIE_FL_SZ_H |
2 | #define OPIE_FL_SZ_H | 2 | #define OPIE_FL_SZ_H |
3 | 3 | ||
4 | #include "file_layer.h" | 4 | #include "file_layer.h" |
5 | #include <opie/oprocess.h> | 5 | #include <opie2/oprocess.h> |
6 | 6 | ||
7 | class SzTransfer : public FileTransferLayer { | 7 | class SzTransfer : public FileTransferLayer { |
8 | 8 | ||
9 | Q_OBJECT | 9 | Q_OBJECT |
10 | 10 | ||
11 | public: | 11 | public: |
12 | enum Type { | 12 | enum Type { |
13 | SZ=0, | 13 | SZ=0, |
14 | SX, | 14 | SX, |
15 | SY | 15 | SY |
16 | }; | 16 | }; |
17 | 17 | ||
18 | SzTransfer( Type t, IOLayer * ); | 18 | SzTransfer( Type t, IOLayer * ); |
19 | ~SzTransfer(); | 19 | ~SzTransfer(); |
20 | 20 | ||
21 | public slots: | 21 | public slots: |
22 | /** | 22 | /** |
23 | * send a file over the layer | 23 | * send a file over the layer |
24 | */ | 24 | */ |
25 | void sendFile( const QString& file ) ; | 25 | void sendFile( const QString& file ) ; |
26 | void sendFile( const QFile& ); | 26 | void sendFile( const QFile& ); |
27 | void sent(); | 27 | void sent(); |
28 | 28 | ||
29 | private slots: | 29 | private slots: |
30 | void SzReceivedStdout(OProcess *, char *, int); | 30 | void SzReceivedStdout(OProcess *, char *, int); |
31 | void SzReceivedStderr(OProcess *, char *, int); | 31 | void SzReceivedStderr(OProcess *, char *, int); |
32 | void receivedStdin(const QByteArray &); | 32 | void receivedStdin(const QByteArray &); |
33 | 33 | ||
34 | private: | 34 | private: |
35 | OProcess *proc; | 35 | OProcess *proc; |
36 | Type m_t; | 36 | Type m_t; |
37 | 37 | ||
diff --git a/noncore/apps/opie-console/tabwidget.h b/noncore/apps/opie-console/tabwidget.h index cbaa0f1..98450a3 100644 --- a/noncore/apps/opie-console/tabwidget.h +++ b/noncore/apps/opie-console/tabwidget.h | |||
@@ -1,29 +1,29 @@ | |||
1 | #ifndef OPIE_TAB_WIDGET_H | 1 | #ifndef OPIE_TAB_WIDGET_H |
2 | #define OPIE_TAB_WIDGET_H | 2 | #define OPIE_TAB_WIDGET_H |
3 | 3 | ||
4 | #include <qmap.h> | 4 | #include <qmap.h> |
5 | #include <opie/otabwidget.h> | 5 | #include <opie2/otabwidget.h> |
6 | 6 | ||
7 | #include "session.h" | 7 | #include "session.h" |
8 | /** | 8 | /** |
9 | * This is our central tab widget | 9 | * This is our central tab widget |
10 | * we can add sessions here | 10 | * we can add sessions here |
11 | */ | 11 | */ |
12 | class TabWidget : public OTabWidget{ | 12 | class TabWidget : public OTabWidget{ |
13 | Q_OBJECT | 13 | Q_OBJECT |
14 | public: | 14 | public: |
15 | TabWidget(QWidget *parent, const char* name ); | 15 | TabWidget(QWidget *parent, const char* name ); |
16 | ~TabWidget(); | 16 | ~TabWidget(); |
17 | void add( Session* ); | 17 | void add( Session* ); |
18 | void remove( Session* ); | 18 | void remove( Session* ); |
19 | void setCurrent( Session* ); | 19 | void setCurrent( Session* ); |
20 | 20 | ||
21 | signals: | 21 | signals: |
22 | void activated(Session* ses ); | 22 | void activated(Session* ses ); |
23 | private slots: | 23 | private slots: |
24 | void slotCurChanged( QWidget* wid ); | 24 | void slotCurChanged( QWidget* wid ); |
25 | private: | 25 | private: |
26 | QMap<QWidget*, Session*> m_map; | 26 | QMap<QWidget*, Session*> m_map; |
27 | }; | 27 | }; |
28 | 28 | ||
29 | #endif | 29 | #endif |
diff --git a/noncore/apps/opie-console/test/console.pro b/noncore/apps/opie-console/test/console.pro index 7b4c310..624f381 100644 --- a/noncore/apps/opie-console/test/console.pro +++ b/noncore/apps/opie-console/test/console.pro | |||
@@ -1,21 +1,21 @@ | |||
1 | TEMPLATE = app | 1 | 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 ../sz_transfer.h ../file_layer.h\ | 5 | HEADERS = ../io_layer.h ../io_serial.h ../sz_transfer.h ../file_layer.h\ |
6 | senderui.h ../profile.h ../filetransfer.h ../procctl.h \ | 6 | senderui.h ../profile.h ../filetransfer.h ../procctl.h \ |
7 | ../filereceive.h ../receive_layer.h | 7 | ../filereceive.h ../receive_layer.h |
8 | SOURCES = ../io_layer.cpp ../io_serial.cpp \ | 8 | SOURCES = ../io_layer.cpp ../io_serial.cpp \ |
9 | ../profile.cpp ../sz_transfer.cpp ../file_layer.cpp\ | 9 | ../profile.cpp ../sz_transfer.cpp ../file_layer.cpp\ |
10 | main.cpp senderui.cpp ../filetransfer.cpp ../procctl.cpp \ | 10 | main.cpp senderui.cpp ../filetransfer.cpp ../procctl.cpp \ |
11 | ../filereceive.cpp ../receive_layer.cpp | 11 | ../filereceive.cpp ../receive_layer.cpp |
12 | INTERFACES = sender.ui | 12 | INTERFACES = sender.ui |
13 | INCLUDEPATH += $(OPIEDIR)/include | 13 | INCLUDEPATH += $(OPIEDIR)/include |
14 | DEPENDPATH += $(OPIEDIR)/include | 14 | DEPENDPATH += $(OPIEDIR)/include |
15 | LIBS += -lqpe -lopie | 15 | LIBS += -lqpe -lopiecore2 |
16 | TARGET = test | 16 | TARGET = test |
17 | 17 | ||
18 | 18 | ||
19 | 19 | ||
20 | 20 | ||
21 | include ( $(OPIEDIR)/include.pro ) | 21 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/apps/opie-console/test/senderui.cpp b/noncore/apps/opie-console/test/senderui.cpp index 4026808..4a7202d 100644 --- a/noncore/apps/opie-console/test/senderui.cpp +++ b/noncore/apps/opie-console/test/senderui.cpp | |||
@@ -1,46 +1,46 @@ | |||
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | #include <stdio.h> | 2 | #include <stdio.h> |
3 | #include <fcntl.h> | 3 | #include <fcntl.h> |
4 | #include <sys/termios.h> | 4 | #include <sys/termios.h> |
5 | 5 | ||
6 | #include <qmultilineedit.h> | 6 | #include <qmultilineedit.h> |
7 | #include <qsocketnotifier.h> | 7 | #include <qsocketnotifier.h> |
8 | 8 | ||
9 | #include "../profile.h" | 9 | #include "../profile.h" |
10 | #include "../io_serial.h" | 10 | #include "../io_serial.h" |
11 | #include "../filetransfer.h" | 11 | #include "../filetransfer.h" |
12 | #include "../filereceive.h" | 12 | #include "../filereceive.h" |
13 | 13 | ||
14 | #include <opie/oprocess.h> | 14 | #include <opie2/oprocess.h> |
15 | 15 | ||
16 | #include "senderui.h" | 16 | #include "senderui.h" |
17 | 17 | ||
18 | SenderUI::SenderUI() | 18 | SenderUI::SenderUI() |
19 | : Sender() { | 19 | : Sender() { |
20 | 20 | ||
21 | /* we do that manually */ | 21 | /* we do that manually */ |
22 | Profile prof; | 22 | Profile prof; |
23 | QString str = "/dev/bty0"; | 23 | QString str = "/dev/bty0"; |
24 | prof.writeEntry("Device",str ); | 24 | prof.writeEntry("Device",str ); |
25 | prof.writeEntry("Baud", 19200 ); | 25 | prof.writeEntry("Baud", 19200 ); |
26 | 26 | ||
27 | qWarning("prof " + prof.readEntry("Device") + " " + str); | 27 | qWarning("prof " + prof.readEntry("Device") + " " + str); |
28 | ser = new IOSerial(prof); | 28 | ser = new IOSerial(prof); |
29 | connect(ser, SIGNAL(received(const QByteArray& ) ), | 29 | connect(ser, SIGNAL(received(const QByteArray& ) ), |
30 | this, SLOT(got(const QByteArray&) ) ); | 30 | this, SLOT(got(const QByteArray&) ) ); |
31 | 31 | ||
32 | if ( ser->open() ) | 32 | if ( ser->open() ) |
33 | qWarning("opened!!!"); | 33 | qWarning("opened!!!"); |
34 | else | 34 | else |
35 | qWarning("could not open"); | 35 | qWarning("could not open"); |
36 | 36 | ||
37 | 37 | ||
38 | } | 38 | } |
39 | SenderUI::~SenderUI() { | 39 | SenderUI::~SenderUI() { |
40 | 40 | ||
41 | } | 41 | } |
42 | void SenderUI::slotSendFile() { | 42 | void SenderUI::slotSendFile() { |
43 | 43 | ||
44 | sz = new FileTransfer(FileTransfer::SY, ser); | 44 | sz = new FileTransfer(FileTransfer::SY, ser); |
45 | sz->sendFile("/home/ich/bootopie-v06-13.jffs2"); | 45 | sz->sendFile("/home/ich/bootopie-v06-13.jffs2"); |
46 | 46 | ||
diff --git a/noncore/apps/opie-console/transferdialog.cpp b/noncore/apps/opie-console/transferdialog.cpp index 55dd748..30e7caf 100644 --- a/noncore/apps/opie-console/transferdialog.cpp +++ b/noncore/apps/opie-console/transferdialog.cpp | |||
@@ -1,275 +1,275 @@ | |||
1 | #include <qlayout.h> | 1 | #include <qlayout.h> |
2 | #include <qcombobox.h> | 2 | #include <qcombobox.h> |
3 | #include <qlabel.h> | 3 | #include <qlabel.h> |
4 | #include <qlineedit.h> | 4 | #include <qlineedit.h> |
5 | #include <qpushbutton.h> | 5 | #include <qpushbutton.h> |
6 | #include <qmessagebox.h> | 6 | #include <qmessagebox.h> |
7 | #include <qprogressbar.h> | 7 | #include <qprogressbar.h> |
8 | #include <qradiobutton.h> | 8 | #include <qradiobutton.h> |
9 | #include <qbuttongroup.h> | 9 | #include <qbuttongroup.h> |
10 | 10 | ||
11 | #include <opie/ofiledialog.h> | 11 | #include <opie2/ofiledialog.h> |
12 | 12 | ||
13 | #include "metafactory.h" | 13 | #include "metafactory.h" |
14 | #include "mainwindow.h" | 14 | #include "mainwindow.h" |
15 | 15 | ||
16 | #include "transferdialog.h" | 16 | #include "transferdialog.h" |
17 | 17 | ||
18 | TransferDialog::TransferDialog(QWidget *parent, MainWindow *mainwindow, const char *) | 18 | TransferDialog::TransferDialog(QWidget *parent, MainWindow *mainwindow, const char *) |
19 | : QDialog(parent, 0l, false), m_win(mainwindow) | 19 | : QDialog(parent, 0l, false), m_win(mainwindow) |
20 | { | 20 | { |
21 | m_lay = 0l; | 21 | m_lay = 0l; |
22 | m_recvlay = 0l; | 22 | m_recvlay = 0l; |
23 | QVBoxLayout *vbox, *vbox2; | 23 | QVBoxLayout *vbox, *vbox2; |
24 | QHBoxLayout *hbox, *hbox2, *hbox3; | 24 | QHBoxLayout *hbox, *hbox2, *hbox3; |
25 | QLabel *file, *mode, *progress, *status; | 25 | QLabel *file, *mode, *progress, *status; |
26 | QButtonGroup *group; | 26 | QButtonGroup *group; |
27 | QRadioButton *mode_send, *mode_receive; | 27 | QRadioButton *mode_send, *mode_receive; |
28 | 28 | ||
29 | m_autocleanup = 0; | 29 | m_autocleanup = 0; |
30 | m_running = true; | 30 | m_running = true; |
31 | 31 | ||
32 | group = new QButtonGroup(QObject::tr("Transfer mode"), this); | 32 | group = new QButtonGroup(QObject::tr("Transfer mode"), this); |
33 | mode_send = new QRadioButton(QObject::tr("Send"), group); | 33 | mode_send = new QRadioButton(QObject::tr("Send"), group); |
34 | mode_receive = new QRadioButton(QObject::tr("Receive"), group); | 34 | mode_receive = new QRadioButton(QObject::tr("Receive"), group); |
35 | group->insert(mode_send, id_send); | 35 | group->insert(mode_send, id_send); |
36 | group->insert(mode_receive, id_receive); | 36 | group->insert(mode_receive, id_receive); |
37 | vbox2 = new QVBoxLayout(group, 2); | 37 | vbox2 = new QVBoxLayout(group, 2); |
38 | vbox2->addSpacing(10); | 38 | vbox2->addSpacing(10); |
39 | hbox3 = new QHBoxLayout(vbox2, 2); | 39 | hbox3 = new QHBoxLayout(vbox2, 2); |
40 | hbox3->add(mode_send); | 40 | hbox3->add(mode_send); |
41 | hbox3->add(mode_receive); | 41 | hbox3->add(mode_receive); |
42 | mode_send->setChecked(true); | 42 | mode_send->setChecked(true); |
43 | m_transfermode = id_send; | 43 | m_transfermode = id_send; |
44 | 44 | ||
45 | file = new QLabel(QObject::tr("Send file"), this); | 45 | file = new QLabel(QObject::tr("Send file"), this); |
46 | mode = new QLabel(QObject::tr("Transfer protocol"), this); | 46 | mode = new QLabel(QObject::tr("Transfer protocol"), this); |
47 | progress = new QLabel(QObject::tr("Progress"), this); | 47 | progress = new QLabel(QObject::tr("Progress"), this); |
48 | status = new QLabel(QObject::tr("Status"), this); | 48 | status = new QLabel(QObject::tr("Status"), this); |
49 | 49 | ||
50 | statusbar = new QLabel(QObject::tr("Ready"), this); | 50 | statusbar = new QLabel(QObject::tr("Ready"), this); |
51 | statusbar->setFrameStyle(QFrame::Panel | QFrame::Sunken); | 51 | statusbar->setFrameStyle(QFrame::Panel | QFrame::Sunken); |
52 | 52 | ||
53 | protocol = new QComboBox(this); | 53 | protocol = new QComboBox(this); |
54 | QStringList list = m_win->factory()->fileTransferLayers(); | 54 | QStringList list = m_win->factory()->fileTransferLayers(); |
55 | for (QStringList::Iterator it = list.begin(); it != list.end(); ++it) | 55 | for (QStringList::Iterator it = list.begin(); it != list.end(); ++it) |
56 | protocol->insertItem((*it)); | 56 | protocol->insertItem((*it)); |
57 | 57 | ||
58 | filename = new QLineEdit(this); | 58 | filename = new QLineEdit(this); |
59 | 59 | ||
60 | progressbar = new QProgressBar(this); | 60 | progressbar = new QProgressBar(this); |
61 | progressbar->setProgress(0); | 61 | progressbar->setProgress(0); |
62 | 62 | ||
63 | selector = new QPushButton("...", this); | 63 | selector = new QPushButton("...", this); |
64 | ok = new QPushButton(QObject::tr("Start transfer"), this); | 64 | ok = new QPushButton(QObject::tr("Start transfer"), this); |
65 | cancel = new QPushButton(QObject::tr("Cancel"), this); | 65 | cancel = new QPushButton(QObject::tr("Cancel"), this); |
66 | 66 | ||
67 | vbox = new QVBoxLayout(this, 2); | 67 | vbox = new QVBoxLayout(this, 2); |
68 | vbox->add(group); | 68 | vbox->add(group); |
69 | vbox->add(file); | 69 | vbox->add(file); |
70 | hbox = new QHBoxLayout(vbox, 0); | 70 | hbox = new QHBoxLayout(vbox, 0); |
71 | hbox->add(filename); | 71 | hbox->add(filename); |
72 | hbox->add(selector); | 72 | hbox->add(selector); |
73 | vbox->add(mode); | 73 | vbox->add(mode); |
74 | vbox->add(protocol); | 74 | vbox->add(protocol); |
75 | vbox->add(progress); | 75 | vbox->add(progress); |
76 | vbox->add(progressbar); | 76 | vbox->add(progressbar); |
77 | vbox->add(status); | 77 | vbox->add(status); |
78 | vbox->add(statusbar); | 78 | vbox->add(statusbar); |
79 | vbox->addStretch(1); | 79 | vbox->addStretch(1); |
80 | hbox2 = new QHBoxLayout(vbox, 2); | 80 | hbox2 = new QHBoxLayout(vbox, 2); |
81 | hbox2->add(ok); | 81 | hbox2->add(ok); |
82 | hbox2->add(cancel); | 82 | hbox2->add(cancel); |
83 | 83 | ||
84 | setCaption(QObject::tr("File transfer")); | 84 | setCaption(QObject::tr("File transfer")); |
85 | show(); | 85 | show(); |
86 | 86 | ||
87 | connect(selector, SIGNAL(clicked()), SLOT(slotFilename())); | 87 | connect(selector, SIGNAL(clicked()), SLOT(slotFilename())); |
88 | connect(ok, SIGNAL(clicked()), SLOT(slotTransfer())); | 88 | connect(ok, SIGNAL(clicked()), SLOT(slotTransfer())); |
89 | connect(cancel, SIGNAL(clicked()), SLOT(slotCancel())); | 89 | connect(cancel, SIGNAL(clicked()), SLOT(slotCancel())); |
90 | connect(group, SIGNAL(clicked(int)), SLOT(slotMode(int))); | 90 | connect(group, SIGNAL(clicked(int)), SLOT(slotMode(int))); |
91 | } | 91 | } |
92 | 92 | ||
93 | TransferDialog::~TransferDialog() | 93 | TransferDialog::~TransferDialog() |
94 | { | 94 | { |
95 | } | 95 | } |
96 | 96 | ||
97 | void TransferDialog::slotFilename() | 97 | void TransferDialog::slotFilename() |
98 | { | 98 | { |
99 | QString f; | 99 | QString f; |
100 | 100 | ||
101 | f = OFileDialog::getOpenFileName(0); | 101 | f = Opie::OFileDialog::getOpenFileName(0); |
102 | if(!f.isNull()) filename->setText(f); | 102 | if(!f.isNull()) filename->setText(f); |
103 | } | 103 | } |
104 | 104 | ||
105 | void TransferDialog::slotTransfer() | 105 | void TransferDialog::slotTransfer() |
106 | { | 106 | { |
107 | if((m_transfermode == id_send) && (filename->text().isEmpty())) | 107 | if((m_transfermode == id_send) && (filename->text().isEmpty())) |
108 | { | 108 | { |
109 | QMessageBox::information(this, | 109 | QMessageBox::information(this, |
110 | QObject::tr("Attention"), | 110 | QObject::tr("Attention"), |
111 | QObject::tr("No file has been specified.")); | 111 | QObject::tr("No file has been specified.")); |
112 | return; | 112 | return; |
113 | } | 113 | } |
114 | 114 | ||
115 | ok->setEnabled(false); | 115 | ok->setEnabled(false); |
116 | 116 | ||
117 | cleanup(); | 117 | cleanup(); |
118 | m_autocleanup = 0; | 118 | m_autocleanup = 0; |
119 | 119 | ||
120 | if(m_transfermode == id_send) statusbar->setText(QObject::tr("Sending...")); | 120 | if(m_transfermode == id_send) statusbar->setText(QObject::tr("Sending...")); |
121 | else statusbar->setText(QObject::tr("Receiving...")); | 121 | else statusbar->setText(QObject::tr("Receiving...")); |
122 | 122 | ||
123 | if(m_transfermode == id_send) | 123 | if(m_transfermode == id_send) |
124 | { | 124 | { |
125 | m_lay = m_win->factory()->newFileTransfer(protocol->currentText(), m_win->currentSession()->layer()); | 125 | m_lay = m_win->factory()->newFileTransfer(protocol->currentText(), m_win->currentSession()->layer()); |
126 | m_lay->sendFile(filename->text()); | 126 | m_lay->sendFile(filename->text()); |
127 | 127 | ||
128 | connect(m_lay, SIGNAL(progress(const QString&, int, int, int, int, int)), | 128 | connect(m_lay, SIGNAL(progress(const QString&, int, int, int, int, int)), |
129 | SLOT(slotProgress(const QString&, int, int, int, int, int))); | 129 | SLOT(slotProgress(const QString&, int, int, int, int, int))); |
130 | connect(m_lay, SIGNAL(error(int, const QString&)), SLOT(slotError(int, const QString&))); | 130 | connect(m_lay, SIGNAL(error(int, const QString&)), SLOT(slotError(int, const QString&))); |
131 | connect(m_lay, SIGNAL(sent()), SLOT(slotSent())); | 131 | connect(m_lay, SIGNAL(sent()), SLOT(slotSent())); |
132 | } | 132 | } |
133 | else | 133 | else |
134 | { | 134 | { |
135 | m_recvlay = m_win->factory()->newReceive(protocol->currentText(), m_win->currentSession()->layer()); | 135 | m_recvlay = m_win->factory()->newReceive(protocol->currentText(), m_win->currentSession()->layer()); |
136 | m_recvlay->receive(); | 136 | m_recvlay->receive(); |
137 | 137 | ||
138 | connect(m_recvlay, SIGNAL(progress(const QString&, int, int, int, int, int)), | 138 | connect(m_recvlay, SIGNAL(progress(const QString&, int, int, int, int, int)), |
139 | SLOT(slotProgress(const QString&, int, int, int, int, int))); | 139 | SLOT(slotProgress(const QString&, int, int, int, int, int))); |
140 | connect(m_recvlay, SIGNAL(error(int, const QString&)), SLOT(slotError(int, const QString&))); | 140 | connect(m_recvlay, SIGNAL(error(int, const QString&)), SLOT(slotError(int, const QString&))); |
141 | connect(m_recvlay, SIGNAL(received(const QString&)), SLOT(slotReceived(const QString&))); | 141 | connect(m_recvlay, SIGNAL(received(const QString&)), SLOT(slotReceived(const QString&))); |
142 | } | 142 | } |
143 | } | 143 | } |
144 | 144 | ||
145 | void TransferDialog::cleanup() | 145 | void TransferDialog::cleanup() |
146 | { | 146 | { |
147 | if(m_lay) | 147 | if(m_lay) |
148 | { | 148 | { |
149 | m_lay->cancel(); | 149 | m_lay->cancel(); |
150 | delete m_lay; | 150 | delete m_lay; |
151 | m_lay = 0l; | 151 | m_lay = 0l; |
152 | } | 152 | } |
153 | if(m_recvlay) | 153 | if(m_recvlay) |
154 | { | 154 | { |
155 | m_recvlay->cancel(); | 155 | m_recvlay->cancel(); |
156 | delete m_recvlay; | 156 | delete m_recvlay; |
157 | m_recvlay = 0l; | 157 | m_recvlay = 0l; |
158 | } | 158 | } |
159 | } | 159 | } |
160 | 160 | ||
161 | void TransferDialog::slotCancel() | 161 | void TransferDialog::slotCancel() |
162 | { | 162 | { |
163 | ok->setEnabled(true); | 163 | ok->setEnabled(true); |
164 | statusbar->setText(QObject::tr("Ready")); | 164 | statusbar->setText(QObject::tr("Ready")); |
165 | 165 | ||
166 | if((m_lay) || (m_recvlay)) | 166 | if((m_lay) || (m_recvlay)) |
167 | { | 167 | { |
168 | cleanup(); | 168 | cleanup(); |
169 | if(m_autocleanup) | 169 | if(m_autocleanup) |
170 | { | 170 | { |
171 | m_running = false; | 171 | m_running = false; |
172 | close(); | 172 | close(); |
173 | } | 173 | } |
174 | else | 174 | else |
175 | { | 175 | { |
176 | QMessageBox::information(this, | 176 | QMessageBox::information(this, |
177 | QObject::tr("Cancelled"), | 177 | QObject::tr("Cancelled"), |
178 | QObject::tr("The file transfer has been cancelled.")); | 178 | QObject::tr("The file transfer has been cancelled.")); |
179 | } | 179 | } |
180 | } | 180 | } |
181 | else | 181 | else |
182 | { | 182 | { |
183 | m_running = false; | 183 | m_running = false; |
184 | close(); | 184 | close(); |
185 | } | 185 | } |
186 | } | 186 | } |
187 | 187 | ||
188 | void TransferDialog::slotProgress(const QString& , int progress, int , int , int, int ) | 188 | void TransferDialog::slotProgress(const QString& , int progress, int , int , int, int ) |
189 | { | 189 | { |
190 | progressbar->setProgress(progress); | 190 | progressbar->setProgress(progress); |
191 | } | 191 | } |
192 | 192 | ||
193 | void TransferDialog::slotError(int error, const QString& ) | 193 | void TransferDialog::slotError(int error, const QString& ) |
194 | { | 194 | { |
195 | statusbar->setText(QObject::tr("Ready")); | 195 | statusbar->setText(QObject::tr("Ready")); |
196 | 196 | ||
197 | switch(error) | 197 | switch(error) |
198 | { | 198 | { |
199 | case FileTransferLayer::NotSupported: | 199 | case FileTransferLayer::NotSupported: |
200 | QMessageBox::critical(this, | 200 | QMessageBox::critical(this, |
201 | QObject::tr("Error"), | 201 | QObject::tr("Error"), |
202 | QObject::tr("Operation not supported.")); | 202 | QObject::tr("Operation not supported.")); |
203 | break; | 203 | break; |
204 | case FileTransferLayer::StartError: | 204 | case FileTransferLayer::StartError: |
205 | QMessageBox::critical(this, | 205 | QMessageBox::critical(this, |
206 | QObject::tr("Error"), | 206 | QObject::tr("Error"), |
207 | QObject::tr("Transfer could not be started.")); | 207 | QObject::tr("Transfer could not be started.")); |
208 | break; | 208 | break; |
209 | case FileTransferLayer::NoError: | 209 | case FileTransferLayer::NoError: |
210 | QMessageBox::critical(this, | 210 | QMessageBox::critical(this, |
211 | QObject::tr("Error"), | 211 | QObject::tr("Error"), |
212 | QObject::tr("No error.")); | 212 | QObject::tr("No error.")); |
213 | break; | 213 | break; |
214 | case FileTransferLayer::Undefined: | 214 | case FileTransferLayer::Undefined: |
215 | QMessageBox::critical(this, | 215 | QMessageBox::critical(this, |
216 | QObject::tr("Error"), | 216 | QObject::tr("Error"), |
217 | QObject::tr("Undefined error occured.")); | 217 | QObject::tr("Undefined error occured.")); |
218 | break; | 218 | break; |
219 | case FileTransferLayer::Incomplete: | 219 | case FileTransferLayer::Incomplete: |
220 | QMessageBox::critical(this, | 220 | QMessageBox::critical(this, |
221 | QObject::tr("Error"), | 221 | QObject::tr("Error"), |
222 | QObject::tr("Incomplete transfer.")); | 222 | QObject::tr("Incomplete transfer.")); |
223 | break; | 223 | break; |
224 | case FileTransferLayer::Unknown: | 224 | case FileTransferLayer::Unknown: |
225 | default: | 225 | default: |
226 | QMessageBox::critical(this, | 226 | QMessageBox::critical(this, |
227 | QObject::tr("Error"), | 227 | QObject::tr("Error"), |
228 | QObject::tr("Unknown error occured.")); | 228 | QObject::tr("Unknown error occured.")); |
229 | break; | 229 | break; |
230 | } | 230 | } |
231 | 231 | ||
232 | m_autocleanup = 1; | 232 | m_autocleanup = 1; |
233 | } | 233 | } |
234 | 234 | ||
235 | void TransferDialog::slotSent() | 235 | void TransferDialog::slotSent() |
236 | { | 236 | { |
237 | progressbar->setProgress(100); | 237 | progressbar->setProgress(100); |
238 | QMessageBox::information(this, QObject::tr("Sent"), QObject::tr("File has been sent.")); | 238 | QMessageBox::information(this, QObject::tr("Sent"), QObject::tr("File has been sent.")); |
239 | ok->setEnabled(true); | 239 | ok->setEnabled(true); |
240 | progressbar->setProgress(0); | 240 | progressbar->setProgress(0); |
241 | statusbar->setText(QObject::tr("Ready")); | 241 | statusbar->setText(QObject::tr("Ready")); |
242 | m_autocleanup = 1; | 242 | m_autocleanup = 1; |
243 | } | 243 | } |
244 | 244 | ||
245 | void TransferDialog::slotReceived(const QString& ) | 245 | void TransferDialog::slotReceived(const QString& ) |
246 | { | 246 | { |
247 | progressbar->setProgress(100); | 247 | progressbar->setProgress(100); |
248 | QMessageBox::information(this, QObject::tr("Received"), QObject::tr("File has been received.")); | 248 | QMessageBox::information(this, QObject::tr("Received"), QObject::tr("File has been received.")); |
249 | //QMessageBox::information(this, QObject::tr("Sent"), QObject::tr("File has been received as %1.").arg(file)); | 249 | //QMessageBox::information(this, QObject::tr("Sent"), QObject::tr("File has been received as %1.").arg(file)); |
250 | ok->setEnabled(true); | 250 | ok->setEnabled(true); |
251 | progressbar->setProgress(0); | 251 | progressbar->setProgress(0); |
252 | statusbar->setText(QObject::tr("Ready")); | 252 | statusbar->setText(QObject::tr("Ready")); |
253 | m_autocleanup = 1; | 253 | m_autocleanup = 1; |
254 | } | 254 | } |
255 | 255 | ||
256 | void TransferDialog::slotMode(int id) | 256 | void TransferDialog::slotMode(int id) |
257 | { | 257 | { |
258 | if(id == id_send) | 258 | if(id == id_send) |
259 | { | 259 | { |
260 | selector->setEnabled(true); | 260 | selector->setEnabled(true); |
261 | filename->setEnabled(true); | 261 | filename->setEnabled(true); |
262 | } | 262 | } |
263 | else | 263 | else |
264 | { | 264 | { |
265 | selector->setEnabled(false); | 265 | selector->setEnabled(false); |
266 | filename->setEnabled(false); | 266 | filename->setEnabled(false); |
267 | } | 267 | } |
268 | m_transfermode = id; | 268 | m_transfermode = id; |
269 | } | 269 | } |
270 | 270 | ||
271 | bool TransferDialog::isRunning() | 271 | bool TransferDialog::isRunning() |
272 | { | 272 | { |
273 | return m_running; | 273 | return m_running; |
274 | } | 274 | } |
275 | 275 | ||