Diffstat (limited to 'noncore/apps/opie-console/emulation_handler.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/emulation_handler.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/noncore/apps/opie-console/emulation_handler.cpp b/noncore/apps/opie-console/emulation_handler.cpp index 99d069f..89b70c6 100644 --- a/noncore/apps/opie-console/emulation_handler.cpp +++ b/noncore/apps/opie-console/emulation_handler.cpp | |||
@@ -1,31 +1,33 @@ | |||
1 | |||
2 | #include "TEmuVt102.h" | 1 | #include "TEmuVt102.h" |
3 | |||
4 | #include "profile.h" | 2 | #include "profile.h" |
5 | #include "emulation_handler.h" | 3 | #include "emulation_handler.h" |
6 | #include "script.h" | 4 | #include "script.h" |
7 | 5 | ||
6 | /* OPIE */ | ||
7 | #include <opie2/odebug.h> | ||
8 | using namespace Opie::Core; | ||
9 | |||
8 | EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent,const char* name ) | 10 | EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent,const char* name ) |
9 | : QObject(0, name ) | 11 | : QObject(0, name ) |
10 | { | 12 | { |
11 | m_teWid = new TEWidget( parent, "TerminalMain"); | 13 | m_teWid = new TEWidget( parent, "TerminalMain"); |
12 | // 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) |
13 | // use setWrapAt(80) for normal console with scrollbar | 15 | // use setWrapAt(80) for normal console with scrollbar |
14 | setWrap(prof.readNumEntry("Wrap", 0) ? 0 : 80); | 16 | setWrap(prof.readNumEntry("Wrap", 0) ? 0 : 80); |
15 | m_teWid->setMinimumSize(150, 70 ); | 17 | m_teWid->setMinimumSize(150, 70 ); |
16 | m_script = 0; | 18 | m_script = 0; |
17 | parent->resize( m_teWid->calcSize(80, 24 ) ); | 19 | parent->resize( m_teWid->calcSize(80, 24 ) ); |
18 | m_teEmu = new TEmuVt102(m_teWid ); | 20 | m_teEmu = new TEmuVt102(m_teWid ); |
19 | 21 | ||
20 | connect(m_teEmu,SIGNAL(ImageSizeChanged(int,int) ), | 22 | connect(m_teEmu,SIGNAL(ImageSizeChanged(int,int) ), |
21 | this, SIGNAL(changeSize(int,int) ) ); | 23 | this, SIGNAL(changeSize(int,int) ) ); |
22 | connect(m_teEmu, SIGNAL(sndBlock(const char*,int) ), | 24 | connect(m_teEmu, SIGNAL(sndBlock(const char*,int) ), |
23 | this, SLOT(recvEmulation(const char*,int) ) ); | 25 | this, SLOT(recvEmulation(const char*,int) ) ); |
24 | m_teEmu->setConnect( true ); | 26 | m_teEmu->setConnect( true ); |
25 | m_teEmu->setHistory( TRUE ); | 27 | m_teEmu->setHistory( TRUE ); |
26 | load( prof ); | 28 | load( prof ); |
27 | 29 | ||
28 | 30 | ||
29 | 31 | ||
30 | } | 32 | } |
31 | TEmulation* EmulationHandler::emulation() { | 33 | TEmulation* EmulationHandler::emulation() { |
@@ -107,77 +109,77 @@ QFont EmulationHandler::font( int id ) { | |||
107 | size = 7; | 109 | size = 7; |
108 | break; | 110 | break; |
109 | case 2: | 111 | case 2: |
110 | name = QString::fromLatin1("Fixed"); | 112 | name = QString::fromLatin1("Fixed"); |
111 | size = 12; | 113 | size = 12; |
112 | break; | 114 | break; |
113 | } | 115 | } |
114 | QFont font(name, size, QFont::Normal ); | 116 | QFont font(name, size, QFont::Normal ); |
115 | font.setFixedPitch(TRUE ); | 117 | font.setFixedPitch(TRUE ); |
116 | return font; | 118 | return font; |
117 | } | 119 | } |
118 | QColor EmulationHandler::foreColor(int col) { | 120 | QColor EmulationHandler::foreColor(int col) { |
119 | QColor co; | 121 | QColor co; |
120 | /* we need to switch it */ | 122 | /* we need to switch it */ |
121 | switch( col ) { | 123 | switch( col ) { |
122 | default: | 124 | default: |
123 | case Profile::White: | 125 | case Profile::White: |
124 | /* color is black */ | 126 | /* color is black */ |
125 | co = Qt::white; | 127 | co = Qt::white; |
126 | break; | 128 | break; |
127 | case Profile::Black: | 129 | case Profile::Black: |
128 | co = Qt::black; | 130 | co = Qt::black; |
129 | break; | 131 | break; |
130 | case Profile::Green: | 132 | case Profile::Green: |
131 | qWarning("Foreground green"); | 133 | owarn << "Foreground green" << oendl; |
132 | co = Qt::green; | 134 | co = Qt::green; |
133 | break; | 135 | break; |
134 | case Profile::Orange: | 136 | case Profile::Orange: |
135 | qWarning("Foreground orange"); | 137 | owarn << "Foreground orange" << oendl; |
136 | co.setRgb( 231, 184, 98 ); | 138 | co.setRgb( 231, 184, 98 ); |
137 | break; | 139 | break; |
138 | } | 140 | } |
139 | 141 | ||
140 | return co; | 142 | return co; |
141 | } | 143 | } |
142 | QColor EmulationHandler::backColor(int col ) { | 144 | QColor EmulationHandler::backColor(int col ) { |
143 | QColor co; | 145 | QColor co; |
144 | /* we need to switch it */ | 146 | /* we need to switch it */ |
145 | switch( col ) { | 147 | switch( col ) { |
146 | default: | 148 | default: |
147 | case Profile::White: | 149 | case Profile::White: |
148 | /* color is white */ | 150 | /* color is white */ |
149 | co = Qt::black; | 151 | co = Qt::black; |
150 | break; | 152 | break; |
151 | case Profile::Black: | 153 | case Profile::Black: |
152 | co = Qt::white; | 154 | co = Qt::white; |
153 | break; | 155 | break; |
154 | case Profile::Green: | 156 | case Profile::Green: |
155 | qWarning("Background black"); | 157 | owarn << "Background black" << oendl; |
156 | co = Qt::black; | 158 | co = Qt::black; |
157 | break; | 159 | break; |
158 | case Profile::Orange: | 160 | case Profile::Orange: |
159 | qWarning("Background black"); | 161 | owarn << "Background black" << oendl; |
160 | co = Qt::black; | 162 | co = Qt::black; |
161 | break; | 163 | break; |
162 | } | 164 | } |
163 | 165 | ||
164 | return co; | 166 | return co; |
165 | } | 167 | } |
166 | 168 | ||
167 | QPushButton* EmulationHandler::cornerButton() { | 169 | QPushButton* EmulationHandler::cornerButton() { |
168 | return m_teWid->cornerButton(); | 170 | return m_teWid->cornerButton(); |
169 | } | 171 | } |
170 | 172 | ||
171 | 173 | ||
172 | Script *EmulationHandler::script() { | 174 | Script *EmulationHandler::script() { |
173 | return m_script; | 175 | return m_script; |
174 | } | 176 | } |
175 | 177 | ||
176 | bool EmulationHandler::isRecording() { | 178 | bool EmulationHandler::isRecording() { |
177 | return (m_script != 0); | 179 | return (m_script != 0); |
178 | } | 180 | } |
179 | 181 | ||
180 | void EmulationHandler::startRecording() { | 182 | void EmulationHandler::startRecording() { |
181 | if (!isRecording()) | 183 | if (!isRecording()) |
182 | m_script = new Script(); | 184 | m_script = new Script(); |
183 | } | 185 | } |