summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/TEHistory.cpp19
-rw-r--r--core/apps/embeddedkonsole/TEScreen.cpp107
-rw-r--r--core/apps/embeddedkonsole/TEWidget.cpp157
-rw-r--r--core/apps/embeddedkonsole/TEWidget.h15
-rw-r--r--core/apps/embeddedkonsole/TEmulation.cpp27
-rw-r--r--core/apps/embeddedkonsole/konsole.cpp34
6 files changed, 318 insertions, 41 deletions
diff --git a/core/apps/embeddedkonsole/TEHistory.cpp b/core/apps/embeddedkonsole/TEHistory.cpp
index 317ce57..db9d10c 100644
--- a/core/apps/embeddedkonsole/TEHistory.cpp
+++ b/core/apps/embeddedkonsole/TEHistory.cpp
@@ -119,4 +119,6 @@ void HistoryBuffer::add(const unsigned char* bytes, int len)
119 assert(hasScroll()); 119 assert(hasScroll());
120 rc = lseek(ion,length,SEEK_SET); if (rc < 0) { perror("HistoryBuffer::add.seek"); setScroll(FALSE); return; } 120 rc = lseek( ion, length, SEEK_SET);
121 rc = write(ion,bytes,len); if (rc < 0) { perror("HistoryBuffer::add.write"); setScroll(FALSE); return; } 121 if (rc < 0) { perror("HistoryBuffer::add.seek"); setScroll(FALSE); return; }
122 rc = write( ion, bytes, len);
123 if (rc < 0) { perror("HistoryBuffer::add.write"); setScroll(FALSE); return; }
122 length += rc; 124 length += rc;
@@ -124,9 +126,13 @@ void HistoryBuffer::add(const unsigned char* bytes, int len)
124 126
125void HistoryBuffer::get(unsigned char* bytes, int len, int loc) 127void HistoryBuffer::get(unsigned char* bytes, int len, int loc) {
126{ int rc; 128 int rc;
127 assert(hasScroll()); 129 assert(hasScroll());
130// qDebug("history get len %d, loc %d, length %d", len, loc, length);
128 if (loc < 0 || len < 0 || loc + len > length) 131 if (loc < 0 || len < 0 || loc + len > length)
129 fprintf(stderr,"getHist(...,%d,%d): invalid args.\n",len,loc); 132 fprintf(stderr,"getHist(...,%d,%d): invalid args.\n",len,loc);
130 rc = lseek(ion,loc,SEEK_SET); if (rc < 0) { perror("HistoryBuffer::get.seek"); setScroll(FALSE); return; } 133
131 rc = read(ion,bytes,len); if (rc < 0) { perror("HistoryBuffer::get.read"); setScroll(FALSE); return; } 134 rc = lseek( ion, loc, SEEK_SET);
135 if (rc < 0) { perror("HistoryBuffer::get.seek"); setScroll(FALSE); return; }
136 rc = read( ion, bytes, len);
137 if (rc < 0) { perror("HistoryBuffer::get.read"); setScroll(FALSE); return; }
132} 138}
@@ -197,2 +203,3 @@ void HistoryScroll::getCells(int lineno, int colno, int count, ca res[])
197 assert(hasScroll()); 203 assert(hasScroll());
204//get(unsigned char* bytes, int len, int loc)
198 cells.get((unsigned char*)res,count*sizeof(ca),startOfLine(lineno)+colno*sizeof(ca)); 205 cells.get((unsigned char*)res,count*sizeof(ca),startOfLine(lineno)+colno*sizeof(ca));
diff --git a/core/apps/embeddedkonsole/TEScreen.cpp b/core/apps/embeddedkonsole/TEScreen.cpp
index a3d115d..50807d3 100644
--- a/core/apps/embeddedkonsole/TEScreen.cpp
+++ b/core/apps/embeddedkonsole/TEScreen.cpp
@@ -17,2 +17,3 @@
17/* -------------------------------------------------------------------------- */ 17/* -------------------------------------------------------------------------- */
18// enhancements added by L.J. Potter <ljp@llornkcor.com>
18 19
@@ -52,2 +53,3 @@
52 53
54#include <qpe/config.h>
53#include "TEScreen.h" 55#include "TEScreen.h"
@@ -69,2 +71,3 @@ TEScreen::TEScreen(int lines, int columns)
69 this->columns = columns; 71 this->columns = columns;
72// qDebug("Columns %d", columns);
70 73
@@ -74,2 +77,3 @@ TEScreen::TEScreen(int lines, int columns)
74 histCursor = 0; 77 histCursor = 0;
78 horzCursor = 0;
75 79
@@ -385,9 +389,7 @@ void TEScreen::resizeImage(int new_lines, int new_columns)
385{ 389{
386 390 if (cuY > new_lines-1) {
387 if (cuY > new_lines-1) 391// attempt to preserve focus and lines
388 { // attempt to preserve focus and lines
389 bmargin = lines-1; //FIXME: margin lost 392 bmargin = lines-1; //FIXME: margin lost
390 for (int i = 0; i < cuY-(new_lines-1); i++) 393 for (int i = 0; i < cuY-(new_lines-1); i++) {
391 { 394 addHistLine(); scrollUp(horzCursor,1);
392 addHistLine(); scrollUp(0,1);
393 } 395 }
@@ -402,4 +404,3 @@ void TEScreen::resizeImage(int new_lines, int new_columns)
402 for (int y = 0; y < new_lines; y++) 404 for (int y = 0; y < new_lines; y++)
403 for (int x = 0; x < new_columns; x++) 405 for (int x = 0; x < new_columns; x++) {
404 {
405 newimg[y*new_columns+x].c = ' '; 406 newimg[y*new_columns+x].c = ' ';
@@ -413,4 +414,3 @@ void TEScreen::resizeImage(int new_lines, int new_columns)
413 for (int y = 0; y < cpy_lines; y++) 414 for (int y = 0; y < cpy_lines; y++)
414 for (int x = 0; x < cpy_columns; x++) 415 for (int x = 0; x < cpy_columns; x++) {
415 {
416 newimg[y*new_columns+x].c = image[loc(x,y)].c; 416 newimg[y*new_columns+x].c = image[loc(x,y)].c;
@@ -507,3 +507,4 @@ void TEScreen::effectiveRendition()
507ca* TEScreen::getCookedImage() 507ca* TEScreen::getCookedImage()
508{ int x,y; 508{
509 int x,y;
509 ca* merged = (ca*)malloc(lines*columns*sizeof(ca)); 510 ca* merged = (ca*)malloc(lines*columns*sizeof(ca));
@@ -550,2 +551,61 @@ ca* TEScreen::getCookedImage()
550 return merged; 551 return merged;
552
553 /*
554 int x, y, z;
555
556 ca* merged = (ca*)malloc( lines * columns * sizeof( ca));
557
558 ca dft(' ',DEFAULT_FORE_COLOR,DEFAULT_BACK_COLOR,DEFAULT_RENDITION);
559
560// qDebug("hist lines %d, historyCursor %d, minus %d ,lines %d, columns %d",
561// hist.getLines(), histCursor, hist.getLines() - histCursor , lines, columns);
562 for (y = 0; (y < lines) && (y < ( hist.getLines() - histCursor )); y++) {
563
564 int len = QMIN( columns, hist.getLineLen( y + histCursor) );
565 int yp = y * columns;
566 int yq = ( y + histCursor) * columns;
567// qDebug("horzCursor %d, columns %d, len %d", horzCursor, columns, len);
568// qDebug("lineno %d, colno %d, count %d\n", y + histCursor, (horzCursor / 2), len );
569 qDebug("Y %d", y);
570 hist.getCells( y + histCursor, (horzCursor / 2), len, merged + yp);
571
572 for (x = len; x < columns; x++)
573 merged[yp + x] = dft;
574 for (x = 0; x < columns; x++) {
575 int p = x + yp; int q = x + yq;
576 if ( ( q >= sel_TL ) && ( q <= sel_BR ) )
577 reverseRendition(&merged[p]); // for selection
578 }
579 }
580
581 if (lines >= hist.getLines() - histCursor) {
582 for (y = ( hist.getLines() - histCursor); y < lines ; y++) {
583 int z = horzCursor;
584 int yp = y * columns;
585 int yq = ( y + histCursor) * columns;
586 int yr = ( y - hist.getLines() + histCursor) * columns;
587// qDebug("y %d, yp %d, yq %d, columns %d, z cursor %d", y, yp, yq, columns, z);
588 for (x = 0; x < columns; x++) {
589 int p = x + yp; int q = x + yq; int r = (x + (horzCursor/2) ) + yr;
590 merged[p] = image[r];
591 if ( q >= sel_TL && q <= sel_BR )
592 reverseRendition( &merged[p]); // for selection
593 }
594 }
595 }
596
597
598// evtl. inverse display
599 if (getMode(MODE_Screen))
600 { int i, n = lines * columns;
601 for (i = 0; i < n; i++)
602 reverseRendition( &merged[i]); // for reverse display
603 }
604 if (getMode(MODE_Cursor) && ( cuY + ( hist.getLines() - histCursor) < lines)) // cursor visible
605
606 reverseRendition( &merged[ loc( cuX, cuY + ( hist.getLines() - histCursor))] );
607
608 return merged;
609 */
610
551} 611}
@@ -558,3 +618,8 @@ void TEScreen::reset()
558{ 618{
619 Config cfg("Konsole");
620 cfg.setGroup("ScrollBar");
621 if( !cfg.readBoolEntry("HorzScroll",0) )
559 setMode(MODE_Wrap ); saveMode(MODE_Wrap ); // wrap at end of margin 622 setMode(MODE_Wrap ); saveMode(MODE_Wrap ); // wrap at end of margin
623
624
560 resetMode(MODE_Origin); saveMode(MODE_Origin); // position refere to [1,1] 625 resetMode(MODE_Origin); saveMode(MODE_Origin); // position refere to [1,1]
@@ -661,2 +726,3 @@ void TEScreen::ShowCharacter(unsigned short c)
661 if (getMode(MODE_Wrap)) NextLine(); else cuX = columns-1; 726 if (getMode(MODE_Wrap)) NextLine(); else cuX = columns-1;
727 // comment out for no wrap
662 } 728 }
@@ -689,2 +755,3 @@ void TEScreen::scrollUp(int from, int n)
689 //FIXME: make sure `tmargin', `bmargin', `from', `n' is in bounds. 755 //FIXME: make sure `tmargin', `bmargin', `from', `n' is in bounds.
756
690 moveImage(loc(0,from),loc(0,from+n),loc(columns-1,bmargin)); 757 moveImage(loc(0,from),loc(0,from+n),loc(columns-1,bmargin));
@@ -700,2 +767,3 @@ void TEScreen::scrollDown(int from, int n)
700{ 767{
768
701//FIXME: make sure `tmargin', `bmargin', `from', `n' is in bounds. 769//FIXME: make sure `tmargin', `bmargin', `from', `n' is in bounds.
@@ -704,2 +772,3 @@ void TEScreen::scrollDown(int from, int n)
704 if (from + n > bmargin) n = bmargin - from; 772 if (from + n > bmargin) n = bmargin - from;
773
705 moveImage(loc(0,from+n),loc(0,from),loc(columns-1,bmargin-n)); 774 moveImage(loc(0,from+n),loc(0,from),loc(columns-1,bmargin-n));
@@ -708,2 +777,4 @@ void TEScreen::scrollDown(int from, int n)
708 777
778
779
709/*! position the cursor to a specific line and column. */ 780/*! position the cursor to a specific line and column. */
@@ -1154,4 +1225,4 @@ void TEScreen::addHistLine()
1154 1225
1155 if (hasScroll()) 1226 if (hasScroll()){
1156 { ca dft; 1227 ca dft;
1157 1228
@@ -1176,2 +1247,7 @@ void TEScreen::setHistCursor(int cursor)
1176 1247
1248void TEScreen::setHorzCursor(int cursor)
1249{
1250 horzCursor = cursor;
1251}
1252
1177int TEScreen::getHistCursor() 1253int TEScreen::getHistCursor()
@@ -1181,2 +1257,7 @@ int TEScreen::getHistCursor()
1181 1257
1258int TEScreen::getHorzCursor()
1259{
1260 return horzCursor;
1261}
1262
1182int TEScreen::getHistLines() 1263int TEScreen::getHistLines()
diff --git a/core/apps/embeddedkonsole/TEWidget.cpp b/core/apps/embeddedkonsole/TEWidget.cpp
index b1ad008..c10c7a8 100644
--- a/core/apps/embeddedkonsole/TEWidget.cpp
+++ b/core/apps/embeddedkonsole/TEWidget.cpp
@@ -54,2 +54,9 @@
54 54
55#include <qpe/resource.h>
56#include <qpe/sound.h>
57
58#ifdef QWS
59#include <qpe/qcopenvelope_qws.h>
60#endif
61
55#include <qcursor.h> 62#include <qcursor.h>
@@ -289,2 +296,9 @@ TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name)
289 296
297 hScrollbar = new QScrollBar(this);
298 hScrollbar->setCursor( arrowCursor );
299 hScrollbar->setOrientation(QScrollBar::Horizontal);
300 hScrollbar->setMaximumHeight(16);
301
302 connect( hScrollbar, SIGNAL(valueChanged(int)), this, SLOT( hScrollChanged(int)));
303
290 Config cfg("Konsole"); 304 Config cfg("Konsole");
@@ -303,2 +317,4 @@ TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name)
303 317
318 useHorzScroll=cfg.readBoolEntry("HorzScroll",0);
319
304 blinkT = new QTimer(this); 320 blinkT = new QTimer(this);
@@ -317,2 +333,3 @@ TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name)
317 word_selection_mode = FALSE; 333 word_selection_mode = FALSE;
334 hposition = 0;
318 335
@@ -412,6 +429,3 @@ HCNT("setImage");
412 QChar *disstrU = new QChar[cols]; 429 QChar *disstrU = new QChar[cols];
413 430 for (y = 0; y < lins; y++) {
414//{ static int cnt = 0; printf("setImage %d\n",cnt++); }
415 for (y = 0; y < lins; y++)
416 {
417 const ca* lcl = &image[y*this->columns]; 431 const ca* lcl = &image[y*this->columns];
@@ -590,4 +604,3 @@ void TEWidget::propagateSize()
590 604
591void TEWidget::scrollChanged(int) 605void TEWidget::scrollChanged(int) {
592{
593 emit changedHistoryCursor(scrollbar->value()); //expose 606 emit changedHistoryCursor(scrollbar->value()); //expose
@@ -595,2 +608,10 @@ void TEWidget::scrollChanged(int)
595 608
609void TEWidget::hScrollChanged(int loc) {
610 hposition = loc;
611 propagateSize();
612 update();
613
614// emit changedHorzCursor( hScrollbar->value()); //expose
615}
616
596void TEWidget::setScroll(int cursor, int slines) 617void TEWidget::setScroll(int cursor, int slines)
@@ -699,2 +720,3 @@ void TEWidget::mouseMoveEvent(QMouseEvent* ev)
699 int scroll = scrollbar->value(); 720 int scroll = scrollbar->value();
721// int hScroll = hScrollbar->value();
700 722
@@ -975,2 +997,6 @@ void TEWidget::doScroll(int lines)
975 997
998void TEWidget::doHScroll(int lines) {
999 hScrollbar->setValue( hScrollbar->value()+lines);
1000}
1001
976bool TEWidget::eventFilter( QObject *obj, QEvent *e ) 1002bool TEWidget::eventFilter( QObject *obj, QEvent *e )
@@ -1080,3 +1106,13 @@ void TEWidget::Bell()
1080{ 1106{
1081 QApplication::beep(); 1107//#ifdef QT_QWS_CUSTOM
1108//# ifndef QT_NO_COP
1109 QCopEnvelope( "QPE/TaskBar", "soundAlarm()" );
1110//# endif
1111//#else
1112//# ifndef QT_NO_SOUND
1113// QSound::play(Resource::findSound("alarm"));
1114//# endif
1115//#endif
1116
1117// QApplication::beep();
1082} 1118}
@@ -1107,3 +1143,72 @@ void TEWidget::calcGeometry()
1107{ 1143{
1108 //FIXME: set rimX == rimY == 0 when running in full screen mode. 1144 int showhscrollbar = 1;
1145 int hwidth = 0;
1146 int dcolumns;
1147 Config cfg("Konsole");
1148 cfg.setGroup("ScrollBar");
1149 useHorzScroll=cfg.readBoolEntry("HorzScroll",0);
1150
1151 if(vcolumns == 0) showhscrollbar = 0;
1152 if(showhscrollbar == 1) hwidth = QApplication::style().scrollBarExtent().width();
1153
1154 scrollbar->resize(QApplication::style().scrollBarExtent().width(),
1155 contentsRect().height() - hwidth);
1156
1157 switch(scrollLoc) {
1158 case SCRNONE :
1159 columns = ( contentsRect().width() - 2 * rimX ) / font_w;
1160 dcolumns = columns;
1161 if(vcolumns) columns = vcolumns;
1162 blX = (contentsRect().width() - (columns*font_w) ) / 2;
1163 if(showhscrollbar)
1164 blX = -hposition * font_w;
1165 brX = blX;
1166 scrollbar->hide();
1167 break;
1168 case SCRLEFT :
1169 columns = ( contentsRect().width() - 2 * rimX - scrollbar->width()) / font_w;
1170 dcolumns = columns;
1171 if(vcolumns) columns = vcolumns;
1172 brX = (contentsRect().width() - (columns*font_w) - scrollbar->width() ) / 2;
1173 if(showhscrollbar)
1174 brX = -hposition * font_w;
1175 blX = brX + scrollbar->width();
1176 scrollbar->move(contentsRect().topLeft());
1177 scrollbar->show();
1178 break;
1179 case SCRRIGHT:
1180 columns = ( contentsRect().width() - 2 * rimX - scrollbar->width()) / font_w;
1181 dcolumns = columns;
1182 if(vcolumns) columns = vcolumns;
1183 blX = (contentsRect().width() - (columns*font_w) - scrollbar->width() ) / 2;
1184 if(showhscrollbar)
1185 blX = -hposition * font_w;
1186 brX = blX;
1187 scrollbar->move(contentsRect().topRight() - QPoint(scrollbar->width()-1,0));
1188 scrollbar->show();
1189 break;
1190 }
1191 //FIXME: support 'rounding' styles
1192 lines = ( contentsRect().height() - 2 * rimY ) / font_h;
1193 bY = (contentsRect().height() - (lines *font_h)) / 2;
1194
1195 if(showhscrollbar == 1) {
1196 hScrollbar->resize(contentsRect().width() - hwidth, hwidth);
1197 hScrollbar->setRange(0, vcolumns - dcolumns);
1198
1199 QPoint p = contentsRect().bottomLeft();
1200 hScrollbar->move(QPoint(p.x(), p.y() - hwidth));
1201 hScrollbar->show();
1202 }
1203 else hScrollbar->hide();
1204
1205 if(showhscrollbar == 1) {
1206 lines = lines - (hwidth / font_h) - 1;
1207 if(lines < 1) lines = 1;
1208 }
1209
1210 /*//FIXME: set rimX == rimY == 0 when running in full screen mode.
1211 Config cfg("Konsole");
1212 cfg.setGroup("ScrollBar");
1213 useHorzScroll=cfg.readBoolEntry("HorzScroll",0);
1109 1214
@@ -1111,2 +1216,3 @@ void TEWidget::calcGeometry()
1111 contentsRect().height()); 1216 contentsRect().height());
1217 qDebug("font_w %d", font_w);
1112 switch(scrollLoc) 1218 switch(scrollLoc)
@@ -1121,2 +1227,3 @@ void TEWidget::calcGeometry()
1121 columns = ( contentsRect().width() - 2 * rimX - scrollbar->width()) / font_w; 1227 columns = ( contentsRect().width() - 2 * rimX - scrollbar->width()) / font_w;
1228 if(useHorzScroll) columns = columns * (font_w/2);
1122 brX = (contentsRect().width() - (columns*font_w) - scrollbar->width() ) / 2; 1229 brX = (contentsRect().width() - (columns*font_w) - scrollbar->width() ) / 2;
@@ -1128,4 +1235,9 @@ void TEWidget::calcGeometry()
1128 columns = ( contentsRect().width() - 2 * rimX - scrollbar->width()) / font_w; 1235 columns = ( contentsRect().width() - 2 * rimX - scrollbar->width()) / font_w;
1236 if(useHorzScroll) columns = columns * (font_w/2);
1129 blX = (contentsRect().width() - (columns*font_w) - scrollbar->width() ) / 2; 1237 blX = (contentsRect().width() - (columns*font_w) - scrollbar->width() ) / 2;
1238 if(useHorzScroll) {
1239 brX = blX =2;
1240 } else {
1130 brX = blX; 1241 brX = blX;
1242 }
1131 scrollbar->move(contentsRect().topRight() - QPoint(scrollbar->width()-1,0)); 1243 scrollbar->move(contentsRect().topRight() - QPoint(scrollbar->width()-1,0));
@@ -1134,3 +1246,19 @@ void TEWidget::calcGeometry()
1134 } 1246 }
1135 //FIXME: support 'rounding' styles 1247
1248 if( !scrollbar->isHidden())
1249 hScrollbar->resize( contentsRect().width()-SCRWIDTH, QApplication::style()
1250 .scrollBarExtent().height());
1251 else
1252 hScrollbar->resize( contentsRect().width(), QApplication::style()
1253 .scrollBarExtent().height());
1254
1255 hScrollbar->move( 0, contentsRect().height() - SCRWIDTH);
1256
1257
1258 if(useHorzScroll) {
1259 hScrollbar->show();
1260 lines = ( (contentsRect().height() - SCRWIDTH) - 2 * rimY ) / font_h;
1261 bY = ((contentsRect().height() - SCRWIDTH) - (lines *font_h)) / 2;
1262 } else {
1263 hScrollbar->hide();
1136 lines = ( contentsRect().height() - 2 * rimY ) / font_h; 1264 lines = ( contentsRect().height() - 2 * rimY ) / font_h;
@@ -1138,2 +1266,5 @@ void TEWidget::calcGeometry()
1138} 1266}
1267 */
1268 //FIXME: support 'rounding' styles
1269}
1139 1270
@@ -1268 +1399,9 @@ void TEWidget::drop_menu_activated(int item)
1268 1399
1400void TEWidget::setWrapAt(int columns)
1401{
1402 vcolumns = columns;
1403 propagateSize();
1404 update();
1405}
1406
1407
diff --git a/core/apps/embeddedkonsole/TEWidget.h b/core/apps/embeddedkonsole/TEWidget.h
index 40e1aea..a480d45 100644
--- a/core/apps/embeddedkonsole/TEWidget.h
+++ b/core/apps/embeddedkonsole/TEWidget.h
@@ -62,3 +62,7 @@ public:
62 62
63 void doHScroll(int lines);
64
65
63 void emitSelection(); 66 void emitSelection();
67 void setWrapAt(int columns);
64 68
@@ -78,2 +82,3 @@ public:
78public: 82public:
83 bool useHorzScroll;
79 84
@@ -89,2 +94,3 @@ signals:
89 void changedHistoryCursor(int value); 94 void changedHistoryCursor(int value);
95 void changedHorzCursor(int value);
90 void configureRequest( TEWidget*, int state, int x, int y ); 96 void configureRequest( TEWidget*, int state, int x, int y );
@@ -98,3 +104,2 @@ signals:
98protected: 104protected:
99
100 virtual void styleChange( QStyle& ); 105 virtual void styleChange( QStyle& );
@@ -149,2 +154,3 @@ protected slots:
149 void scrollChanged(int value); 154 void scrollChanged(int value);
155 void hScrollChanged(int value);
150 void blinkEvent(); 156 void blinkEvent();
@@ -182,4 +188,7 @@ private:
182 QClipboard* cb; 188 QClipboard* cb;
183 QScrollBar* scrollbar; 189 QScrollBar* scrollbar, *hScrollbar;
184 int scrollLoc; 190
191 int scrollLoc, hScrollLoc;
192 int hposition, vcolumns;
193
185 194
diff --git a/core/apps/embeddedkonsole/TEmulation.cpp b/core/apps/embeddedkonsole/TEmulation.cpp
index 6f3ad32..c19f2a1 100644
--- a/core/apps/embeddedkonsole/TEmulation.cpp
+++ b/core/apps/embeddedkonsole/TEmulation.cpp
@@ -105,14 +105,24 @@ TEmulation::TEmulation(TEWidget* gui)
105 QObject::connect(&bulk_timer, SIGNAL(timeout()), this, SLOT(showBulk()) ); 105 QObject::connect(&bulk_timer, SIGNAL(timeout()), this, SLOT(showBulk()) );
106
106 QObject::connect(gui,SIGNAL(changedImageSizeSignal(int,int)), 107 QObject::connect(gui,SIGNAL(changedImageSizeSignal(int,int)),
107 this,SLOT(onImageSizeChange(int,int))); 108 this,SLOT(onImageSizeChange(int,int)));
109
108 QObject::connect(gui,SIGNAL(changedHistoryCursor(int)), 110 QObject::connect(gui,SIGNAL(changedHistoryCursor(int)),
109 this,SLOT(onHistoryCursorChange(int))); 111 this,SLOT(onHistoryCursorChange(int)));
112
113 QObject::connect(gui,SIGNAL(changedHorzCursor(int)),
114 this,SLOT(onHorzCursorChange(int)));
115
110 QObject::connect(gui,SIGNAL(keyPressedSignal(QKeyEvent*)), 116 QObject::connect(gui,SIGNAL(keyPressedSignal(QKeyEvent*)),
111 this,SLOT(onKeyPress(QKeyEvent*))); 117 this,SLOT(onKeyPress(QKeyEvent*)));
118
112 QObject::connect(gui,SIGNAL(beginSelectionSignal(const int,const int)), 119 QObject::connect(gui,SIGNAL(beginSelectionSignal(const int,const int)),
113 this,SLOT(onSelectionBegin(const int,const int)) ); 120 this,SLOT(onSelectionBegin(const int,const int)) );
121
114 QObject::connect(gui,SIGNAL(extendSelectionSignal(const int,const int)), 122 QObject::connect(gui,SIGNAL(extendSelectionSignal(const int,const int)),
115 this,SLOT(onSelectionExtend(const int,const int)) ); 123 this,SLOT(onSelectionExtend(const int,const int)) );
124
116 QObject::connect(gui,SIGNAL(endSelectionSignal(const BOOL)), 125 QObject::connect(gui,SIGNAL(endSelectionSignal(const BOOL)),
117 this,SLOT(setSelection(const BOOL)) ); 126 this,SLOT(setSelection(const BOOL)) );
127
118 QObject::connect(gui,SIGNAL(clearSelectionSignal()), 128 QObject::connect(gui,SIGNAL(clearSelectionSignal()),
@@ -301,4 +311,6 @@ void TEmulation::showBulk()
301 free(image); 311 free(image);
312
302 //FIXME: check that we do not trigger other draw event here. 313 //FIXME: check that we do not trigger other draw event here.
303 gui->setScroll(scr->getHistCursor(),scr->getHistLines()); 314 gui->setScroll(scr->getHistCursor(),scr->getHistLines());
315
304 } 316 }
@@ -341,4 +353,3 @@ void TEmulation::setConnect(bool c)
341 353
342void TEmulation::onImageSizeChange(int lines, int columns) 354void TEmulation::onImageSizeChange(int lines, int columns) {
343{
344 if (!connected) return; 355 if (!connected) return;
@@ -350,4 +361,3 @@ void TEmulation::onImageSizeChange(int lines, int columns)
350 361
351void TEmulation::onHistoryCursorChange(int cursor) 362void TEmulation::onHistoryCursorChange(int cursor) {
352{
353 if (!connected) return; 363 if (!connected) return;
@@ -357,4 +367,9 @@ void TEmulation::onHistoryCursorChange(int cursor)
357 367
358void TEmulation::setColumns(int columns) 368void TEmulation::onHorzCursorChange(int cursor) {
359{ 369 if (!connected) return;
370 scr->setHorzCursor(cursor);
371 showBulk();
372}
373
374void TEmulation::setColumns(int columns) {
360 //FIXME: this goes strange ways. 375 //FIXME: this goes strange ways.
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp
index a8ddc99..3c87ad4 100644
--- a/core/apps/embeddedkonsole/konsole.cpp
+++ b/core/apps/embeddedkonsole/konsole.cpp
@@ -360,4 +360,16 @@ void Konsole::init(const char* _pgm, QStrList & _args)
360 scrollMenu->insertItem(tr( "Right" )); 360 scrollMenu->insertItem(tr( "Right" ));
361 configMenu->insertItem(tr( "ScrollBar" ),scrollMenu); 361 scrollMenu->insertSeparator(4);
362 scrollMenu->insertItem(tr( "Horizontal" ));
362 363
364 configMenu->insertItem(tr( "ScrollBar" ),scrollMenu);
365//scrollMenuSelected(-29);
366// cfg.setGroup("ScrollBar");
367// if(cfg.readBoolEntry("HorzScroll",0)) {
368// if(cfg.readNumEntry("Position",2) == 0)
369// te->setScrollbarLocation(1);
370// else
371// te->setScrollbarLocation(0);
372// te->setScrollbarLocation( cfg.readNumEntry("Position",2));
373// te->setWrapAt(120);
374// }
363 // create applications ///////////////////////////////////////////////////// 375 // create applications /////////////////////////////////////////////////////
@@ -374,3 +386,3 @@ void Konsole::init(const char* _pgm, QStrList & _args)
374 se_args = _args; 386 se_args = _args;
375 387 se_args.prepend("--login");
376parseCommandLine(); 388parseCommandLine();
@@ -510,2 +522,4 @@ void Konsole::setColLin(int columns, int lines)
510{ 522{
523 qDebug("konsole::setColLin:: Columns %d", columns);
524
511 if ((columns==0) || (lines==0)) 525 if ((columns==0) || (lines==0))
@@ -554,2 +568,3 @@ void Konsole::changeColumns(int columns)
554{ 568{
569 qDebug("change columns");
555 TEWidget* te = getTe(); 570 TEWidget* te = getTe();
@@ -802,4 +817,3 @@ void Konsole::scrollMenuSelected(int index)
802{ 817{
803// QString temp; 818 qDebug( "scrollbar menu %d",index);
804// qDebug( temp.sprintf("scrollbar menu %d",index));
805 TEWidget* te = getTe(); 819 TEWidget* te = getTe();
@@ -820,2 +834,14 @@ void Konsole::scrollMenuSelected(int index)
820 break; 834 break;
835 case -29: {
836 bool b=cfg.readBoolEntry("HorzScroll",0);
837 cfg.writeEntry("HorzScroll", !b );
838 cfg.write();
839 if(cfg.readNumEntry("Position",2) == 0)
840 te->setScrollbarLocation(1);
841 else
842 te->setScrollbarLocation(0);
843 te->setScrollbarLocation( cfg.readNumEntry("Position",2));
844 te->setWrapAt(120);
845 }
846 break;
821 }; 847 };