summaryrefslogtreecommitdiff
authordrw <drw>2004-02-24 00:01:04 (UTC)
committer drw <drw>2004-02-24 00:01:04 (UTC)
commit99bcf9b87929dfba62449f6e365eff561ed3fab9 (patch) (side-by-side diff)
tree26cda4ab533b907126a97056b5c96c3f9ab504df
parentda044756096aef5819add4c0faf5f305b155648f (diff)
downloadopie-99bcf9b87929dfba62449f6e365eff561ed3fab9.zip
opie-99bcf9b87929dfba62449f6e365eff561ed3fab9.tar.gz
opie-99bcf9b87929dfba62449f6e365eff561ed3fab9.tar.bz2
Embedded Konsole: libopie->libopie2
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/config.in2
-rwxr-xr-xcore/apps/embeddedkonsole/embeddedkonsole.pro2
-rw-r--r--core/apps/embeddedkonsole/konsole.cpp12
-rw-r--r--core/apps/embeddedkonsole/main.cpp12
-rw-r--r--core/apps/embeddedkonsole/opie-embeddedkonsole.control2
5 files changed, 10 insertions, 20 deletions
diff --git a/core/apps/embeddedkonsole/config.in b/core/apps/embeddedkonsole/config.in
index 3a421d6..a3a1844 100644
--- a/core/apps/embeddedkonsole/config.in
+++ b/core/apps/embeddedkonsole/config.in
@@ -1,4 +1,4 @@
config EMBEDDEDKONSOLE
boolean "opie-embeddedkonsole (konsole from KDE adapted for Qt/Embedded)"
default "y"
- depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE
+ depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBQTAUX
diff --git a/core/apps/embeddedkonsole/embeddedkonsole.pro b/core/apps/embeddedkonsole/embeddedkonsole.pro
index 427c013..2743488 100755
--- a/core/apps/embeddedkonsole/embeddedkonsole.pro
+++ b/core/apps/embeddedkonsole/embeddedkonsole.pro
@@ -1,38 +1,38 @@
QMAKE_CFLAGS = -DHAVE_OPENPTY
TMAKE_FLAGS += -DHAVE_OPENPTY
QMAKE_LIBS = -lutil
CONFIG += qt warn_on release quick-app
HEADERS = TEWidget.h \
TEScreen.h \
TECommon.h \
TEHistory.h \
TEmulation.h \
TEmuVt102.h \
session.h \
keytrans.h \
konsole.h \
commandeditdialog.h \
commandeditwidget.h \
playlistselection.h \
MyPty.h
SOURCES = TEScreen.cpp \
TEWidget.cpp \
TEHistory.cpp \
TEmulation.cpp \
TEmuVt102.cpp \
session.cpp \
keytrans.cpp \
konsole.cpp \
commandeditdialog.cpp \
commandeditwidget.cpp \
playlistselection.cpp \
MyPty.cpp \
main.cpp
INTERFACES = commandeditdialogbase.ui smallcommandeditdialogbase.ui
TARGET = embeddedkonsole
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
-LIBS += -lqpe -lopie
+LIBS += -lqpe -lopiecore2 -lqtaux2
TMAKE_CXXFLAGS += -DQT_QWS_OPIE -DHAVE_OPENPTY
include ( $(OPIEDIR)/include.pro )
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp
index d10b66d..46c0203 100644
--- a/core/apps/embeddedkonsole/konsole.cpp
+++ b/core/apps/embeddedkonsole/konsole.cpp
@@ -1,117 +1,117 @@
/* ---------------------------------------------------------------------- */
/* */
/* [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 <stdlib.h>
+#ifdef QT_QWS_OPIE
+#include <opie2/ocolorpopupmenu.h>
+#endif
+
#include <qpe/resource.h>
#include <qdir.h>
#include <qevent.h>
#include <qdragobject.h>
#include <qobjectlist.h>
#include <qtoolbutton.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 <qfontdatabase.h>
#include <qfile.h>
#include <qspinbox.h>
#include <qlayout.h>
#include <qvbox.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:
EKNumTabBar(QWidget *parent = 0, const char *name = 0) :
QTabBar(parent, name)
{}
// QList<QTab> *getTabList() { return(tabList()); }
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;
left = t;
}
}
if ( left )
{
left->setText(QString::number(i+1));
m = left->rect().x();
}
}
}
virtual QSize sizeHint() const
{
if (isHidden())
{
return(QSize(0,0));
}
else
{
QSize size = QTabBar::sizeHint();
int shrink = 5;
if (qApp->desktop()->width() > 600 || qApp->desktop()->height() > 600)
{
@@ -1482,97 +1482,97 @@ void Konsole::colorMenuSelected(int iD)
foreground.setRgb(15,115,0);
// background.setRgb(0xB2,0x68,0x18);
background.setRgb(255,255,0);
colorMenu->setItemChecked(cm_gy,TRUE);
}
if(iD==cm_bm)
{// Blue, Magenta
foreground.setRgb(3,24,132);
background.setRgb(225,2,255);
colorMenu->setItemChecked(cm_bm,TRUE);
}
if(iD==cm_mb)
{// Magenta, Blue
foreground.setRgb(225,2,255);
background.setRgb(3,24,132);
colorMenu->setItemChecked(cm_mb,TRUE);
}
if(iD==cm_cw)
{// Cyan, White
foreground.setRgb(8,91,129);
background.setRgb(0xFF,0xFF,0xFF);
colorMenu->setItemChecked(cm_cw,TRUE);
}
if(iD==cm_wc)
{// White, Cyan
background.setRgb(8,91,129);
foreground.setRgb(0xFF,0xFF,0xFF);
colorMenu->setItemChecked(cm_wc,TRUE);
}
if(iD==cm_bb)
{// Black, Blue
background.setRgb(0x00,0x00,0x00);
foreground.setRgb(127,147,225);
colorMenu->setItemChecked(cm_bb,TRUE);
}
if(iD==cm_ab)
{// Black, Gold
background.setRgb(0x00,0x00,0x00);
foreground.setRgb(255,215,105);
colorMenu->setItemChecked(cm_ab,TRUE);
}
#ifdef QT_QWS_OPIE
if(iD==-19)
{
// Custom
qDebug("do custom");
if(fromMenu)
{
- OColorPopupMenu* penColorPopupMenu = new OColorPopupMenu(Qt::black, this, "foreground color");
+ Opie::OColorPopupMenu* penColorPopupMenu = new Opie::OColorPopupMenu(Qt::black, this, "foreground color");
connect(penColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this,
SLOT(changeForegroundColor(const QColor&)));
penColorPopupMenu->exec();
}
if(!fromMenu)
{
foreground.setNamedColor(cfg.readEntry("foreground",""));
background.setNamedColor(cfg.readEntry("background",""));
}
fromMenu=FALSE;
colorMenu->setItemChecked(-19,TRUE);
}
#endif
lastSelectedMenu = iD;
setColors(foreground, background);
QTabBar *tabBar = tab->getTabBar();
QString ss = QString("Session%1").arg(tabBar->currentTab());
// printf("current tab = %d\n", tabBar->currentTab());
if (tabBar->currentTab() == 0)
{
cfg.writeEntry("foregroundRed",QString::number(foreground.red()));
cfg.writeEntry("foregroundGreen",QString::number(foreground.green()));
cfg.writeEntry("foregroundBlue",QString::number(foreground.blue()));
cfg.writeEntry("backgroundRed",QString::number(background.red()));
cfg.writeEntry("backgroundGreen",QString::number(background.green()));
cfg.writeEntry("backgroundBlue",QString::number(background.blue()));
}
cfg.writeEntry("foregroundRed"+ss,QString::number(foreground.red()));
cfg.writeEntry("foregroundGreen"+ss,QString::number(foreground.green()));
cfg.writeEntry("foregroundBlue"+ss,QString::number(foreground.blue()));
cfg.writeEntry("backgroundRed"+ss,QString::number(background.red()));
cfg.writeEntry("backgroundGreen"+ss,QString::number(background.green()));
cfg.writeEntry("backgroundBlue"+ss,QString::number(background.blue()));
update();
}
void Konsole::setColors(QColor foreground, QColor background)
{
int i;
ColorEntry m_table[TABLE_COLORS];
TEWidget* te = getTe();
const ColorEntry * defaultCt=te->getdefaultColorTable();
@@ -1833,86 +1833,86 @@ void Konsole::setDocument( const QString &cmd)
{
if (te != 0)
{
te->emitText(cmd+"\r");
}
}
startUp++;
}
// what is the point of this when you can just
// run commands by using the shell directly??
void Konsole::parseCommandLine()
{
QString cmd;
// newSession();
for (int i=1;i< qApp->argc();i++)
{
if( QString(qApp->argv()[i]) == "-e")
{
i++;
for ( int j=i;j< qApp->argc();j++)
{
cmd+=QString(qApp->argv()[j])+" ";
}
cmd.stripWhiteSpace();
system(cmd.latin1());
exit(0);//close();
} // end -e switch
}
startUp++;
}
void Konsole::changeForegroundColor(const QColor &color)
{
Config cfg("Qkonsole");
cfg.setGroup("Colors");
int r, g, b;
color.rgb(&r,&g,&b);
foreground.setRgb(r,g,b);
cfg.writeEntry("foreground",color.name());
qDebug("foreground "+color.name());
cfg.write();
qDebug("do other dialog");
#ifdef QT_QWS_OPIE
- OColorPopupMenu* penColorPopupMenu2 = new OColorPopupMenu(Qt::black, this,"background color");
+ Opie::OColorPopupMenu* penColorPopupMenu2 = new Opie::OColorPopupMenu(Qt::black, this,"background color");
connect(penColorPopupMenu2, SIGNAL(colorSelected(const QColor&)), this,
SLOT(changeBackgroundColor(const QColor&)));
penColorPopupMenu2->exec();
#endif
}
void Konsole::changeBackgroundColor(const QColor &color)
{
qDebug("Change background");
Config cfg("Qkonsole");
cfg.setGroup("Colors");
int r, g, b;
color.rgb(&r,&g,&b);
background.setRgb(r,g,b);
cfg.writeEntry("background",color.name());
qDebug("background "+color.name());
cfg.write();
}
void Konsole::doWrap()
{
Config cfg("Qkonsole");
cfg.setGroup("ScrollBar");
TEWidget* te = getTe();
if( !cfg.readBoolEntry("HorzScroll",0))
{
te->setWrapAt(0);
configMenu->setItemChecked( cm_wrap,TRUE);
}
else
{
// te->setWrapAt(90);
te->setWrapAt(120);
configMenu->setItemChecked( cm_wrap,FALSE);
}
}
diff --git a/core/apps/embeddedkonsole/main.cpp b/core/apps/embeddedkonsole/main.cpp
index a6a079c..fe30b7e 100644
--- a/core/apps/embeddedkonsole/main.cpp
+++ b/core/apps/embeddedkonsole/main.cpp
@@ -1,39 +1,29 @@
/* ---------------------------------------------------------------------- */
/* */
/* [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> */
/* */
/* -------------------------------------------------------------------------- */
#include "konsole.h"
-#include <qpe/qpeapplication.h>
-#include <opie/oapplicationfactory.h>
-
-#include <qfile.h>
-
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <pwd.h>
-#include <sys/types.h>
+#include <opie2/oapplicationfactory.h>
/* --| main |------------------------------------------------------ */
OPIE_EXPORT_APP( OApplicationFactory<Konsole> )
diff --git a/core/apps/embeddedkonsole/opie-embeddedkonsole.control b/core/apps/embeddedkonsole/opie-embeddedkonsole.control
index 5807cd1..a338e19 100644
--- a/core/apps/embeddedkonsole/opie-embeddedkonsole.control
+++ b/core/apps/embeddedkonsole/opie-embeddedkonsole.control
@@ -1,10 +1,10 @@
Package: opie-embeddedkonsole
Files: plugins/application/libembeddedkonsole.so* bin/embeddedkonsole apps/Applications/embeddedkonsole.desktop pics/konsole
Priority: optional
Section: opie/applications
Maintainer: L.J. Potter <lpotter@trolltech.com>
Architecture: arm
-Depends: task-opie-minimal, libopie1, opie-keytabs
+Depends: task-opie-minimal, libopiecore2, libqtaux2, opie-keytabs
Description: KDE's konsole (shell terminal)
Ported to the Opie environment.
Version: $QPE_VERSION$EXTRAVERSION