author | zecke <zecke> | 2002-10-22 14:25:05 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-22 14:25:05 (UTC) |
commit | 53a21f61d99d62e62412e1b5ca9bde085b25bde5 (patch) (unidiff) | |
tree | 894a1162468586710213945647d835dd94a3f5f1 | |
parent | e006ea7655b455974ae64c30098eeecb7304508b (diff) | |
download | opie-53a21f61d99d62e62412e1b5ca9bde085b25bde5.zip opie-53a21f61d99d62e62412e1b5ca9bde085b25bde5.tar.gz opie-53a21f61d99d62e62412e1b5ca9bde085b25bde5.tar.bz2 |
set $TERM in MyPty according to the terminal type
emulation_handler set the keyfilter right for the right terminal
filetransfer fix warnings
profile add Linux, XTerm as Emulation options
TerminalWidget add Linux,XTerm
-rw-r--r-- | noncore/apps/opie-console/MyPty.cpp | 19 | ||||
-rw-r--r-- | noncore/apps/opie-console/MyPty.h | 1 | ||||
-rw-r--r-- | noncore/apps/opie-console/emulation_handler.cpp | 17 | ||||
-rw-r--r-- | noncore/apps/opie-console/filetransfer.cpp | 3 | ||||
-rw-r--r-- | noncore/apps/opie-console/filetransfer.h | 8 | ||||
-rw-r--r-- | noncore/apps/opie-console/profile.h | 5 | ||||
-rw-r--r-- | noncore/apps/opie-console/terminalwidget.cpp | 24 |
7 files changed, 61 insertions, 16 deletions
diff --git a/noncore/apps/opie-console/MyPty.cpp b/noncore/apps/opie-console/MyPty.cpp index 6b0d6f2..16bb5ff 100644 --- a/noncore/apps/opie-console/MyPty.cpp +++ b/noncore/apps/opie-console/MyPty.cpp | |||
@@ -176,5 +176,5 @@ int MyPty::run(const char* cmd, QStrList &, const char*, int) | |||
176 | ttmode.c_cc[VERASE] = 8; | 176 | ttmode.c_cc[VERASE] = 8; |
177 | tcsetattr( STDIN_FILENO, TCSANOW, &ttmode ); | 177 | tcsetattr( STDIN_FILENO, TCSANOW, &ttmode ); |
178 | setenv("TERM","vt100",1); | 178 | setenv("TERM",m_term,1); |
179 | setenv("COLORTERM","0",1); | 179 | setenv("COLORTERM","0",1); |
180 | 180 | ||
@@ -237,6 +237,21 @@ int MyPty::openPty() | |||
237 | Create an instance. | 237 | Create an instance. |
238 | */ | 238 | */ |
239 | MyPty::MyPty(const Profile&) : m_cpid(0) | 239 | MyPty::MyPty(const Profile& prof) : m_cpid(0) |
240 | { | 240 | { |
241 | |||
242 | int term = prof.readNumEntry("Terminal", Profile::VT100 ); | ||
243 | switch( term ) { | ||
244 | default: | ||
245 | case Profile::VT100: | ||
246 | case Profile::VT102: | ||
247 | m_term = "vt100"; | ||
248 | break; | ||
249 | case Profile::Linux: | ||
250 | m_term = "linux"; | ||
251 | break; | ||
252 | case Profile::XTerm: | ||
253 | m_term = "xterm"; | ||
254 | break; | ||
255 | } | ||
241 | m_sn_e = 0l; | 256 | m_sn_e = 0l; |
242 | m_sn_r = 0l; | 257 | m_sn_r = 0l; |
diff --git a/noncore/apps/opie-console/MyPty.h b/noncore/apps/opie-console/MyPty.h index 81abad5..7561ca3 100644 --- a/noncore/apps/opie-console/MyPty.h +++ b/noncore/apps/opie-console/MyPty.h | |||
@@ -95,4 +95,5 @@ private: | |||
95 | QSocketNotifier* m_sn_e; | 95 | QSocketNotifier* m_sn_e; |
96 | QSocketNotifier* m_sn_r; | 96 | QSocketNotifier* m_sn_r; |
97 | char* m_term; | ||
97 | }; | 98 | }; |
98 | 99 | ||
diff --git a/noncore/apps/opie-console/emulation_handler.cpp b/noncore/apps/opie-console/emulation_handler.cpp index df8e573..bdc8b43 100644 --- a/noncore/apps/opie-console/emulation_handler.cpp +++ b/noncore/apps/opie-console/emulation_handler.cpp | |||
@@ -40,5 +40,20 @@ void EmulationHandler::load( const Profile& prof) { | |||
40 | int num = prof.readNumEntry("Color"); | 40 | int num = prof.readNumEntry("Color"); |
41 | setColor( foreColor(num), backColor(num) ); | 41 | setColor( foreColor(num), backColor(num) ); |
42 | m_teWid->setBackgroundColor(backColor(num) ); | 42 | m_teWid->setBackgroundColor(backColor(num) ); |
43 | |||
44 | int term = prof.readNumEntry("Terminal", 0) ; | ||
45 | switch(term) { | ||
46 | default: | ||
47 | case Profile::VT102: | ||
48 | case Profile::VT100: | ||
49 | m_teEmu->setKeytrans("vt100.keytab"); | ||
50 | break; | ||
51 | case Profile::Linux: | ||
52 | m_teEmu->setKeytrans("linux.keytab"); | ||
53 | break; | ||
54 | case Profile::XTerm: | ||
55 | m_teEmu->setKeytrans("default.Keytab"); | ||
56 | break; | ||
57 | } | ||
43 | } | 58 | } |
44 | void EmulationHandler::recv( const QByteArray& ar) { | 59 | void EmulationHandler::recv( const QByteArray& ar) { |
diff --git a/noncore/apps/opie-console/filetransfer.cpp b/noncore/apps/opie-console/filetransfer.cpp index b81c2a2..221838c 100644 --- a/noncore/apps/opie-console/filetransfer.cpp +++ b/noncore/apps/opie-console/filetransfer.cpp | |||
@@ -61,4 +61,5 @@ void FileTransfer::sendFile( const QString& file ) { | |||
61 | char* typus; | 61 | char* typus; |
62 | switch(m_type ) { | 62 | switch(m_type ) { |
63 | default: | ||
63 | case SZ: | 64 | case SZ: |
64 | typus = ""; | 65 | typus = ""; |
@@ -233,5 +234,5 @@ void FileTransfer::slotProgress( const QStringList& list ) { | |||
233 | void FileTransfer::cancel() { | 234 | void FileTransfer::cancel() { |
234 | if(m_pid > 0) ::kill(m_pid,9 ); | 235 | if(m_pid > 0) ::kill(m_pid,9 ); |
235 | 236 | ||
236 | } | 237 | } |
237 | void FileTransfer::slotExec() { | 238 | void FileTransfer::slotExec() { |
diff --git a/noncore/apps/opie-console/filetransfer.h b/noncore/apps/opie-console/filetransfer.h index 9cc1e8d..8f55041 100644 --- a/noncore/apps/opie-console/filetransfer.h +++ b/noncore/apps/opie-console/filetransfer.h | |||
@@ -34,10 +34,5 @@ private slots: | |||
34 | void slotExec(); | 34 | void slotExec(); |
35 | private: | 35 | private: |
36 | /* | 36 | Type m_type; |
37 | * FIXME? What does happen if we've | ||
38 | * two FileTransfers at a time? | ||
39 | * Have a procctl which does listen | ||
40 | * for termination and then send a signal | ||
41 | */ | ||
42 | pid_t m_pid; | 37 | pid_t m_pid; |
43 | int m_fd; | 38 | int m_fd; |
@@ -47,5 +42,4 @@ private: | |||
47 | int m_term[2]; | 42 | int m_term[2]; |
48 | QString m_file; | 43 | QString m_file; |
49 | Type m_type; | ||
50 | QSocketNotifier *m_not; | 44 | QSocketNotifier *m_not; |
51 | QSocketNotifier* m_proc; | 45 | QSocketNotifier* m_proc; |
diff --git a/noncore/apps/opie-console/profile.h b/noncore/apps/opie-console/profile.h index 4f9e9c2..eeda1b6 100644 --- a/noncore/apps/opie-console/profile.h +++ b/noncore/apps/opie-console/profile.h | |||
@@ -21,5 +21,8 @@ public: | |||
21 | Green, | 21 | Green, |
22 | Orange}; | 22 | Orange}; |
23 | enum Terminal {VT102 = 0, VT100 }; | 23 | enum Terminal {VT102 = 0, VT100, |
24 | Ansi, | ||
25 | Linux, | ||
26 | XTerm }; | ||
24 | enum Font { Micro = 0, Small, Medium }; | 27 | enum Font { Micro = 0, Small, Medium }; |
25 | Profile(); | 28 | Profile(); |
diff --git a/noncore/apps/opie-console/terminalwidget.cpp b/noncore/apps/opie-console/terminalwidget.cpp index 8badf96..eae94c3 100644 --- a/noncore/apps/opie-console/terminalwidget.cpp +++ b/noncore/apps/opie-console/terminalwidget.cpp | |||
@@ -13,7 +13,8 @@ | |||
13 | namespace { | 13 | namespace { |
14 | enum TermIds { | 14 | enum TermIds { |
15 | id_term_vt100, | 15 | id_term_vt100 = 0, |
16 | id_term_vt102, | 16 | id_term_vt102, |
17 | id_term_ansi | 17 | id_term_linux, |
18 | id_term_xterm | ||
18 | }; | 19 | }; |
19 | 20 | ||
@@ -75,6 +76,9 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent, | |||
75 | 76 | ||
76 | // Fill in some options | 77 | // Fill in some options |
77 | m_terminalBox->insertItem( tr("VT 100"), id_term_vt100 ); | 78 | qWarning("Options for terminal box"); |
78 | m_terminalBox->insertItem( tr("VT 102"), id_term_vt102 ); | 79 | m_terminalBox->insertItem( tr("VT 100"), 0 ); // /*, id_term_vt100*/ ); |
80 | m_terminalBox->insertItem( tr("VT 102"), 1 ); // /* , id_term_vt102 */); | ||
81 | m_terminalBox->insertItem( tr("Linux Console"), 2 ); //, id_term_linux ); | ||
82 | m_terminalBox->insertItem( tr("X-Terminal"), 3 ); //, id_term_xterm ); | ||
79 | //m_terminalBox->insertItem( tr("ANSI"), id_term_ansi ); | 83 | //m_terminalBox->insertItem( tr("ANSI"), id_term_ansi ); |
80 | 84 | ||
@@ -121,4 +125,10 @@ void TerminalWidget::load( const Profile& prof ) { | |||
121 | m_terminalBox->setCurrentItem(id_term_vt102 ); | 125 | m_terminalBox->setCurrentItem(id_term_vt102 ); |
122 | break; | 126 | break; |
127 | case Profile::Linux: | ||
128 | m_terminalBox->setCurrentItem(id_term_linux ); | ||
129 | break; | ||
130 | case Profile::XTerm: | ||
131 | m_terminalBox->setCurrentItem(id_term_xterm ); | ||
132 | break; | ||
123 | default: | 133 | default: |
124 | break; | 134 | break; |
@@ -171,4 +181,10 @@ void TerminalWidget::save( Profile& profile ) { | |||
171 | profile.writeEntry("Terminal", Profile::VT102 ); | 181 | profile.writeEntry("Terminal", Profile::VT102 ); |
172 | break; | 182 | break; |
183 | case id_term_linux: | ||
184 | profile.writeEntry("Terminal", Profile::Linux ); | ||
185 | break; | ||
186 | case id_term_xterm: | ||
187 | profile.writeEntry("Terminal", Profile::XTerm ); | ||
188 | break; | ||
173 | //case id_term_ansi: | 189 | //case id_term_ansi: |
174 | // profile.writeEntry("Terminal", Profile::VT102 ); | 190 | // profile.writeEntry("Terminal", Profile::VT102 ); |