summaryrefslogtreecommitdiff
path: root/core/apps/embeddedkonsole/konsole.cpp
Side-by-side diff
Diffstat (limited to 'core/apps/embeddedkonsole/konsole.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/konsole.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp
index d855d90..fff2f68 100644
--- a/core/apps/embeddedkonsole/konsole.cpp
+++ b/core/apps/embeddedkonsole/konsole.cpp
@@ -1,79 +1,79 @@
/* ---------------------------------------------------------------------- */
/* */
/* [main.C] Konsole */
/* */
/* ---------------------------------------------------------------------- */
/* */
/* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */
/* */
/* This file is part of Konsole, an X terminal. */
/* */
/* The material contained in here more or less directly orginates from */
/* kvt, which is copyright (c) 1996 by Matthias Ettrich <ettrich@kde.org> */
/* */
/* ---------------------------------------------------------------------- */
/* */
/* Ported Konsole to Qt/Embedded */
/* */
/* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */
/* */
/* -------------------------------------------------------------------------- */
// enhancements added by L.J. Potter <ljp@llornkcor.com>
#define QT_QWS_OPIE
#include <qpe/resource.h>
#include <qdir.h>
#include <qevent.h>
#include <qdragobject.h>
#include <qobjectlist.h>
#include <qtoolbutton.h>
-#include <qpe/qpetoolbar.h>
+#include <qtoolbar.h>
#include <qpushbutton.h>
#include <qfontdialog.h>
#include <qglobal.h>
#include <qpainter.h>
#include <qmenubar.h>
#include <qmessagebox.h>
#include <qaction.h>
#include <qapplication.h>
#include <qfontmetrics.h>
#include <qcombobox.h>
#include <qevent.h>
#include <qtabwidget.h>
#include <qtabbar.h>
#include <qpe/config.h>
#include <qstringlist.h>
#include <qpalette.h>
#include <unistd.h>
#include <pwd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "konsole.h"
#include "keytrans.h"
#include "commandeditdialog.h"
#ifdef QT_QWS_OPIE
#include <opie/colorpopupmenu.h>
#endif
class EKNumTabBar : public QTabBar {
public:
void numberTabs()
{
// Yes, it really is this messy. QTabWidget needs functions
// that provide acces to tabs in a sequential way.
int m=INT_MIN;
for (int i=0; i<count(); i++) {
QTab* left=0;
QListIterator<QTab> it(*tabList());
int x=INT_MAX;
for( QTab* t; (t=it.current()); ++it ) {
int tx = t->rect().x();
if ( tx<x && tx>m ) {
x = tx;
@@ -237,192 +237,192 @@ void Konsole::initCommandList()
commonCombo->insertItem(commonCmds[i],i);
}
} else {
for (int i = 0; i < 100; i++) {
if (!(cfg.readEntry( QString::number(i),"")).isEmpty())
commonCombo->insertItem((cfg.readEntry( QString::number(i),"")));
}
}
}
void Konsole::init(const char* _pgm, QStrList & _args)
{
b_scroll = TRUE; // histon;
n_keytab = 0;
n_render = 0;
startUp=0;
fromMenu = FALSE;
setCaption( tr("Terminal") );
setIcon( Resource::loadPixmap( "konsole" ) );
Config cfg("Konsole");
cfg.setGroup("Konsole");
QString tmp;
// initialize the list of allowed fonts ///////////////////////////////////
cfont = cfg.readNumEntry("FontID", 1);
QFont f = QFont("Micro", 4, QFont::Normal);
f.setFixedPitch(TRUE);
fonts.append(new VTFont(tr("Micro"), f));
f = QFont("Fixed", 7, QFont::Normal);
f.setFixedPitch(TRUE);
fonts.append(new VTFont(tr("Small Fixed"), f));
f = QFont("Fixed", 12, QFont::Normal);
f.setFixedPitch(TRUE);
fonts.append(new VTFont(tr("Medium Fixed"), f));
// create terminal emulation framework ////////////////////////////////////
nsessions = 0;
tab = new EKNumTabWidget(this);
connect(tab, SIGNAL(currentChanged(QWidget*)), this, SLOT(switchSession(QWidget*)));
// create terminal toolbar ////////////////////////////////////////////////
setToolBarsMovable( FALSE );
- QPEToolBar *menuToolBar = new QPEToolBar( this );
+ QToolBar *menuToolBar = new QToolBar( this );
menuToolBar->setHorizontalStretchable( TRUE );
QMenuBar *menuBar = new QMenuBar( 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);
editCommandListMenu = new QPopupMenu( this);
configMenu->insertItem(tr("Command List"), editCommandListMenu);
bool listHidden;
cfg.setGroup("Menubar");
if( cfg.readEntry("Hidden","FALSE") == "TRUE") {
editCommandListMenu->insertItem( tr( "Show command list" ));
listHidden=TRUE;
} else {
editCommandListMenu->insertItem( tr( "Hide command list" ));
listHidden=FALSE;
}
cfg.setGroup("Tabs");
tmp=cfg.readEntry("Position","Bottom");
if(tmp=="Top") {
tab->setTabPosition(QTabWidget::Top);
configMenu->insertItem( tr( "Tabs on Bottom" ) );
} else {
tab->setTabPosition(QTabWidget::Bottom);
configMenu->insertItem(tr("Tabs on Top"));
}
configMenu->insertSeparator(2);
colorMenu->insertItem(tr( "Green on Black"));
colorMenu->insertItem(tr( "Black on White"));
colorMenu->insertItem(tr( "White on Black"));
colorMenu->insertItem(tr( "Black on Transparent"));
colorMenu->insertItem(tr( "Black on Red"));
colorMenu->insertItem(tr( "Red on Black"));
colorMenu->insertItem(tr( "Green on Yellow"));
colorMenu->insertItem(tr( "Blue on Magenta"));
colorMenu->insertItem(tr( "Magenta on Blue"));
colorMenu->insertItem(tr( "Cyan on White"));
colorMenu->insertItem(tr( "White on Cyan"));
colorMenu->insertItem(tr( "Blue on Black"));
colorMenu->insertItem(tr( "Amber on Black"));
#ifdef QT_QWS_OPIE
colorMenu->insertItem(tr( "Custom"));
#endif
configMenu->insertItem( tr("Font"), fontList );
configMenu->insertItem(tr( "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( colorMenuIsSelected(int) ));
connect( scrollMenu, SIGNAL(activated(int)),this,SLOT(scrollMenuSelected(int)));
connect(editCommandListMenu,SIGNAL(activated(int)),this,SLOT(editCommandListMenuSelected(int)));
menuBar->insertItem( tr("Options"), configMenu );
- QPEToolBar *toolbar = new QPEToolBar( this );
+ QToolBar *toolbar = new QToolBar( 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 );
connect( a, SIGNAL( activated() ), this, SLOT( hitEnter() ) ); a->addTo( toolbar );
a = new QAction( tr("Space"), Resource::loadPixmap( "konsole/space" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( hitSpace() ) ); a->addTo( toolbar );
a = new QAction( tr("Tab"), Resource::loadPixmap( "konsole/tab" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( hitTab() ) ); a->addTo( toolbar );
a = new QAction( tr("Up"), Resource::loadPixmap( "konsole/up" ), QString::null, 0, this, 0 );
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 = new QToolBar( this );
secondToolBar->setHorizontalStretchable( TRUE );
commonCombo = new QComboBox( secondToolBar );
commonCombo->setMaximumWidth(236);
editCommandListMenu->insertItem( tr( "Quick Edit" ) );
if( listHidden) {
secondToolBar->hide();
editCommandListMenu->setItemEnabled(-23 ,FALSE);
}
editCommandListMenu->insertItem(tr( "Edit" ) );
cfg.setGroup("Commands");
commonCombo->setInsertionPolicy(QComboBox::AtCurrent);
initCommandList();
// 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);
int jut = configMenu->insertItem(tr( "Wrap" ));
cfg.setGroup("ScrollBar");
configMenu->setItemChecked(jut, cfg.readBoolEntry("HorzScroll",0));
jut = configMenu->insertItem(tr( "Use Beep" ));
cfg.setGroup("Menubar");
configMenu->setItemChecked(jut, cfg.readBoolEntry("useBeep",0));
//scrollMenuSelected(-29);
// cfg.setGroup("ScrollBar");
// if(cfg.readBoolEntry("HorzScroll",0)) {
// if(cfg.readNumEntry("Position",2) == 0)
// te->setScrollbarLocation(1);