author | llornkcor <llornkcor> | 2002-10-31 20:10:52 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-10-31 20:10:52 (UTC) |
commit | ab5a63544deead5206ca47ff8bf94123aa032281 (patch) (unidiff) | |
tree | b28514032d605dc28a5bffbd6918066c81fff74f | |
parent | 16d3fac9169e400f5542ca0e3aa993cc5c5db574 (diff) | |
download | opie-ab5a63544deead5206ca47ff8bf94123aa032281.zip opie-ab5a63544deead5206ca47ff8bf94123aa032281.tar.gz opie-ab5a63544deead5206ca47ff8bf94123aa032281.tar.bz2 |
no wrap and horz scroll should work, thanks to console
-rw-r--r-- | core/apps/embeddedkonsole/TEHistory.h | 6 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/TEScreen.h | 14 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/TEWidget.cpp | 5 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/TEmulation.h | 7 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/konsole.cpp | 90 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/konsole.h | 1 |
6 files changed, 83 insertions, 40 deletions
diff --git a/core/apps/embeddedkonsole/TEHistory.h b/core/apps/embeddedkonsole/TEHistory.h index 8339ec6..11eb150 100644 --- a/core/apps/embeddedkonsole/TEHistory.h +++ b/core/apps/embeddedkonsole/TEHistory.h | |||
@@ -8,13 +8,13 @@ | |||
8 | /* */ | 8 | /* */ |
9 | /* This file is part of Konsole - an X terminal for KDE */ | 9 | /* This file is part of Konsole - an X terminal for KDE */ |
10 | /* */ | 10 | /* */ |
11 | /* -------------------------------------------------------------------------- */ | 11 | /* -------------------------------------------------------------------------- */ |
12 | /* */ | 12 | /* */ |
13 | /* Ported Konsole to Qt/Embedded */ | 13 | /* Ported Konsole to Qt/Embedded */ |
14 | /* */ | 14 | /* */ |
15 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ | 15 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ |
16 | /* */ | 16 | /* */ |
17 | /* -------------------------------------------------------------------------- */ | 17 | /* -------------------------------------------------------------------------- */ |
18 | 18 | ||
19 | #ifndef TEHISTORY_H | 19 | #ifndef TEHISTORY_H |
20 | #define TEHISTORY_H | 20 | #define TEHISTORY_H |
diff --git a/core/apps/embeddedkonsole/TEScreen.h b/core/apps/embeddedkonsole/TEScreen.h index ba47ee5..a28f7c5 100644 --- a/core/apps/embeddedkonsole/TEScreen.h +++ b/core/apps/embeddedkonsole/TEScreen.h | |||
@@ -8,13 +8,13 @@ | |||
8 | /* */ | 8 | /* */ |
9 | /* This file is part of Konsole - an X terminal for KDE */ | 9 | /* This file is part of Konsole - an X terminal for KDE */ |
10 | /* */ | 10 | /* */ |
11 | /* -------------------------------------------------------------------------- */ | 11 | /* -------------------------------------------------------------------------- */ |
12 | /* */ | 12 | /* */ |
13 | /* Ported Konsole to Qt/Embedded */ | 13 | /* Ported Konsole to Qt/Embedded */ |
14 | /* */ | 14 | /* */ |
15 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ | 15 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ |
16 | /* */ | 16 | /* */ |
17 | /* -------------------------------------------------------------------------- */ | 17 | /* -------------------------------------------------------------------------- */ |
18 | 18 | ||
19 | #ifndef TESCREEN_H | 19 | #ifndef TESCREEN_H |
20 | #define TESCREEN_H | 20 | #define TESCREEN_H |
@@ -139,16 +139,22 @@ public: // these are all `Screen' operations | |||
139 | ca* getCookedImage(); | 139 | ca* getCookedImage(); |
140 | 140 | ||
141 | /*! return the number of lines. */ | 141 | /*! return the number of lines. */ |
142 | int getLines() { return lines; } | 142 | int getLines() { return lines; } |
143 | |||
143 | /*! return the number of columns. */ | 144 | /*! return the number of columns. */ |
144 | int getColumns() { return columns; } | 145 | int getColumns() { return columns; } |
145 | 146 | ||
146 | /*! set the position of the history cursor. */ | 147 | /*! set the position of the history cursor. */ |
147 | void setHistCursor(int cursor); | 148 | void setHistCursor(int cursor); |
148 | /*! return the position of the history cursor. */ | 149 | /*! return the position of the history cursor. */ |
149 | int getHistCursor(); | 150 | int getHistCursor(); |
150 | 151 | ||
152 | /*! set the position of the horizontal cursor. */ | ||
153 | void setHorzCursor(int cursor); | ||
154 | /*! return the position of the horizontal cursor. */ | ||
155 | int getHorzCursor(); | ||
156 | |||
151 | int getHistLines (); | 157 | int getHistLines (); |
152 | void setScroll(bool on); | 158 | void setScroll(bool on); |
153 | bool hasScroll(); | 159 | bool hasScroll(); |
154 | 160 | ||
@@ -198,8 +204,10 @@ private: | |||
198 | // history buffer --------------- | 204 | // history buffer --------------- |
199 | 205 | ||
200 | int histCursor; // display position relative to start of the history buffer | 206 | int histCursor; // display position relative to start of the history buffer |
201 | HistoryScroll hist; | 207 | HistoryScroll hist; |
208 | |||
209 | int horzCursor; | ||
202 | 210 | ||
203 | // cursor location | 211 | // cursor location |
204 | 212 | ||
205 | int cuX; | 213 | int cuX; |
diff --git a/core/apps/embeddedkonsole/TEWidget.cpp b/core/apps/embeddedkonsole/TEWidget.cpp index c10c7a8..60021f4 100644 --- a/core/apps/embeddedkonsole/TEWidget.cpp +++ b/core/apps/embeddedkonsole/TEWidget.cpp | |||
@@ -331,9 +331,10 @@ TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name) | |||
331 | font_h = 1; | 331 | font_h = 1; |
332 | font_a = 1; | 332 | font_a = 1; |
333 | word_selection_mode = FALSE; | 333 | word_selection_mode = FALSE; |
334 | hposition = 0; | 334 | hposition = 0; |
335 | 335 | vcolumns = 0; | |
336 | |||
336 | setMouseMarks(TRUE); | 337 | setMouseMarks(TRUE); |
337 | setVTFont( QFont("fixed") ); | 338 | setVTFont( QFont("fixed") ); |
338 | setColorTable(base_color_table); // init color table | 339 | setColorTable(base_color_table); // init color table |
339 | 340 | ||
@@ -1402,6 +1403,4 @@ void TEWidget::setWrapAt(int columns) | |||
1402 | vcolumns = columns; | 1403 | vcolumns = columns; |
1403 | propagateSize(); | 1404 | propagateSize(); |
1404 | update(); | 1405 | update(); |
1405 | } | 1406 | } |
1406 | |||
1407 | |||
diff --git a/core/apps/embeddedkonsole/TEmulation.h b/core/apps/embeddedkonsole/TEmulation.h index ec15e7a..bf43f11 100644 --- a/core/apps/embeddedkonsole/TEmulation.h +++ b/core/apps/embeddedkonsole/TEmulation.h | |||
@@ -8,13 +8,13 @@ | |||
8 | /* */ | 8 | /* */ |
9 | /* This file is part of Konsole - an X terminal for KDE */ | 9 | /* This file is part of Konsole - an X terminal for KDE */ |
10 | /* */ | 10 | /* */ |
11 | /* -------------------------------------------------------------------------- */ | 11 | /* -------------------------------------------------------------------------- */ |
12 | /* */ | 12 | /* */ |
13 | /* Ported Konsole to Qt/Embedded */ | 13 | /* Ported Konsole to Qt/Embedded */ |
14 | /* */ | 14 | /* */ |
15 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ | 15 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ |
16 | /* */ | 16 | /* */ |
17 | /* -------------------------------------------------------------------------- */ | 17 | /* -------------------------------------------------------------------------- */ |
18 | 18 | ||
19 | #ifndef EMULATION_H | 19 | #ifndef EMULATION_H |
20 | #define EMULATION_H | 20 | #define EMULATION_H |
@@ -41,8 +41,9 @@ public: | |||
41 | public slots: // signals incoming from TEWidget | 41 | public slots: // signals incoming from TEWidget |
42 | 42 | ||
43 | virtual void onImageSizeChange(int lines, int columns); | 43 | virtual void onImageSizeChange(int lines, int columns); |
44 | virtual void onHistoryCursorChange(int cursor); | 44 | virtual void onHistoryCursorChange(int cursor); |
45 | virtual void onHorzCursorChange(int cursor); | ||
45 | virtual void onKeyPress(QKeyEvent*); | 46 | virtual void onKeyPress(QKeyEvent*); |
46 | 47 | ||
47 | virtual void clearSelection(); | 48 | virtual void clearSelection(); |
48 | virtual void onSelectionBegin(const int x, const int y); | 49 | virtual void onSelectionBegin(const int x, const int y); |
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp index 3c87ad4..16db0ea 100644 --- a/core/apps/embeddedkonsole/konsole.cpp +++ b/core/apps/embeddedkonsole/konsole.cpp | |||
@@ -357,12 +357,15 @@ void Konsole::init(const char* _pgm, QStrList & _args) | |||
357 | 357 | ||
358 | scrollMenu->insertItem(tr( "None" )); | 358 | scrollMenu->insertItem(tr( "None" )); |
359 | scrollMenu->insertItem(tr( "Left" )); | 359 | scrollMenu->insertItem(tr( "Left" )); |
360 | scrollMenu->insertItem(tr( "Right" )); | 360 | scrollMenu->insertItem(tr( "Right" )); |
361 | scrollMenu->insertSeparator(4); | 361 | // scrollMenu->insertSeparator(4); |
362 | scrollMenu->insertItem(tr( "Horizontal" )); | 362 | // scrollMenu->insertItem(tr( "Horizontal" )); |
363 | 363 | ||
364 | configMenu->insertItem(tr( "ScrollBar" ),scrollMenu); | 364 | configMenu->insertItem(tr( "ScrollBar" ),scrollMenu); |
365 | |||
366 | configMenu->insertItem(tr( "Wrap" )); | ||
367 | |||
365 | //scrollMenuSelected(-29); | 368 | //scrollMenuSelected(-29); |
366 | // cfg.setGroup("ScrollBar"); | 369 | // cfg.setGroup("ScrollBar"); |
367 | // if(cfg.readBoolEntry("HorzScroll",0)) { | 370 | // if(cfg.readBoolEntry("HorzScroll",0)) { |
368 | // if(cfg.readNumEntry("Position",2) == 0) | 371 | // if(cfg.readNumEntry("Position",2) == 0) |
@@ -398,8 +401,9 @@ void Konsole::show() | |||
398 | if ( !nsessions ) { | 401 | if ( !nsessions ) { |
399 | newSession(); | 402 | newSession(); |
400 | } | 403 | } |
401 | QMainWindow::show(); | 404 | QMainWindow::show(); |
405 | |||
402 | } | 406 | } |
403 | 407 | ||
404 | void Konsole::initSession(const char*, QStrList &) | 408 | void Konsole::initSession(const char*, QStrList &) |
405 | { | 409 | { |
@@ -597,19 +601,20 @@ void Konsole::doneSession(TESession*, int ) | |||
597 | void Konsole::newSession() { | 601 | void Konsole::newSession() { |
598 | if(nsessions < 15) { // seems to be something weird about 16 tabs on the Zaurus.... memory? | 602 | if(nsessions < 15) { // seems to be something weird about 16 tabs on the Zaurus.... memory? |
599 | TEWidget* te = new TEWidget(tab); | 603 | TEWidget* te = new TEWidget(tab); |
600 | // te->setBackgroundMode(PaletteBase); //we want transparent!! | 604 | // te->setBackgroundMode(PaletteBase); //we want transparent!! |
601 | te->setVTFont(fonts.at(cfont)->getFont()); | 605 | te->setVTFont(fonts.at(cfont)->getFont()); |
602 | tab->addTab(te); | 606 | tab->addTab(te); |
603 | TESession* se = new TESession(this, te, se_pgm, se_args, "xterm"); | 607 | TESession* se = new TESession(this, te, se_pgm, se_args, "xterm"); |
604 | te->currentSession = se; | 608 | te->currentSession = se; |
605 | connect( se, SIGNAL(done(TESession*,int)), this, SLOT(doneSession(TESession*,int)) ); | 609 | connect( se, SIGNAL(done(TESession*,int)), this, SLOT(doneSession(TESession*,int)) ); |
606 | se->run(); | 610 | se->run(); |
607 | se->setConnect(TRUE); | 611 | se->setConnect(TRUE); |
608 | se->setHistory(b_scroll); | 612 | se->setHistory(b_scroll); |
609 | tab->setCurrentPage(nsessions); | 613 | tab->setCurrentPage(nsessions); |
610 | nsessions++; | 614 | nsessions++; |
611 | setColor(); | 615 | doWrap(); |
616 | setColor(); | ||
612 | } | 617 | } |
613 | } | 618 | } |
614 | 619 | ||
615 | TEWidget* Konsole::getTe() { | 620 | TEWidget* Konsole::getTe() { |
@@ -772,10 +777,10 @@ void Konsole::colorMenuSelected(int iD) | |||
772 | } | 777 | } |
773 | 778 | ||
774 | void Konsole::configMenuSelected(int iD) | 779 | void Konsole::configMenuSelected(int iD) |
775 | { | 780 | { |
776 | // QString temp; | 781 | QString temp; |
777 | // qDebug( temp.sprintf("configmenu %d",iD)); | 782 | qDebug( temp.sprintf("configmenu %d",iD)); |
778 | TEWidget* te = getTe(); | 783 | TEWidget* te = getTe(); |
779 | Config cfg("Konsole"); | 784 | Config cfg("Konsole"); |
780 | cfg.setGroup("Menubar"); | 785 | cfg.setGroup("Menubar"); |
781 | if( iD == -4) { | 786 | if( iD == -4) { |
@@ -791,8 +796,22 @@ void Konsole::configMenuSelected(int iD) | |||
791 | configMenu->changeItem( iD,"Tabs on Bottom"); | 796 | configMenu->changeItem( iD,"Tabs on Bottom"); |
792 | cfg.writeEntry("Position","Top"); | 797 | cfg.writeEntry("Position","Top"); |
793 | } | 798 | } |
794 | } | 799 | } |
800 | if( iD == -29) { | ||
801 | cfg.setGroup("ScrollBar"); | ||
802 | bool b=cfg.readBoolEntry("HorzScroll",0); | ||
803 | b=!b; | ||
804 | cfg.writeEntry("HorzScroll", b ); | ||
805 | cfg.write(); | ||
806 | doWrap(); | ||
807 | if(cfg.readNumEntry("Position",2) == 0) { | ||
808 | te->setScrollbarLocation(1); | ||
809 | } else { | ||
810 | te->setScrollbarLocation(0); | ||
811 | } | ||
812 | te->setScrollbarLocation( cfg.readNumEntry("Position",2)); | ||
813 | } | ||
795 | } | 814 | } |
796 | 815 | ||
797 | void Konsole::changeCommand(const QString &text, int c) | 816 | void Konsole::changeCommand(const QString &text, int c) |
798 | { | 817 | { |
@@ -831,22 +850,23 @@ void Konsole::scrollMenuSelected(int index) | |||
831 | case -27: | 850 | case -27: |
832 | te->setScrollbarLocation(2); | 851 | te->setScrollbarLocation(2); |
833 | cfg.writeEntry("Position",2); | 852 | cfg.writeEntry("Position",2); |
834 | break; | 853 | break; |
835 | case -29: { | 854 | // case -29: { |
836 | bool b=cfg.readBoolEntry("HorzScroll",0); | 855 | // bool b=cfg.readBoolEntry("HorzScroll",0); |
837 | cfg.writeEntry("HorzScroll", !b ); | 856 | // cfg.writeEntry("HorzScroll", !b ); |
838 | cfg.write(); | 857 | // cfg.write(); |
839 | if(cfg.readNumEntry("Position",2) == 0) | 858 | // if(cfg.readNumEntry("Position",2) == 0) { |
840 | te->setScrollbarLocation(1); | 859 | // te->setScrollbarLocation(1); |
841 | else | 860 | // te->setWrapAt(0); |
842 | te->setScrollbarLocation(0); | 861 | // } else { |
843 | te->setScrollbarLocation( cfg.readNumEntry("Position",2)); | 862 | // te->setScrollbarLocation(0); |
844 | te->setWrapAt(120); | 863 | // te->setWrapAt(120); |
845 | } | 864 | // } |
846 | break; | 865 | // te->setScrollbarLocation( cfg.readNumEntry("Position",2)); |
866 | // } | ||
867 | // break; | ||
847 | }; | 868 | }; |
848 | |||
849 | } | 869 | } |
850 | 870 | ||
851 | void Konsole::editCommandListMenuSelected(int iD) | 871 | void Konsole::editCommandListMenuSelected(int iD) |
852 | { | 872 | { |
@@ -970,4 +990,18 @@ void Konsole::changeBackgroundColor(const QColor &color) { | |||
970 | // colors.sprintf("%d,%d,%d"color.red,color.green,color.blue); | 990 | // colors.sprintf("%d,%d,%d"color.red,color.green,color.blue); |
971 | cfg.writeEntry("background",color.name()); | 991 | cfg.writeEntry("background",color.name()); |
972 | cfg.write(); | 992 | cfg.write(); |
973 | } | 993 | } |
994 | |||
995 | void Konsole::doWrap() { | ||
996 | Config cfg("Konsole"); | ||
997 | cfg.setGroup("ScrollBar"); | ||
998 | TEWidget* te = getTe(); | ||
999 | if( !cfg.readBoolEntry("HorzScroll",0)) { | ||
1000 | te->setWrapAt(0); | ||
1001 | configMenu->setItemChecked(-29,FALSE); | ||
1002 | } else { | ||
1003 | te->setWrapAt(90); | ||
1004 | // te->setWrapAt(120); | ||
1005 | configMenu->setItemChecked(-29,TRUE); | ||
1006 | } | ||
1007 | } | ||
diff --git a/core/apps/embeddedkonsole/konsole.h b/core/apps/embeddedkonsole/konsole.h index 0bf3fb3..4938159 100644 --- a/core/apps/embeddedkonsole/konsole.h +++ b/core/apps/embeddedkonsole/konsole.h | |||
@@ -80,8 +80,9 @@ private slots: | |||
80 | void parseCommandLine(); | 80 | void parseCommandLine(); |
81 | void changeForegroundColor(const QColor &); | 81 | void changeForegroundColor(const QColor &); |
82 | void changeBackgroundColor(const QColor &); | 82 | void changeBackgroundColor(const QColor &); |
83 | private: | 83 | private: |
84 | void doWrap(); | ||
84 | void init(const char* _pgm, QStrList & _args); | 85 | void init(const char* _pgm, QStrList & _args); |
85 | void initSession(const char* _pgm, QStrList & _args); | 86 | void initSession(const char* _pgm, QStrList & _args); |
86 | void runSession(TESession* s); | 87 | void runSession(TESession* s); |
87 | void setColorPixmaps(); | 88 | void setColorPixmaps(); |