-rw-r--r-- | noncore/apps/opie-console/emulation_handler.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/emulation_handler.cpp b/noncore/apps/opie-console/emulation_handler.cpp index 1a0613f..c8022b9 100644 --- a/noncore/apps/opie-console/emulation_handler.cpp +++ b/noncore/apps/opie-console/emulation_handler.cpp | |||
@@ -14,65 +14,68 @@ EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent,const c | |||
14 | // use setWrapAt(0) for classic behaviour (wrap at screen width, no scrollbar) | 14 | // use setWrapAt(0) for classic behaviour (wrap at screen width, no scrollbar) |
15 | // use setWrapAt(80) for normal console with scrollbar | 15 | // use setWrapAt(80) for normal console with scrollbar |
16 | setWrap(prof.readNumEntry("Wrap", 0) ? 0 : 80); | 16 | setWrap(prof.readNumEntry("Wrap", 0) ? 0 : 80); |
17 | m_teWid->setMinimumSize(150, 70 ); | 17 | m_teWid->setMinimumSize(150, 70 ); |
18 | m_script = 0; | 18 | m_script = 0; |
19 | parent->resize( m_teWid->calcSize(80, 24 ) ); | 19 | parent->resize( m_teWid->calcSize(80, 24 ) ); |
20 | m_teEmu = new TEmuVt102(m_teWid ); | 20 | m_teEmu = new TEmuVt102(m_teWid ); |
21 | 21 | ||
22 | connect(m_teEmu,SIGNAL(ImageSizeChanged(int,int) ), | 22 | connect(m_teEmu,SIGNAL(ImageSizeChanged(int,int) ), |
23 | this, SIGNAL(changeSize(int,int) ) ); | 23 | this, SIGNAL(changeSize(int,int) ) ); |
24 | connect(m_teEmu, SIGNAL(sndBlock(const char*,int) ), | 24 | connect(m_teEmu, SIGNAL(sndBlock(const char*,int) ), |
25 | this, SLOT(recvEmulation(const char*,int) ) ); | 25 | this, SLOT(recvEmulation(const char*,int) ) ); |
26 | m_teEmu->setConnect( true ); | 26 | m_teEmu->setConnect( true ); |
27 | m_teEmu->setHistory( TRUE ); | 27 | m_teEmu->setHistory( TRUE ); |
28 | load( prof ); | 28 | load( prof ); |
29 | 29 | ||
30 | 30 | ||
31 | 31 | ||
32 | } | 32 | } |
33 | TEmulation* EmulationHandler::emulation() { | 33 | TEmulation* EmulationHandler::emulation() { |
34 | return m_teEmu; | 34 | return m_teEmu; |
35 | } | 35 | } |
36 | EmulationHandler::~EmulationHandler() { | 36 | EmulationHandler::~EmulationHandler() { |
37 | if (isRecording()) | 37 | if (isRecording()) |
38 | clearScript(); | 38 | clearScript(); |
39 | delete m_teEmu; | 39 | delete m_teEmu; |
40 | delete m_teWid; | 40 | delete m_teWid; |
41 | } | 41 | } |
42 | 42 | ||
43 | void EmulationHandler::load( const Profile& prof) { | 43 | void EmulationHandler::load( const Profile& prof) { |
44 | 44 | ||
45 | // m_teWid->setVTFont( font( prof.readNumEntry("Font") ) ); | 45 | // m_teWid->setVTFont( font( prof.readNumEntry("Font") ) ); |
46 | m_teWid->setVTFont( QFont( prof.readEntry("Font"), prof.readNumEntry( "FontSize" ), QFont::Normal ) ); | 46 | QFont font( prof.readEntry("Font"), prof.readNumEntry( "FontSize" ), QFont::Normal ); |
47 | font.setFixedPitch( TRUE ); | ||
48 | m_teWid->setVTFont( font ); | ||
49 | |||
47 | int num = prof.readNumEntry("Color"); | 50 | int num = prof.readNumEntry("Color"); |
48 | setColor( foreColor(num), backColor(num) ); | 51 | setColor( foreColor(num), backColor(num) ); |
49 | m_teWid->setBackgroundColor(backColor(num) ); | 52 | m_teWid->setBackgroundColor(backColor(num) ); |
50 | 53 | ||
51 | int term = prof.readNumEntry("Terminal", 0) ; | 54 | int term = prof.readNumEntry("Terminal", 0) ; |
52 | switch(term) { | 55 | switch(term) { |
53 | default: | 56 | default: |
54 | case Profile::VT102: | 57 | case Profile::VT102: |
55 | case Profile::VT100: | 58 | case Profile::VT100: |
56 | m_teEmu->setKeytrans("vt100.keytab"); | 59 | m_teEmu->setKeytrans("vt100.keytab"); |
57 | break; | 60 | break; |
58 | case Profile::Linux: | 61 | case Profile::Linux: |
59 | m_teEmu->setKeytrans("linux.keytab"); | 62 | m_teEmu->setKeytrans("linux.keytab"); |
60 | break; | 63 | break; |
61 | case Profile::XTerm: | 64 | case Profile::XTerm: |
62 | m_teEmu->setKeytrans("default.Keytab"); | 65 | m_teEmu->setKeytrans("default.Keytab"); |
63 | break; | 66 | break; |
64 | } | 67 | } |
65 | } | 68 | } |
66 | void EmulationHandler::recv( const QByteArray& ar) { | 69 | void EmulationHandler::recv( const QByteArray& ar) { |
67 | m_teEmu->onRcvBlock(ar.data(), ar.count() ); | 70 | m_teEmu->onRcvBlock(ar.data(), ar.count() ); |
68 | } | 71 | } |
69 | void EmulationHandler::recvEmulation(const char* src, int len ) { | 72 | void EmulationHandler::recvEmulation(const char* src, int len ) { |
70 | QByteArray ar(len); | 73 | QByteArray ar(len); |
71 | 74 | ||
72 | memcpy(ar.data(), src, sizeof(char) * len ); | 75 | memcpy(ar.data(), src, sizeof(char) * len ); |
73 | if (isRecording()) | 76 | if (isRecording()) |
74 | m_script->append(ar); | 77 | m_script->append(ar); |
75 | emit send(ar); | 78 | emit send(ar); |
76 | } | 79 | } |
77 | QWidget* EmulationHandler::widget() { | 80 | QWidget* EmulationHandler::widget() { |
78 | return m_teWid; | 81 | return m_teWid; |