summaryrefslogtreecommitdiff
path: root/core/apps/embeddedkonsole/konsole.cpp
Side-by-side diff
Diffstat (limited to 'core/apps/embeddedkonsole/konsole.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/konsole.cpp90
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)
scrollMenu->insertItem(tr( "Right" ));
- scrollMenu->insertSeparator(4);
- scrollMenu->insertItem(tr( "Horizontal" ));
+// scrollMenu->insertSeparator(4);
+// scrollMenu->insertItem(tr( "Horizontal" ));
configMenu->insertItem(tr( "ScrollBar" ),scrollMenu);
+
+ configMenu->insertItem(tr( "Wrap" ));
+
//scrollMenuSelected(-29);
@@ -401,2 +404,3 @@ void Konsole::show()
QMainWindow::show();
+
}
@@ -600,13 +604,14 @@ void Konsole::newSession() {
// te->setBackgroundMode(PaletteBase); //we want transparent!!
- te->setVTFont(fonts.at(cfont)->getFont());
- tab->addTab(te);
- TESession* se = new TESession(this, te, se_pgm, se_args, "xterm");
- te->currentSession = se;
- connect( se, SIGNAL(done(TESession*,int)), this, SLOT(doneSession(TESession*,int)) );
- se->run();
- se->setConnect(TRUE);
- se->setHistory(b_scroll);
- tab->setCurrentPage(nsessions);
- nsessions++;
- setColor();
+ te->setVTFont(fonts.at(cfont)->getFont());
+ tab->addTab(te);
+ TESession* se = new TESession(this, te, se_pgm, se_args, "xterm");
+ te->currentSession = se;
+ connect( se, SIGNAL(done(TESession*,int)), this, SLOT(doneSession(TESession*,int)) );
+ se->run();
+ se->setConnect(TRUE);
+ se->setHistory(b_scroll);
+ tab->setCurrentPage(nsessions);
+ nsessions++;
+ doWrap();
+ setColor();
}
@@ -775,4 +780,4 @@ void Konsole::configMenuSelected(int iD)
{
-// QString temp;
-// qDebug( temp.sprintf("configmenu %d",iD));
+ QString temp;
+ qDebug( temp.sprintf("configmenu %d",iD));
TEWidget* te = getTe();
@@ -794,2 +799,16 @@ void Konsole::configMenuSelected(int iD)
}
+ if( iD == -29) {
+ cfg.setGroup("ScrollBar");
+ bool b=cfg.readBoolEntry("HorzScroll",0);
+ b=!b;
+ cfg.writeEntry("HorzScroll", b );
+ cfg.write();
+ doWrap();
+ if(cfg.readNumEntry("Position",2) == 0) {
+ te->setScrollbarLocation(1);
+ } else {
+ te->setScrollbarLocation(0);
+ }
+ te->setScrollbarLocation( cfg.readNumEntry("Position",2));
+ }
}
@@ -834,16 +853,17 @@ void Konsole::scrollMenuSelected(int index)
break;
- case -29: {
- bool b=cfg.readBoolEntry("HorzScroll",0);
- cfg.writeEntry("HorzScroll", !b );
- cfg.write();
- if(cfg.readNumEntry("Position",2) == 0)
- te->setScrollbarLocation(1);
- else
- te->setScrollbarLocation(0);
- te->setScrollbarLocation( cfg.readNumEntry("Position",2));
- te->setWrapAt(120);
- }
- break;
+// case -29: {
+// bool b=cfg.readBoolEntry("HorzScroll",0);
+// cfg.writeEntry("HorzScroll", !b );
+// cfg.write();
+// if(cfg.readNumEntry("Position",2) == 0) {
+// te->setScrollbarLocation(1);
+// te->setWrapAt(0);
+// } else {
+// te->setScrollbarLocation(0);
+// te->setWrapAt(120);
+// }
+// te->setScrollbarLocation( cfg.readNumEntry("Position",2));
+// }
+// break;
};
-
}
@@ -973 +993,15 @@ void Konsole::changeBackgroundColor(const QColor &color) {
}
+
+void Konsole::doWrap() {
+ Config cfg("Konsole");
+ cfg.setGroup("ScrollBar");
+ TEWidget* te = getTe();
+ if( !cfg.readBoolEntry("HorzScroll",0)) {
+ te->setWrapAt(0);
+ configMenu->setItemChecked(-29,FALSE);
+ } else {
+ te->setWrapAt(90);
+// te->setWrapAt(120);
+ configMenu->setItemChecked(-29,TRUE);
+ }
+}