summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/emulation_handler.cpp
Unidiff
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.cpp6
1 files changed, 0 insertions, 6 deletions
diff --git a/noncore/apps/opie-console/emulation_handler.cpp b/noncore/apps/opie-console/emulation_handler.cpp
index 836a05b..b2cd348 100644
--- a/noncore/apps/opie-console/emulation_handler.cpp
+++ b/noncore/apps/opie-console/emulation_handler.cpp
@@ -28,29 +28,27 @@ EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent,const c
28} 28}
29EmulationHandler::~EmulationHandler() { 29EmulationHandler::~EmulationHandler() {
30 delete m_teEmu; 30 delete m_teEmu;
31 delete m_teWid; 31 delete m_teWid;
32} 32}
33void EmulationHandler::load( const Profile& prof) { 33void EmulationHandler::load( const Profile& prof) {
34 m_teWid->setVTFont( font( prof.readNumEntry("Font") ) ); 34 m_teWid->setVTFont( font( prof.readNumEntry("Font") ) );
35 int num = prof.readNumEntry("Color"); 35 int num = prof.readNumEntry("Color");
36 setColor( foreColor(num), backColor(num) ); 36 setColor( foreColor(num), backColor(num) );
37 m_teWid->setBackgroundColor(backColor(num) ); 37 m_teWid->setBackgroundColor(backColor(num) );
38} 38}
39void EmulationHandler::recv( const QByteArray& ar) { 39void EmulationHandler::recv( const QByteArray& ar) {
40 qWarning("received in EmulationHandler!");
41 m_teEmu->onRcvBlock(ar.data(), ar.count() ); 40 m_teEmu->onRcvBlock(ar.data(), ar.count() );
42} 41}
43void EmulationHandler::recvEmulation(const char* src, int len ) { 42void EmulationHandler::recvEmulation(const char* src, int len ) {
44 qWarning("received from te ");
45 QByteArray ar(len); 43 QByteArray ar(len);
46 44
47 memcpy(ar.data(), src, sizeof(char) * len ); 45 memcpy(ar.data(), src, sizeof(char) * len );
48 46
49 emit send(ar); 47 emit send(ar);
50} 48}
51QWidget* EmulationHandler::widget() { 49QWidget* EmulationHandler::widget() {
52 return m_teWid; 50 return m_teWid;
53} 51}
54/* 52/*
55 * allocate a new table of colors 53 * allocate a new table of colors
56 */ 54 */
@@ -90,57 +88,53 @@ QFont EmulationHandler::font( int id ) {
90 break; 88 break;
91 } 89 }
92 QFont font(name, size, QFont::Normal ); 90 QFont font(name, size, QFont::Normal );
93 font.setFixedPitch(TRUE ); 91 font.setFixedPitch(TRUE );
94 return font; 92 return font;
95} 93}
96QColor EmulationHandler::foreColor(int col) { 94QColor EmulationHandler::foreColor(int col) {
97 QColor co; 95 QColor co;
98 /* we need to switch it */ 96 /* we need to switch it */
99 switch( col ) { 97 switch( col ) {
100 default: 98 default:
101 case Profile::White: 99 case Profile::White:
102 qWarning("Foreground black");
103 /* color is black */ 100 /* color is black */
104 co = Qt::white; 101 co = Qt::white;
105 break; 102 break;
106 case Profile::Black: 103 case Profile::Black:
107 qWarning("Foreground white");
108 co = Qt::black; 104 co = Qt::black;
109 break; 105 break;
110 case Profile::Green: 106 case Profile::Green:
111 qWarning("Foreground green"); 107 qWarning("Foreground green");
112 co = Qt::green; 108 co = Qt::green;
113 break; 109 break;
114 case Profile::Orange: 110 case Profile::Orange:
115 qWarning("Foreground orange"); 111 qWarning("Foreground orange");
116 // FIXME needs better color here 112 // FIXME needs better color here
117 co = Qt::darkYellow; 113 co = Qt::darkYellow;
118 break; 114 break;
119 } 115 }
120 116
121 return co; 117 return co;
122} 118}
123QColor EmulationHandler::backColor(int col ) { 119QColor EmulationHandler::backColor(int col ) {
124 QColor co; 120 QColor co;
125 /* we need to switch it */ 121 /* we need to switch it */
126 switch( col ) { 122 switch( col ) {
127 default: 123 default:
128 case Profile::White: 124 case Profile::White:
129 qWarning("Background white");
130 /* color is white */ 125 /* color is white */
131 co = Qt::black; 126 co = Qt::black;
132 break; 127 break;
133 case Profile::Black: 128 case Profile::Black:
134 qWarning("Background black");
135 co = Qt::white; 129 co = Qt::white;
136 break; 130 break;
137 case Profile::Green: 131 case Profile::Green:
138 qWarning("Background black"); 132 qWarning("Background black");
139 co = Qt::black; 133 co = Qt::black;
140 break; 134 break;
141 case Profile::Orange: 135 case Profile::Orange:
142 qWarning("Background black"); 136 qWarning("Background black");
143 co = Qt::black; 137 co = Qt::black;
144 break; 138 break;
145 } 139 }
146 140