author | llornkcor <llornkcor> | 2002-02-03 15:33:27 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-02-03 15:33:27 (UTC) |
commit | b7426bf997b8201667cecb0f66470e257b35ba60 (patch) (unidiff) | |
tree | 69ac9d9afd7be78aa7e421e0ee103d4eeec5138f | |
parent | a80b4c11934b93b3d067f812a68452617f202e61 (diff) | |
download | opie-b7426bf997b8201667cecb0f66470e257b35ba60.zip opie-b7426bf997b8201667cecb0f66470e257b35ba60.tar.gz opie-b7426bf997b8201667cecb0f66470e257b35ba60.tar.bz2 |
re-introduced vert scrollbar, with position options
-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 @@ | |||
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> |
@@ -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))); |
289 | |||
290 | Config cfg("Konsole"); | ||
291 | cfg.setGroup("ScrollBar"); | ||
292 | switch( cfg.readNumEntry("Position",2)){ | ||
293 | case 0: | ||
288 | scrollLoc = SCRNONE; | 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())); |
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) | |||
224 | 224 | ||
225 | configMenu = new QPopupMenu( this); | 225 | configMenu = new QPopupMenu( this); |
226 | colorMenu = new QPopupMenu( this); | 226 | colorMenu = new QPopupMenu( this); |
227 | scrollMenu = new QPopupMenu( this); | ||
227 | 228 | ||
228 | bool listHidden; | 229 | bool listHidden; |
229 | cfg.setGroup("Menubar"); | 230 | cfg.setGroup("Menubar"); |
@@ -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 | |||
774 | void Konsole::scrollMenuSelected(int index) | ||
775 | { | ||
776 | TEWidget* te = getTe(); | ||
777 | Config 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); | |
74 | private: | 74 | private: |
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; |