author | zecke <zecke> | 2002-10-22 14:25:05 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-22 14:25:05 (UTC) |
commit | 53a21f61d99d62e62412e1b5ca9bde085b25bde5 (patch) (side-by-side diff) | |
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 @@ -177,3 +177,3 @@ int MyPty::run(const char* cmd, QStrList &, const char*, int) tcsetattr( STDIN_FILENO, TCSANOW, &ttmode ); - setenv("TERM","vt100",1); + setenv("TERM",m_term,1); setenv("COLORTERM","0",1); @@ -238,4 +238,19 @@ int MyPty::openPty() */ -MyPty::MyPty(const Profile&) : m_cpid(0) +MyPty::MyPty(const Profile& prof) : m_cpid(0) { + + int term = prof.readNumEntry("Terminal", Profile::VT100 ); + switch( term ) { + default: + case Profile::VT100: + case Profile::VT102: + m_term = "vt100"; + break; + case Profile::Linux: + m_term = "linux"; + break; + case Profile::XTerm: + m_term = "xterm"; + break; + } m_sn_e = 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 @@ -96,2 +96,3 @@ private: QSocketNotifier* m_sn_r; + char* m_term; }; 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 @@ -41,3 +41,18 @@ void EmulationHandler::load( const Profile& prof) { setColor( foreColor(num), backColor(num) ); - m_teWid->setBackgroundColor(backColor(num) ); + m_teWid->setBackgroundColor(backColor(num) ); + + int term = prof.readNumEntry("Terminal", 0) ; + switch(term) { + default: + case Profile::VT102: + case Profile::VT100: + m_teEmu->setKeytrans("vt100.keytab"); + break; + case Profile::Linux: + m_teEmu->setKeytrans("linux.keytab"); + break; + case Profile::XTerm: + m_teEmu->setKeytrans("default.Keytab"); + break; + } } 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 @@ -62,2 +62,3 @@ void FileTransfer::sendFile( const QString& file ) { switch(m_type ) { + default: case SZ: @@ -234,3 +235,3 @@ void FileTransfer::cancel() { if(m_pid > 0) ::kill(m_pid,9 ); - + } 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 @@ -35,8 +35,3 @@ private slots: private: - /* - * FIXME? What does happen if we've - * two FileTransfers at a time? - * Have a procctl which does listen - * for termination and then send a signal - */ + Type m_type; pid_t m_pid; @@ -48,3 +43,2 @@ private: QString m_file; - Type m_type; QSocketNotifier *m_not; 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 @@ -22,3 +22,6 @@ public: Orange}; - enum Terminal {VT102 = 0, VT100 }; + enum Terminal {VT102 = 0, VT100, + Ansi, + Linux, + XTerm }; enum Font { Micro = 0, Small, Medium }; 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 @@ -14,5 +14,6 @@ namespace { enum TermIds { - id_term_vt100, + id_term_vt100 = 0, id_term_vt102, - id_term_ansi + id_term_linux, + id_term_xterm }; @@ -76,4 +77,7 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent, // Fill in some options - m_terminalBox->insertItem( tr("VT 100"), id_term_vt100 ); - m_terminalBox->insertItem( tr("VT 102"), id_term_vt102 ); + qWarning("Options for terminal box"); + m_terminalBox->insertItem( tr("VT 100"), 0 ); // /*, id_term_vt100*/ ); + m_terminalBox->insertItem( tr("VT 102"), 1 ); // /* , id_term_vt102 */); + m_terminalBox->insertItem( tr("Linux Console"), 2 ); //, id_term_linux ); + m_terminalBox->insertItem( tr("X-Terminal"), 3 ); //, id_term_xterm ); //m_terminalBox->insertItem( tr("ANSI"), id_term_ansi ); @@ -122,2 +126,8 @@ void TerminalWidget::load( const Profile& prof ) { break; + case Profile::Linux: + m_terminalBox->setCurrentItem(id_term_linux ); + break; + case Profile::XTerm: + m_terminalBox->setCurrentItem(id_term_xterm ); + break; default: @@ -172,2 +182,8 @@ void TerminalWidget::save( Profile& profile ) { break; + case id_term_linux: + profile.writeEntry("Terminal", Profile::Linux ); + break; + case id_term_xterm: + profile.writeEntry("Terminal", Profile::XTerm ); + break; //case id_term_ansi: |