-rw-r--r-- | core/apps/embeddedkonsole/konsole.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp index f154bb8..653652a 100644 --- a/core/apps/embeddedkonsole/konsole.cpp +++ b/core/apps/embeddedkonsole/konsole.cpp @@ -282,39 +282,39 @@ void Konsole::init(const char* _pgm, QStrList & _args) connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolbar ); a = new QAction( tr("Down"), Resource::loadPixmap( "konsole/down" ), QString::null, 0, this, 0 ); connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolbar ); a = new QAction( tr("Paste"), Resource::loadPixmap( "paste" ), QString::null, 0, this, 0 ); connect( a, SIGNAL( activated() ), this, SLOT( hitPaste() ) ); a->addTo( toolbar ); /* a = new QAction( tr("Up"), Resource::loadPixmap( "up" ), QString::null, 0, this, 0 ); connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolbar ); a = new QAction( tr("Down"), Resource::loadPixmap( "down" ), QString::null, 0, this, 0 ); connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolbar ); */ secondToolBar = new QPEToolBar( this ); secondToolBar->setHorizontalStretchable( TRUE ); commonCombo = new QComboBox( secondToolBar ); - + commonCombo->setMaximumWidth(236); configMenu->insertItem( "Edit Command List"); if( listHidden) { secondToolBar->hide(); configMenu->setItemEnabled(-20 ,FALSE); } - + 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) )); // create applications ///////////////////////////////////////////////////// setCentralWidget(tab); // load keymaps //////////////////////////////////////////////////////////// @@ -372,33 +372,33 @@ void Konsole::fontChanged(int f) TEWidget* te = getTe(); if (te != 0) { te->setVTFont(font->getFont()); } } } void Konsole::enterCommand(int c) { TEWidget* te = getTe(); if (te != 0) { if(!commonCombo->editable()) { QString text = commonCombo->text(c); //commonCmds[c]; te->emitText(text); } else { - changeCommand( commonCombo->text(c), c); + changeCommand( commonCombo->text(c), c); } } } void Konsole::hitEnter() { TEWidget* te = getTe(); if (te != 0) { te->emitText(QString("\r")); } } void Konsole::hitSpace() { TEWidget* te = getTe(); if (te != 0) { @@ -564,34 +564,33 @@ void Konsole::switchSession(QWidget* w) { QFont teFnt = te->getVTFont(); for(uint i = 0; i < fonts.count(); i++) { VTFont *fnt = fonts.at(i); bool cf = fnt->getFont() == teFnt; fontList->setItemChecked(i, cf); if (cf) { cfont = i; } } } /// ------------------------------- some new stuff by L.J. Potter void Konsole::colorMenuSelected(int iD) { // this is NOT pretty, elegant or anything else besides functional // QString temp; -// temp.sprintf("%d", iD); -// qDebug(temp); +// qDebug( temp.sprintf("%d", iD)); TEWidget* te = getTe(); Config cfg("Konsole"); cfg.setGroup("Colors"); QColor foreground; QColor background; colorMenu->setItemChecked(lastSelectedMenu,FALSE); ColorEntry m_table[TABLE_COLORS]; const ColorEntry * defaultCt=te->getdefaultColorTable(); /////////// fore back int i; if(iD==-8) { // default default for (i = 0; i < TABLE_COLORS; i++) { m_table[i].color = defaultCt[i].color; if(i==1 || i == 11) m_table[i].transparent=1; cfg.writeEntry("Schema","8"); @@ -672,35 +671,34 @@ void Konsole::colorMenuSelected(int iD) m_table[i].color = foreground; } else if(i==1 || i == 11) { m_table[i].color = background; m_table[i].transparent=0; } else m_table[i].color = defaultCt[i].color; } } lastSelectedMenu = iD; te->setColorTable(m_table); update(); } void Konsole::configMenuSelected(int iD) { -// QString temp; -// temp.sprintf("%d",iD); -// qDebug(temp); + QString temp; + qDebug( temp.sprintf("%d",iD)); TEWidget* te = getTe(); Config cfg("Konsole"); cfg.setGroup("Menubar"); if( iD == -2) { if(!secondToolBar->isHidden()) { secondToolBar->hide(); configMenu->changeItem( iD,"Show Command List"); cfg.writeEntry("Hidden","TRUE"); configMenu->setItemEnabled(-20 ,FALSE); } else { secondToolBar->show(); configMenu->changeItem( iD,"Hide Command List"); cfg.writeEntry("Hidden","FALSE"); configMenu->setItemEnabled(-20 ,TRUE); if(cfg.readEntry("EditEnabled","FALSE")=="TRUE") { @@ -738,28 +736,28 @@ void Konsole::configMenuSelected(int iD) commonCombo->setEditable( FALSE ); configMenu->setItemChecked(iD,FALSE); cfg.writeEntry("EditEnabled","FALSE"); commonCombo->setFocusPolicy(QWidget::NoFocus); te->setFocus(); } } } void Konsole::changeCommand(const QString &text, int c) { Config cfg("Konsole"); cfg.setGroup("Commands"); if(commonCmds[c] != text) { cfg.writeEntry(QString::number(c),text); commonCombo->clearEdit(); - commonCombo->setCurrentItem(c); + commonCombo->setCurrentItem(c); } } void Konsole::setColor() { Config cfg("Konsole"); cfg.setGroup("Colors"); - int scheme = cfg.readNumEntry("Schema",1); - if(scheme != 1) colorMenuSelected( -scheme); + int scheme = cfg.readNumEntry("Schema",1); + if(scheme != 1) colorMenuSelected( -scheme); } |