-rw-r--r-- | noncore/apps/opie-console/MyPty.cpp | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_bt.cpp | 12 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_bt.h | 13 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_irda.cpp | 12 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_irda.h | 13 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_layer.cpp | 1 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_layer.h | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_modem.cpp | 11 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_modem.h | 13 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_serial.h | 21 | ||||
-rw-r--r-- | noncore/apps/opie-console/opie-console.pro | 12 |
11 files changed, 81 insertions, 35 deletions
diff --git a/noncore/apps/opie-console/MyPty.cpp b/noncore/apps/opie-console/MyPty.cpp index 23d4966..b2f6a74 100644 --- a/noncore/apps/opie-console/MyPty.cpp +++ b/noncore/apps/opie-console/MyPty.cpp | |||
@@ -203,20 +203,20 @@ int MyPty::run(const char* cmd, QStrList &, const char*, int) | |||
203 | 203 | ||
204 | int MyPty::openPty() | 204 | int MyPty::openPty() |
205 | { | 205 | { |
206 | // This is code from the Qt DumbTerminal example | 206 | // This is code from the Qt DumbTerminal example |
207 | int ptyfd = -1; | 207 | int ptyfd = -1; |
208 | 208 | ||
209 | #ifdef HAVE_OPENPTY | 209 | #ifdef HAVE_OPENPTY |
210 | int ttyfd; | 210 | int ttyfd; |
211 | if ( openpty(&ptyfd,&ttyfd,ttynam,0,0) ) | 211 | if ( openpty(&ptyfd,&ttyfd,m_ttynam,0,0) ) |
212 | ptyfd = -1; | 212 | ptyfd = -1; |
213 | else | 213 | else |
214 | close(ttyfd); // we open the ttynam ourselves. | 214 | ::close(ttyfd); // we open the ttynam ourselves. |
215 | #else | 215 | #else |
216 | for (const char* c0 = "pqrstuvwxyzabcde"; ptyfd < 0 && *c0 != 0; c0++) { | 216 | for (const char* c0 = "pqrstuvwxyzabcde"; ptyfd < 0 && *c0 != 0; c0++) { |
217 | for (const char* c1 = "0123456789abcdef"; ptyfd < 0 && *c1 != 0; c1++) { | 217 | for (const char* c1 = "0123456789abcdef"; ptyfd < 0 && *c1 != 0; c1++) { |
218 | sprintf(m_ptynam,"/dev/pty%c%c",*c0,*c1); | 218 | sprintf(m_ptynam,"/dev/pty%c%c",*c0,*c1); |
219 | sprintf(m_ttynam,"/dev/tty%c%c",*c0,*c1); | 219 | sprintf(m_ttynam,"/dev/tty%c%c",*c0,*c1); |
220 | if ((ptyfd = ::open(m_ptynam,O_RDWR)) >= 0) { | 220 | if ((ptyfd = ::open(m_ptynam,O_RDWR)) >= 0) { |
221 | if (geteuid() != 0 && !access(m_ttynam,R_OK|W_OK) == 0) { | 221 | if (geteuid() != 0 && !access(m_ttynam,R_OK|W_OK) == 0) { |
222 | ::close(ptyfd); | 222 | ::close(ptyfd); |
diff --git a/noncore/apps/opie-console/io_bt.cpp b/noncore/apps/opie-console/io_bt.cpp index 8dd8151..37bf797 100644 --- a/noncore/apps/opie-console/io_bt.cpp +++ b/noncore/apps/opie-console/io_bt.cpp | |||
@@ -73,8 +73,20 @@ QString IOBt::identifier() const { | |||
73 | QString IOBt::name() const { | 73 | QString IOBt::name() const { |
74 | return "BLuetooth IO Layer"; | 74 | return "BLuetooth IO Layer"; |
75 | } | 75 | } |
76 | 76 | ||
77 | void IOBt::slotExited( OProcess* proc ){ | 77 | void IOBt::slotExited( OProcess* proc ){ |
78 | close(); | 78 | close(); |
79 | delete proc; | 79 | delete proc; |
80 | } | 80 | } |
81 | |||
82 | QBitArray IOBt::supports() const { | ||
83 | return QBitArray( 3 ); | ||
84 | } | ||
85 | |||
86 | bool IOBt::isConnected() { | ||
87 | return false; | ||
88 | } | ||
89 | |||
90 | void IOBt::send(const QByteArray &data) { | ||
91 | qDebug( "Please overload me..." ); | ||
92 | } | ||
diff --git a/noncore/apps/opie-console/io_bt.h b/noncore/apps/opie-console/io_bt.h index 5e9988c..239eefb 100644 --- a/noncore/apps/opie-console/io_bt.h +++ b/noncore/apps/opie-console/io_bt.h | |||
@@ -20,27 +20,30 @@ 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 | QString identifier() const; | 28 | virtual QString identifier() const; |
29 | QString name() const; | 29 | virtual QString name() const; |
30 | virtual QBitArray supports() const; | ||
31 | virtual bool isConnected(); | ||
30 | 32 | ||
31 | signals: | 33 | signals: |
32 | void received(const QByteArray &); | 34 | void received(const QByteArray &); |
33 | void error(int, const QString &); | 35 | void error(int, const QString &); |
34 | 36 | ||
35 | public slots: | 37 | public slots: |
36 | bool open(); | 38 | virtual void send( const QByteArray& ); |
37 | void close(); | 39 | virtual bool open(); |
38 | void reload(const Profile &); | 40 | virtual void close(); |
41 | virtual void reload(const Profile &); | ||
39 | 42 | ||
40 | private: | 43 | private: |
41 | OProcess *m_attach; | 44 | OProcess *m_attach; |
42 | QString m_mac; | 45 | QString m_mac; |
43 | private slots: | 46 | private slots: |
44 | void slotExited(OProcess* proc); | 47 | void slotExited(OProcess* proc); |
45 | 48 | ||
46 | }; | 49 | }; |
diff --git a/noncore/apps/opie-console/io_irda.cpp b/noncore/apps/opie-console/io_irda.cpp index b3b693f..e360fb4 100644 --- a/noncore/apps/opie-console/io_irda.cpp +++ b/noncore/apps/opie-console/io_irda.cpp | |||
@@ -58,8 +58,20 @@ QString IOIrda::identifier() const { | |||
58 | QString IOIrda::name() const { | 58 | QString IOIrda::name() const { |
59 | return "Irda IO Layer"; | 59 | return "Irda IO Layer"; |
60 | } | 60 | } |
61 | 61 | ||
62 | void IOIrda::slotExited(OProcess* proc ){ | 62 | void IOIrda::slotExited(OProcess* proc ){ |
63 | close(); | 63 | close(); |
64 | delete proc; | 64 | delete proc; |
65 | } | 65 | } |
66 | |||
67 | QBitArray IOIrda::supports()const { | ||
68 | return QBitArray( 3 ); | ||
69 | } | ||
70 | |||
71 | bool IOIrda::isConnected() { | ||
72 | return false; | ||
73 | } | ||
74 | |||
75 | void IOIrda::send(const QByteArray &data) { | ||
76 | qDebug( "Please overload me..." ); | ||
77 | } | ||
diff --git a/noncore/apps/opie-console/io_irda.h b/noncore/apps/opie-console/io_irda.h index 3aee951..14b1ae3 100644 --- a/noncore/apps/opie-console/io_irda.h +++ b/noncore/apps/opie-console/io_irda.h | |||
@@ -18,27 +18,30 @@ 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 | QString identifier() const; | 26 | virtual QString identifier() const; |
27 | QString name() const; | 27 | virtual QString name() const; |
28 | virtual QBitArray supports() const; | ||
29 | virtual bool isConnected(); | ||
28 | 30 | ||
29 | signals: | 31 | signals: |
30 | void received(const QByteArray &); | 32 | void received(const QByteArray &); |
31 | void error(int, const QString &); | 33 | void error(int, const QString &); |
32 | 34 | ||
33 | public slots: | 35 | public slots: |
34 | bool open(); | 36 | virtual void send( const QByteArray& ); |
35 | void close(); | 37 | virtual bool open(); |
36 | void reload(const Profile &); | 38 | virtual void close(); |
39 | virtual void reload(const Profile &); | ||
37 | 40 | ||
38 | private: | 41 | private: |
39 | OProcess *m_attach; | 42 | OProcess *m_attach; |
40 | 43 | ||
41 | private slots: | 44 | private slots: |
42 | void slotExited(OProcess* proc); | 45 | void slotExited(OProcess* proc); |
43 | 46 | ||
44 | }; | 47 | }; |
diff --git a/noncore/apps/opie-console/io_layer.cpp b/noncore/apps/opie-console/io_layer.cpp index 975ee60..52ec828 100644 --- a/noncore/apps/opie-console/io_layer.cpp +++ b/noncore/apps/opie-console/io_layer.cpp | |||
@@ -15,8 +15,9 @@ IOLayer::~IOLayer() { | |||
15 | int IOLayer::rawIO()const{ | 15 | int IOLayer::rawIO()const{ |
16 | return -1; | 16 | return -1; |
17 | } | 17 | } |
18 | void IOLayer::closeRawIO(int) { | 18 | void IOLayer::closeRawIO(int) { |
19 | 19 | ||
20 | } | 20 | } |
21 | void IOLayer::setSize(int, int ) { | 21 | void IOLayer::setSize(int, int ) { |
22 | } | 22 | } |
23 | |||
diff --git a/noncore/apps/opie-console/io_layer.h b/noncore/apps/opie-console/io_layer.h index ed4478b..4f9bbe4 100644 --- a/noncore/apps/opie-console/io_layer.h +++ b/noncore/apps/opie-console/io_layer.h | |||
@@ -60,29 +60,29 @@ public: | |||
60 | 60 | ||
61 | /** | 61 | /** |
62 | * a file descriptor which opens | 62 | * a file descriptor which opens |
63 | * the device for io but does not | 63 | * the device for io but does not |
64 | * do any ioctling on it... | 64 | * do any ioctling on it... |
65 | * and it'll stop listening to the before opened | 65 | * and it'll stop listening to the before opened |
66 | * device | 66 | * device |
67 | */ | 67 | */ |
68 | virtual int rawIO()const; | 68 | virtual int rawIO() const; |
69 | 69 | ||
70 | /** | 70 | /** |
71 | * will close the rawIO stuff | 71 | * will close the rawIO stuff |
72 | * and will listen to it's data again... | 72 | * and will listen to it's data again... |
73 | */ | 73 | */ |
74 | virtual void closeRawIO(int); | 74 | virtual void closeRawIO(int); |
75 | 75 | ||
76 | /** | 76 | /** |
77 | * What does the IOLayer support? | 77 | * What does the IOLayer support? |
78 | * Bits are related to features | 78 | * Bits are related to features |
79 | */ | 79 | */ |
80 | virtual QBitArray supports()const = 0; | 80 | virtual QBitArray supports() const = 0; |
81 | 81 | ||
82 | virtual bool isConnected() = 0; | 82 | virtual bool isConnected() = 0; |
83 | 83 | ||
84 | signals: | 84 | signals: |
85 | /** | 85 | /** |
86 | * received input as QCString | 86 | * received input as QCString |
87 | */ | 87 | */ |
88 | virtual void received( const QByteArray& ); | 88 | virtual void received( const QByteArray& ); |
diff --git a/noncore/apps/opie-console/io_modem.cpp b/noncore/apps/opie-console/io_modem.cpp index 896c24f..1ce680a 100644 --- a/noncore/apps/opie-console/io_modem.cpp +++ b/noncore/apps/opie-console/io_modem.cpp | |||
@@ -88,8 +88,19 @@ QString IOModem::name() const { | |||
88 | } | 88 | } |
89 | 89 | ||
90 | void IOModem::slotExited(OProcess* proc ){ | 90 | void IOModem::slotExited(OProcess* proc ){ |
91 | close(); | 91 | close(); |
92 | /* delete it afterwards */ | 92 | /* delete it afterwards */ |
93 | delete proc; | 93 | delete proc; |
94 | } | 94 | } |
95 | 95 | ||
96 | QBitArray IOModem::supports()const { | ||
97 | return QBitArray( 3 ); | ||
98 | } | ||
99 | |||
100 | bool IOModem::isConnected() { | ||
101 | return false; | ||
102 | } | ||
103 | |||
104 | void IOModem::send(const QByteArray &data) { | ||
105 | qDebug( "Please overload me..." ); | ||
106 | } | ||
diff --git a/noncore/apps/opie-console/io_modem.h b/noncore/apps/opie-console/io_modem.h index 17228bd..2a926df 100644 --- a/noncore/apps/opie-console/io_modem.h +++ b/noncore/apps/opie-console/io_modem.h | |||
@@ -38,27 +38,30 @@ 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 | QString identifier() const; | 46 | virtual QString identifier() const; |
47 | QString name() const; | 47 | virtual QString name() const; |
48 | virtual QBitArray supports() const; | ||
49 | virtual bool isConnected(); | ||
48 | 50 | ||
49 | signals: | 51 | signals: |
50 | void received(const QByteArray &); | 52 | void received(const QByteArray &); |
51 | void error(int, const QString &); | 53 | void error(int, const QString &); |
52 | 54 | ||
53 | public slots: | 55 | public slots: |
54 | bool open(); | 56 | virtual void send( const QByteArray& ); |
55 | void close(); | 57 | virtual bool open(); |
56 | void reload(const Profile &); | 58 | virtual void close(); |
59 | virtual void reload(const Profile &); | ||
57 | 60 | ||
58 | private: | 61 | private: |
59 | 62 | ||
60 | QString m_initString, m_resetString, m_dialPref1, m_dialSuf1, m_dialPref2, | 63 | QString m_initString, m_resetString, m_dialPref1, m_dialSuf1, m_dialPref2, |
61 | 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; |
62 | int m_dialTime, m_delayRedial, m_numberTries, m_dtrDropTime, | 65 | int m_dialTime, m_delayRedial, m_numberTries, m_dtrDropTime, |
63 | m_bpsDetect, m_dcdLines, m_multiLineUntag; | 66 | m_bpsDetect, m_dcdLines, m_multiLineUntag; |
64 | Profile m_profile; | 67 | Profile m_profile; |
diff --git a/noncore/apps/opie-console/io_serial.h b/noncore/apps/opie-console/io_serial.h index edceac6..20c1ae1 100644 --- a/noncore/apps/opie-console/io_serial.h +++ b/noncore/apps/opie-console/io_serial.h | |||
@@ -28,31 +28,32 @@ public: | |||
28 | enum Flow { | 28 | enum Flow { |
29 | FlowHW = 0x01, | 29 | FlowHW = 0x01, |
30 | FlowSW = 0x02 | 30 | FlowSW = 0x02 |
31 | }; | 31 | }; |
32 | 32 | ||
33 | IOSerial(const Profile &); | 33 | IOSerial(const Profile &); |
34 | ~IOSerial(); | 34 | ~IOSerial(); |
35 | 35 | ||
36 | QString identifier() const; | 36 | virtual QString identifier() const; |
37 | QString name() const; | 37 | virtual QString name() const; |
38 | int rawIO()const; | 38 | int rawIO() const; |
39 | void closeRawIO(int fd ); | 39 | void closeRawIO (int fd ); |
40 | QBitArray supports()const; | 40 | virtual QBitArray supports() const; |
41 | bool isConnected(); | 41 | virtual bool isConnected(); |
42 | |||
42 | /*signals: | 43 | /*signals: |
43 | void received(const QByteArray &); | 44 | void received(const QByteArray &); |
44 | void error(int, const QString &); | 45 | void error(int, const QString &); |
45 | */ | 46 | */ |
46 | public slots: | 47 | public slots: |
47 | void send(const QByteArray &); | 48 | virtual void send(const QByteArray &); |
48 | bool open(); | 49 | virtual bool open(); |
49 | void close(); | 50 | virtual void close(); |
50 | void reload(const Profile &); | 51 | virtual void reload(const Profile &); |
51 | protected: | 52 | protected: |
52 | int baud(int baud) const; | 53 | int baud(int baud) const; |
53 | void internDetach(); | 54 | void internDetach(); |
54 | void internAttach(); | 55 | void internAttach(); |
55 | protected slots: | 56 | protected slots: |
56 | void dataArrived(); | 57 | void dataArrived(); |
57 | void errorOccured(); | 58 | void errorOccured(); |
58 | protected: | 59 | protected: |
diff --git a/noncore/apps/opie-console/opie-console.pro b/noncore/apps/opie-console/opie-console.pro index 1bb9f35..5ffa46f 100644 --- a/noncore/apps/opie-console/opie-console.pro +++ b/noncore/apps/opie-console/opie-console.pro | |||
@@ -1,11 +1,11 @@ | |||
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 \ |
@@ -25,19 +25,19 @@ HEADERS = io_layer.h io_serial.h io_irda.h io_bt.h io_modem.h \ | |||
25 | atconfigdialog.h dialdialog.h \ | 25 | atconfigdialog.h dialdialog.h \ |
26 | procctl.h \ | 26 | procctl.h \ |
27 | function_keyboard.h \ | 27 | function_keyboard.h \ |
28 | receive_layer.h filereceive.h \ | 28 | receive_layer.h filereceive.h \ |
29 | script.h \ | 29 | script.h \ |
30 | dialer.h \ | 30 | dialer.h \ |
31 | terminalwidget.h \ | 31 | terminalwidget.h \ |
32 | emulation_handler.h TECommon.h \ | 32 | emulation_handler.h TECommon.h \ |
33 | TEHistroy.h TEScreen.h TEWidget.h \ | 33 | TEHistory.h TEScreen.h TEWidget.h \ |
34 | TEmuVt102.h TEmulation.h MyPty.h \ | 34 | TEmuVt102.h TEmulation.h MyPty.h \ |
35 | consoleconfigwidget.h | 35 | consoleconfigwidget.h |
36 | 36 | ||
37 | SOURCES = io_layer.cpp io_serial.cpp io_irda.cpp io_bt.cpp io_modem.cpp \ | 37 | SOURCES = io_layer.cpp io_serial.cpp io_irda.cpp io_bt.cpp io_modem.cpp \ |
38 | file_layer.cpp filetransfer.cpp \ | 38 | file_layer.cpp filetransfer.cpp \ |
39 | main.cpp \ | 39 | main.cpp \ |
40 | metafactory.cpp \ | 40 | metafactory.cpp \ |
41 | session.cpp \ | 41 | session.cpp \ |
42 | mainwindow.cpp \ | 42 | mainwindow.cpp \ |
43 | profile.cpp \ | 43 | profile.cpp \ |
@@ -57,21 +57,21 @@ SOURCES = io_layer.cpp io_serial.cpp io_irda.cpp io_bt.cpp io_modem.cpp \ | |||
57 | function_keyboard.cpp \ | 57 | function_keyboard.cpp \ |
58 | receive_layer.cpp filereceive.cpp \ | 58 | receive_layer.cpp filereceive.cpp \ |
59 | script.cpp \ | 59 | script.cpp \ |
60 | dialer.cpp \ | 60 | dialer.cpp \ |
61 | terminalwidget.cpp \ | 61 | terminalwidget.cpp \ |
62 | emulation_handler.cpp TEHistory.cpp \ | 62 | emulation_handler.cpp TEHistory.cpp \ |
63 | TEScreen.cpp TEWidget.cpp \ | 63 | TEScreen.cpp TEWidget.cpp \ |
64 | TEmuVt102.cpp TEmulation.cpp MyPty.cpp \ | 64 | TEmuVt102.cpp TEmulation.cpp MyPty.cpp \ |
65 | consoleconfigwidget.cpp | 65 | consoleconfigwidget.cpp |
66 | 66 | ||
67 | 67 | ||
68 | INTERFACES = configurebase.ui editbase.ui | 68 | INTERFACES = configurebase.ui editbase.ui |
69 | INCLUDEPATH += $(OPIEDIR)/include | 69 | INCLUDEPATH += $(OPIEDIR)/include |
70 | DEPENDPATH += $(OPIEDIR)/include | 70 | DEPENDPATH += $(OPIEDIR)/include |
71 | LIBS += -lqpe -lopie | 71 | LIBS += -lqpe -lopie -lutil |
72 | TARGET = opie-console | 72 | TARGET = opie-console |
73 | 73 | ||
74 | 74 | ||
75 | 75 | ||
76 | 76 | ||
77 | include ( ../../../include.pro ) | 77 | include ( ../../../include.pro ) |