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.cpp34
1 files changed, 30 insertions, 4 deletions
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp
index a8ddc99..3c87ad4 100644
--- a/core/apps/embeddedkonsole/konsole.cpp
+++ b/core/apps/embeddedkonsole/konsole.cpp
@@ -349,39 +349,51 @@ void Konsole::init(const char* _pgm, QStrList & _args)
// 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(tr( "None" ));
scrollMenu->insertItem(tr( "Left" ));
scrollMenu->insertItem(tr( "Right" ));
+ scrollMenu->insertSeparator(4);
+ scrollMenu->insertItem(tr( "Horizontal" ));
+
configMenu->insertItem(tr( "ScrollBar" ),scrollMenu);
-
+//scrollMenuSelected(-29);
+// cfg.setGroup("ScrollBar");
+// if(cfg.readBoolEntry("HorzScroll",0)) {
+// if(cfg.readNumEntry("Position",2) == 0)
+// te->setScrollbarLocation(1);
+// else
+// te->setScrollbarLocation(0);
+// te->setScrollbarLocation( cfg.readNumEntry("Position",2));
+// te->setWrapAt(120);
+// }
// 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;
-
+ se_args.prepend("--login");
parseCommandLine();
// read and apply default values ///////////////////////////////////////////
resize(321, 321); // Dummy.
QSize currentSize = size();
if (currentSize != size())
defaultSize = size();
}
void Konsole::show()
{
if ( !nsessions ) {
newSession();
@@ -499,24 +511,26 @@ QSize Konsole::calcSize(int columns, int lines) {
QSize size;
return size;
}
}
/**
sets application window to a size based on columns X lines of the te
guest widget. Call with (0,0) for setting default size.
*/
void Konsole::setColLin(int columns, int lines)
{
+ qDebug("konsole::setColLin:: Columns %d", columns);
+
if ((columns==0) || (lines==0))
{
if (defaultSize.isEmpty()) // not in config file : set default value
{
defaultSize = calcSize(80,24);
// notifySize(24,80); // set menu items (strange arg order !)
}
resize(defaultSize);
} else {
resize(calcSize(columns, lines));
// notifySize(lines,columns); // set menu items (strange arg order !)
}
@@ -543,24 +557,25 @@ void Konsole::setFont(int fontno)
return;
}
if (se) se->setFontNo(fontno);
te->setVTFont(f);
n_font = fontno;
}
*/
// --| color selection |-------------------------------------------------------
void Konsole::changeColumns(int columns)
{
+ qDebug("change columns");
TEWidget* te = getTe();
if (te != 0) {
setColLin(columns,te->Lines());
te->update();
}
}
//FIXME: If a child dies during session swap,
// this routine might be called before
// session swap is completed.
void Konsole::doneSession(TESession*, int )
@@ -791,42 +806,53 @@ void Konsole::changeCommand(const QString &text, int 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)
{
-// QString temp;
-// qDebug( temp.sprintf("scrollbar menu %d",index));
+ qDebug( "scrollbar menu %d",index);
TEWidget* te = getTe();
Config cfg("Konsole");
cfg.setGroup("ScrollBar");
switch( index){
case -25:
te->setScrollbarLocation(0);
cfg.writeEntry("Position",0);
break;
case -26:
te->setScrollbarLocation(1);
cfg.writeEntry("Position",1);
break;
case -27:
te->setScrollbarLocation(2);
cfg.writeEntry("Position",2);
break;
+ case -29: {
+ bool b=cfg.readBoolEntry("HorzScroll",0);
+ cfg.writeEntry("HorzScroll", !b );
+ cfg.write();
+ if(cfg.readNumEntry("Position",2) == 0)
+ te->setScrollbarLocation(1);
+ else
+ te->setScrollbarLocation(0);
+ te->setScrollbarLocation( cfg.readNumEntry("Position",2));
+ te->setWrapAt(120);
+ }
+ break;
};
}
void Konsole::editCommandListMenuSelected(int iD)
{
// QString temp;
// qDebug( temp.sprintf("edit command list %d",iD));
TEWidget* te = getTe();
Config cfg("Konsole");
cfg.setGroup("Menubar");
if( iD == -3) {