summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/TEWidget.cpp20
-rw-r--r--core/apps/embeddedkonsole/konsole.cpp31
-rw-r--r--core/apps/embeddedkonsole/konsole.h4
3 files changed, 49 insertions, 6 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
@@ -47,12 +47,13 @@
- set different 'rounding' styles? I.e. have a mode to show clipped chars?
*/
// #include "config.h"
#include "TEWidget.h"
#include "session.h"
+#include <qpe/config.h>
#include <qcursor.h>
#include <qregexp.h>
#include <qpainter.h>
#include <qclipboard.h>
#include <qstyle.h>
@@ -149,13 +150,13 @@ const QPixmap *TEWidget::backgroundPixmap()
return pm;
}
void TEWidget::setColorTable(const ColorEntry table[])
{
for (int i = 0; i < TABLE_COLORS; i++) color_table[i] = table[i];
-
+
const QPixmap* pm = backgroundPixmap();
if (!pm) setBackgroundColor(color_table[DEFAULT_BACK_COLOR].color);
update();
}
//FIXME: add backgroundPixmapChanged.
@@ -282,13 +283,26 @@ TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name)
this, SLOT(onClearSelection()) );
#endif
scrollbar = new QScrollBar(this);
scrollbar->setCursor( arrowCursor );
connect(scrollbar, SIGNAL(valueChanged(int)), this, SLOT(scrollChanged(int)));
- scrollLoc = SCRNONE;
+
+ 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()));
// blinking = FALSE;
blinking = TRUE;
@@ -648,13 +662,13 @@ void TEWidget::mousePressEvent(QMouseEvent* ev)
if (mouse_marks || (ev->state() & ShiftButton))
{
emit clearSelectionSignal();
iPntSel = pntSel = pos;
actSel = 1; // left mouse button pressed but nothing selected yet.
- grabMouse( /*crossCursor*/ ); // handle with care!
+ grabMouse( /*crossCursor*/ ); // handle with care!
}
else
{
emit mouseSignal( 0, pos.x() + 1, pos.y() + 1 ); // left button
}
}
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
@@ -221,13 +221,14 @@ void Konsole::init(const char* _pgm, QStrList & _args)
fontList->insertItem(fnt->getName(), i);
}
fontChanged(cfont);
configMenu = new QPopupMenu( this);
colorMenu = new QPopupMenu( this);
-
+ scrollMenu = new QPopupMenu( this);
+
bool listHidden;
cfg.setGroup("Menubar");
if( cfg.readEntry("Hidden","FALSE") == "TRUE") {
configMenu->insertItem("Show command list");
listHidden=TRUE;
} else {
@@ -260,12 +261,13 @@ void Konsole::init(const char* _pgm, QStrList & _args)
colorMenu->insertItem("Blue on Black");
configMenu->insertItem("Colors",colorMenu);
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 );
QPEToolBar *toolbar = new QPEToolBar( this );
@@ -313,12 +315,17 @@ void Konsole::init(const char* _pgm, QStrList & _args)
if(tmp != "")
commonCombo->changeItem( tmp,i );
}
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);
// load keymaps ////////////////////////////////////////////////////////////
KeyTrans::loadAll();
for (int i = 0; i < KeyTrans::count(); i++)
@@ -760,6 +767,28 @@ void Konsole::setColor()
Config cfg("Konsole");
cfg.setGroup("Colors");
int scheme = cfg.readNumEntry("Schema",1);
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
@@ -67,13 +67,13 @@ private slots:
void hitPaste();
void hitUp();
void hitDown();
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);
void runSession(TESession* s);
void setColorPixmaps();
void setHistory(bool);
@@ -109,13 +109,13 @@ private:
int nsessions;
QList<VTFont> fonts;
int cfont;
QCString se_pgm;
QStrList se_args;
- QPopupMenu* fontList,*configMenu,*colorMenu;
+ QPopupMenu* fontList,*configMenu,*colorMenu,*scrollMenu;
QComboBox *commonCombo;
// history scrolling I think
bool b_scroll;
int n_keytab;
int n_scroll;