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.cpp31
1 files changed, 30 insertions, 1 deletions
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
@@ -215,25 +215,26 @@ void Konsole::init(const char* _pgm, QStrList & _args)
QPEMenuBar *menuBar = new QPEMenuBar( menuToolBar );
fontList = new QPopupMenu( this );
for(uint i = 0; i < fonts.count(); i++) {
VTFont *fnt = fonts.at(i);
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 {
configMenu->insertItem("Hide command list");
listHidden=FALSE;
}
cfg.setGroup("Tabs");
tmp=cfg.readEntry("Position","Bottom");
@@ -254,24 +255,25 @@ void Konsole::init(const char* _pgm, QStrList & _args)
colorMenu->insertItem("Red on Black");
colorMenu->insertItem("Green on Yellow");
colorMenu->insertItem("Blue on Magenta");
colorMenu->insertItem("Magenta on Blue");
colorMenu->insertItem("Cyan on White");
colorMenu->insertItem("White on Cyan");
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 );
QAction *a;
// Button Commands
a = new QAction( tr("New"), Resource::loadPixmap( "konsole" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( newSession() ) ); a->addTo( toolbar );
a = new QAction( tr("Enter"), Resource::loadPixmap( "konsole/enter" ), QString::null, 0, this, 0 );
@@ -307,24 +309,29 @@ void Konsole::init(const char* _pgm, QStrList & _args)
cfg.setGroup("Commands");
commonCombo->setInsertionPolicy(QComboBox::AtCurrent);
for (int i = 0; commonCmds[i] != NULL; i++) {
commonCombo->insertItem( commonCmds[i], i );
tmp = cfg.readEntry( QString::number(i),"");
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++)
{ KeyTrans* s = KeyTrans::find(i);
assert( s );
}
se_pgm = _pgm;
se_args = _args;
@@ -754,12 +761,34 @@ void Konsole::changeCommand(const QString &text, int c)
commonCombo->setCurrentItem(c);
}
}
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;
+ };
+
+}