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 /core/apps/embeddedkonsole/konsole.cpp | |
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
Diffstat (limited to 'core/apps/embeddedkonsole/konsole.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/apps/embeddedkonsole/konsole.cpp | 90 |
1 files changed, 62 insertions, 28 deletions
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 | |||
@@ -360,6 +360,9 @@ void Konsole::init(const char* _pgm, QStrList & _args) | |||
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); |
@@ -401,2 +404,3 @@ void Konsole::show() | |||
401 | QMainWindow::show(); | 404 | QMainWindow::show(); |
405 | |||
402 | } | 406 | } |
@@ -600,13 +604,14 @@ void Konsole::newSession() { | |||
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 | } |
@@ -775,4 +780,4 @@ 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(); |
@@ -794,2 +799,16 @@ void Konsole::configMenuSelected(int iD) | |||
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 | } |
@@ -834,16 +853,17 @@ void Konsole::scrollMenuSelected(int index) | |||
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 | } |
@@ -973 +993,15 @@ void Konsole::changeBackgroundColor(const QColor &color) { | |||
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 | } | ||