summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/MyPty.cpp19
-rw-r--r--noncore/apps/opie-console/MyPty.h1
-rw-r--r--noncore/apps/opie-console/emulation_handler.cpp15
-rw-r--r--noncore/apps/opie-console/filetransfer.cpp1
-rw-r--r--noncore/apps/opie-console/filetransfer.h8
-rw-r--r--noncore/apps/opie-console/profile.h5
-rw-r--r--noncore/apps/opie-console/terminalwidget.cpp24
7 files changed, 59 insertions, 14 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
@@ -172,13 +172,13 @@ int MyPty::run(const char* cmd, QStrList &, const char*, int)
172 ioctl(STDIN_FILENO, TIOCSCTTY, 0); 172 ioctl(STDIN_FILENO, TIOCSCTTY, 0);
173#endif 173#endif
174 tcgetattr( STDIN_FILENO, &ttmode ); 174 tcgetattr( STDIN_FILENO, &ttmode );
175 ttmode.c_cc[VINTR] = 3; 175 ttmode.c_cc[VINTR] = 3;
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
181 if (getuid() == 0) { 181 if (getuid() == 0) {
182 char msg[] = "WARNING: You are running this shell as root!\n"; 182 char msg[] = "WARNING: You are running this shell as root!\n";
183 write(ttyfd, msg, sizeof(msg)); 183 write(ttyfd, msg, sizeof(msg));
184 } 184 }
@@ -233,14 +233,29 @@ int MyPty::openPty()
233 return ptyfd; 233 return ptyfd;
234} 234}
235 235
236/*! 236/*!
237 Create an instance. 237 Create an instance.
238*/ 238*/
239MyPty::MyPty(const Profile&) : m_cpid(0) 239MyPty::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;
243 m_fd = openPty(); 258 m_fd = openPty();
244 ProcCtl* ctl = ProcCtl::self(); 259 ProcCtl* ctl = ProcCtl::self();
245} 260}
246 261
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
@@ -91,9 +91,10 @@ private:
91 char m_ptynam[16]; // "/dev/ptyxx" | "/dev/ptmx" 91 char m_ptynam[16]; // "/dev/ptyxx" | "/dev/ptmx"
92 char m_ttynam[16]; // "/dev/ttyxx" | "/dev/pts/########..." 92 char m_ttynam[16]; // "/dev/ttyxx" | "/dev/pts/########..."
93 int m_fd; 93 int m_fd;
94 int m_cpid; 94 int m_cpid;
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
99#endif 100#endif
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
@@ -37,12 +37,27 @@ EmulationHandler::~EmulationHandler() {
37 37
38void EmulationHandler::load( const Profile& prof) { 38void EmulationHandler::load( const Profile& prof) {
39 m_teWid->setVTFont( font( prof.readNumEntry("Font") ) ); 39 m_teWid->setVTFont( font( prof.readNumEntry("Font") ) );
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}
44void EmulationHandler::recv( const QByteArray& ar) { 59void EmulationHandler::recv( const QByteArray& ar) {
45 m_teEmu->onRcvBlock(ar.data(), ar.count() ); 60 m_teEmu->onRcvBlock(ar.data(), ar.count() );
46} 61}
47void EmulationHandler::recvEmulation(const char* src, int len ) { 62void EmulationHandler::recvEmulation(const char* src, int len ) {
48 QByteArray ar(len); 63 QByteArray ar(len);
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
@@ -57,12 +57,13 @@ void FileTransfer::sendFile( const QString& file ) {
57 char* verbose = "-vv"; 57 char* verbose = "-vv";
58 char* binray = "-b"; 58 char* binray = "-b";
59 59
60 60
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 = "";
65 break; 66 break;
66 case SX: 67 case SX:
67 typus = "-X"; 68 typus = "-X";
68 break; 69 break;
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
@@ -30,25 +30,19 @@ public:
30private slots: 30private slots:
31 void setupChild(); 31 void setupChild();
32 void slotRead(); 32 void slotRead();
33 void slotProgress( const QStringList& ); 33 void slotProgress( const QStringList& );
34 void slotExec(); 34 void slotExec();
35private: 35private:
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;
44 int m_prog; 39 int m_prog;
45 int m_info[2]; 40 int m_info[2];
46 int m_comm[2]; 41 int m_comm[2];
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;
52}; 46};
53 47
54#endif 48#endif
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
@@ -17,13 +17,16 @@ public:
17 typedef QValueList<Profile> ValueList; 17 typedef QValueList<Profile> ValueList;
18 enum Color { Black = 0, 18 enum Color { Black = 0,
19 White, 19 White,
20 Gray, 20 Gray,
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();
26 Profile( const QString& name, 29 Profile( const QString& name,
27 const QCString& iolayerName, 30 const QCString& iolayerName,
28 const QCString& termName, 31 const QCString& termName,
29 int background, 32 int background,
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
@@ -9,15 +9,16 @@
9#include <qlayout.h> 9#include <qlayout.h>
10 10
11#include "terminalwidget.h" 11#include "terminalwidget.h"
12 12
13namespace { 13namespace {
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
20 enum ColourIds { 21 enum ColourIds {
21 id_term_black, 22 id_term_black,
22 id_term_white, 23 id_term_white,
23 id_term_green, 24 id_term_green,
@@ -71,14 +72,17 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent,
71 m_colorBox->add( m_colorCmb ); 72 m_colorBox->add( m_colorCmb );
72 73
73 m_lroot->add(m_groupConv ); 74 m_lroot->add(m_groupConv );
74 m_lroot->add(m_groupOptions ); 75 m_lroot->add(m_groupOptions );
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
81 m_colorCmb->insertItem( tr("black on white"), id_term_black ); 85 m_colorCmb->insertItem( tr("black on white"), id_term_black );
82 m_colorCmb->insertItem( tr("white on black"), id_term_white ); 86 m_colorCmb->insertItem( tr("white on black"), id_term_white );
83 m_colorCmb->insertItem( tr("green on black"), id_term_green ); 87 m_colorCmb->insertItem( tr("green on black"), id_term_green );
84 m_colorCmb->insertItem( tr("orange on black"), id_term_orange ); 88 m_colorCmb->insertItem( tr("orange on black"), id_term_orange );
@@ -117,12 +121,18 @@ void TerminalWidget::load( const Profile& prof ) {
117 case Profile::VT100: 121 case Profile::VT100:
118 m_terminalBox->setCurrentItem(id_term_vt100 ); 122 m_terminalBox->setCurrentItem(id_term_vt100 );
119 break; 123 break;
120 case Profile::VT102: 124 case Profile::VT102:
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;
125 }; 135 };
126 136
127 switch( color ) { 137 switch( color ) {
128 case Profile::Black: 138 case Profile::Black:
@@ -167,12 +177,18 @@ void TerminalWidget::save( Profile& profile ) {
167 case id_term_vt100: 177 case id_term_vt100:
168 profile.writeEntry("Terminal", Profile::VT100 ); 178 profile.writeEntry("Terminal", Profile::VT100 );
169 break; 179 break;
170 case id_term_vt102: 180 case id_term_vt102:
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 );
175 // break; 191 // break;
176 default: 192 default:
177 break; 193 break;
178 }; 194 };