-rw-r--r-- | core/apps/embeddedkonsole/TEWidget.cpp | 14 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/konsole.cpp | 29 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/konsole.h | 4 |
3 files changed, 45 insertions, 2 deletions
diff --git a/core/apps/embeddedkonsole/TEWidget.cpp b/core/apps/embeddedkonsole/TEWidget.cpp index f10bfb2..a56dc50 100644 --- a/core/apps/embeddedkonsole/TEWidget.cpp +++ b/core/apps/embeddedkonsole/TEWidget.cpp @@ -50,6 +50,7 @@ // #include "config.h" #include "TEWidget.h" #include "session.h" +#include <qpe/config.h> #include <qcursor.h> #include <qregexp.h> @@ -285,7 +286,20 @@ TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name) scrollbar = new QScrollBar(this); scrollbar->setCursor( arrowCursor ); connect(scrollbar, SIGNAL(valueChanged(int)), this, SLOT(scrollChanged(int))); + + Config cfg("Konsole"); + cfg.setGroup("ScrollBar"); + switch( cfg.readNumEntry("Position",2)){ + case 0: scrollLoc = SCRNONE; + break; + case 1: + scrollLoc = SCRLEFT; + break; + case 2: + scrollLoc = SCRRIGHT; + break; + }; blinkT = new QTimer(this); connect(blinkT, SIGNAL(timeout()), this, SLOT(blinkEvent())); diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp index d54fa1f..e2d4886 100644 --- a/core/apps/embeddedkonsole/konsole.cpp +++ b/core/apps/embeddedkonsole/konsole.cpp @@ -224,6 +224,7 @@ void Konsole::init(const char* _pgm, QStrList & _args) configMenu = new QPopupMenu( this); colorMenu = new QPopupMenu( this); + scrollMenu = new QPopupMenu( this); bool listHidden; cfg.setGroup("Menubar"); @@ -263,6 +264,7 @@ void Konsole::init(const char* _pgm, QStrList & _args) connect( fontList, SIGNAL( activated(int) ), this, SLOT( fontChanged(int) )); connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) )); connect( colorMenu, SIGNAL( activated(int) ), this, SLOT( colorMenuSelected(int) )); + connect( scrollMenu, SIGNAL(activated(int)),this,SLOT(scrollMenuSelected(int))); menuBar->insertItem( tr("Font"), fontList ); menuBar->insertItem( tr("Options"), configMenu ); @@ -316,6 +318,11 @@ void Konsole::init(const char* _pgm, QStrList & _args) connect( commonCombo, SIGNAL( activated(int) ), this, SLOT( enterCommand(int) )); + scrollMenu->insertItem("None"); + scrollMenu->insertItem("Left"); + scrollMenu->insertItem("Right"); + configMenu->insertItem("ScrollBar",scrollMenu); + // create applications ///////////////////////////////////////////////////// setCentralWidget(tab); @@ -763,3 +770,25 @@ void Konsole::setColor() if(scheme != 1) colorMenuSelected( -scheme); } + +void Konsole::scrollMenuSelected(int index) +{ + TEWidget* te = getTe(); +Config cfg("Konsole"); + cfg.setGroup("Scrollbar"); + switch( index){ + case -21: + te->setScrollbarLocation(0); + cfg.writeEntry("Position",0); + break; + case -22: + te->setScrollbarLocation(1); + cfg.writeEntry("Position",1); + break; + case -23: + te->setScrollbarLocation(2); + cfg.writeEntry("Position",2); + break; + }; + +} diff --git a/core/apps/embeddedkonsole/konsole.h b/core/apps/embeddedkonsole/konsole.h index 40003d4..b4e5d87 100644 --- a/core/apps/embeddedkonsole/konsole.h +++ b/core/apps/embeddedkonsole/konsole.h @@ -70,7 +70,7 @@ private slots: void switchSession(QWidget *); void newSession(); void changeCommand(const QString &, int); - + void scrollMenuSelected(int); private: void init(const char* _pgm, QStrList & _args); void initSession(const char* _pgm, QStrList & _args); @@ -112,7 +112,7 @@ private: QCString se_pgm; QStrList se_args; - QPopupMenu* fontList,*configMenu,*colorMenu; + QPopupMenu* fontList,*configMenu,*colorMenu,*scrollMenu; QComboBox *commonCombo; // history scrolling I think bool b_scroll; |