summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-02-03 15:33:27 (UTC)
committer llornkcor <llornkcor>2002-02-03 15:33:27 (UTC)
commitb7426bf997b8201667cecb0f66470e257b35ba60 (patch) (unidiff)
tree69ac9d9afd7be78aa7e421e0ee103d4eeec5138f
parenta80b4c11934b93b3d067f812a68452617f202e61 (diff)
downloadopie-b7426bf997b8201667cecb0f66470e257b35ba60.zip
opie-b7426bf997b8201667cecb0f66470e257b35ba60.tar.gz
opie-b7426bf997b8201667cecb0f66470e257b35ba60.tar.bz2
re-introduced vert scrollbar, with position options
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
@@ -50,6 +50,7 @@
50// #include "config.h" 50// #include "config.h"
51#include "TEWidget.h" 51#include "TEWidget.h"
52#include "session.h" 52#include "session.h"
53#include <qpe/config.h>
53 54
54#include <qcursor.h> 55#include <qcursor.h>
55#include <qregexp.h> 56#include <qregexp.h>
@@ -152,7 +153,7 @@ const QPixmap *TEWidget::backgroundPixmap()
152void TEWidget::setColorTable(const ColorEntry table[]) 153void TEWidget::setColorTable(const ColorEntry table[])
153{ 154{
154 for (int i = 0; i < TABLE_COLORS; i++) color_table[i] = table[i]; 155 for (int i = 0; i < TABLE_COLORS; i++) color_table[i] = table[i];
155 156
156 const QPixmap* pm = backgroundPixmap(); 157 const QPixmap* pm = backgroundPixmap();
157 if (!pm) setBackgroundColor(color_table[DEFAULT_BACK_COLOR].color); 158 if (!pm) setBackgroundColor(color_table[DEFAULT_BACK_COLOR].color);
158 update(); 159 update();
@@ -285,7 +286,20 @@ TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name)
285 scrollbar = new QScrollBar(this); 286 scrollbar = new QScrollBar(this);
286 scrollbar->setCursor( arrowCursor ); 287 scrollbar->setCursor( arrowCursor );
287 connect(scrollbar, SIGNAL(valueChanged(int)), this, SLOT(scrollChanged(int))); 288 connect(scrollbar, SIGNAL(valueChanged(int)), this, SLOT(scrollChanged(int)));
288 scrollLoc = SCRNONE; 289
290 Config cfg("Konsole");
291 cfg.setGroup("ScrollBar");
292 switch( cfg.readNumEntry("Position",2)){
293 case 0:
294 scrollLoc = SCRNONE;
295 break;
296 case 1:
297 scrollLoc = SCRLEFT;
298 break;
299 case 2:
300 scrollLoc = SCRRIGHT;
301 break;
302 };
289 303
290 blinkT = new QTimer(this); 304 blinkT = new QTimer(this);
291 connect(blinkT, SIGNAL(timeout()), this, SLOT(blinkEvent())); 305 connect(blinkT, SIGNAL(timeout()), this, SLOT(blinkEvent()));
@@ -651,7 +665,7 @@ void TEWidget::mousePressEvent(QMouseEvent* ev)
651 emit clearSelectionSignal(); 665 emit clearSelectionSignal();
652 iPntSel = pntSel = pos; 666 iPntSel = pntSel = pos;
653 actSel = 1; // left mouse button pressed but nothing selected yet. 667 actSel = 1; // left mouse button pressed but nothing selected yet.
654 grabMouse( /*crossCursor*/ ); // handle with care! 668 grabMouse( /*crossCursor*/ ); // handle with care!
655 } 669 }
656 else 670 else
657 { 671 {
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,7 +224,8 @@ void Konsole::init(const char* _pgm, QStrList & _args)
224 224
225 configMenu = new QPopupMenu( this); 225 configMenu = new QPopupMenu( this);
226 colorMenu = new QPopupMenu( this); 226 colorMenu = new QPopupMenu( this);
227 227 scrollMenu = new QPopupMenu( this);
228
228 bool listHidden; 229 bool listHidden;
229 cfg.setGroup("Menubar"); 230 cfg.setGroup("Menubar");
230 if( cfg.readEntry("Hidden","FALSE") == "TRUE") { 231 if( cfg.readEntry("Hidden","FALSE") == "TRUE") {
@@ -263,6 +264,7 @@ void Konsole::init(const char* _pgm, QStrList & _args)
263 connect( fontList, SIGNAL( activated(int) ), this, SLOT( fontChanged(int) )); 264 connect( fontList, SIGNAL( activated(int) ), this, SLOT( fontChanged(int) ));
264 connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) )); 265 connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) ));
265 connect( colorMenu, SIGNAL( activated(int) ), this, SLOT( colorMenuSelected(int) )); 266 connect( colorMenu, SIGNAL( activated(int) ), this, SLOT( colorMenuSelected(int) ));
267 connect( scrollMenu, SIGNAL(activated(int)),this,SLOT(scrollMenuSelected(int)));
266 268
267 menuBar->insertItem( tr("Font"), fontList ); 269 menuBar->insertItem( tr("Font"), fontList );
268 menuBar->insertItem( tr("Options"), configMenu ); 270 menuBar->insertItem( tr("Options"), configMenu );
@@ -316,6 +318,11 @@ void Konsole::init(const char* _pgm, QStrList & _args)
316 318
317 connect( commonCombo, SIGNAL( activated(int) ), this, SLOT( enterCommand(int) )); 319 connect( commonCombo, SIGNAL( activated(int) ), this, SLOT( enterCommand(int) ));
318 320
321 scrollMenu->insertItem("None");
322 scrollMenu->insertItem("Left");
323 scrollMenu->insertItem("Right");
324 configMenu->insertItem("ScrollBar",scrollMenu);
325
319 // create applications ///////////////////////////////////////////////////// 326 // create applications /////////////////////////////////////////////////////
320 setCentralWidget(tab); 327 setCentralWidget(tab);
321 328
@@ -763,3 +770,25 @@ void Konsole::setColor()
763 if(scheme != 1) colorMenuSelected( -scheme); 770 if(scheme != 1) colorMenuSelected( -scheme);
764 771
765} 772}
773
774void Konsole::scrollMenuSelected(int index)
775{
776 TEWidget* te = getTe();
777Config cfg("Konsole");
778 cfg.setGroup("Scrollbar");
779 switch( index){
780 case -21:
781 te->setScrollbarLocation(0);
782 cfg.writeEntry("Position",0);
783 break;
784 case -22:
785 te->setScrollbarLocation(1);
786 cfg.writeEntry("Position",1);
787 break;
788 case -23:
789 te->setScrollbarLocation(2);
790 cfg.writeEntry("Position",2);
791 break;
792 };
793
794}
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:
70 void switchSession(QWidget *); 70 void switchSession(QWidget *);
71 void newSession(); 71 void newSession();
72 void changeCommand(const QString &, int); 72 void changeCommand(const QString &, int);
73 73 void scrollMenuSelected(int);
74private: 74private:
75 void init(const char* _pgm, QStrList & _args); 75 void init(const char* _pgm, QStrList & _args);
76 void initSession(const char* _pgm, QStrList & _args); 76 void initSession(const char* _pgm, QStrList & _args);
@@ -112,7 +112,7 @@ private:
112 QCString se_pgm; 112 QCString se_pgm;
113 QStrList se_args; 113 QStrList se_args;
114 114
115 QPopupMenu* fontList,*configMenu,*colorMenu; 115 QPopupMenu* fontList,*configMenu,*colorMenu,*scrollMenu;
116 QComboBox *commonCombo; 116 QComboBox *commonCombo;
117 // history scrolling I think 117 // history scrolling I think
118 bool b_scroll; 118 bool b_scroll;