summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/MyPty.cpp7
-rw-r--r--core/apps/embeddedkonsole/konsole.cpp21
-rw-r--r--core/apps/embeddedkonsole/konsole.h6
-rw-r--r--core/apps/embeddedkonsole/session.h2
4 files changed, 17 insertions, 19 deletions
diff --git a/core/apps/embeddedkonsole/MyPty.cpp b/core/apps/embeddedkonsole/MyPty.cpp
index e7d8274..5a8519a 100644
--- a/core/apps/embeddedkonsole/MyPty.cpp
+++ b/core/apps/embeddedkonsole/MyPty.cpp
@@ -74,17 +74,16 @@
#include <signal.h>
#include <fcntl.h>
#include <unistd.h>
#include <termios.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/wait.h>
-#undef HAVE_OPENPTY
#ifdef HAVE_OPENPTY
#include <pty.h>
#endif
#include "MyPty.h"
#undef VERBOSE_DEBUG
@@ -255,34 +254,34 @@ void MyPty::send_bytes(const char* s, int len)
#ifdef VERBOSE_DEBUG
// verbose debug
printf("sending bytes:\n");
for (int i = 0; i < len; i++)
printf("%c", s[i]);
printf("\n");
#endif
- ::write(fd, s, len);
+ ::write(fd, s, len);
}
/*! indicates that a block of data is received */
void MyPty::readPty()
-{
+{
char buf[4096];
int len = ::read( fd, buf, 4096 );
if (len == -1)
donePty();
if (len < 0)
return;
emit block_in(buf,len);
-
+
#ifdef VERBOSE_DEBUG
// verbose debug
printf("read bytes:\n");
for (int i = 0; i < len; i++)
printf("%c", buf[i]);
printf("\n");
#endif
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp
index b8f009d..1c613a9 100644
--- a/core/apps/embeddedkonsole/konsole.cpp
+++ b/core/apps/embeddedkonsole/konsole.cpp
@@ -16,17 +16,16 @@
/* */
/* Ported Konsole to Qt/Embedded */
/* */
/* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */
/* */
/* -------------------------------------------------------------------------- */
// enhancements added by L.J. Potter <ljp@llornkcor.com>
// enhancements added by Phillip Kuhn
-//#define QT_QWS_OPIE
#include <stdlib.h>
#ifdef QT_QWS_OPIE
#include <opie2/ocolorpopupmenu.h>
#endif
#include <qpe/resource.h>
@@ -364,18 +363,18 @@ void Konsole::init(const char* _pgm, QStrList & _args)
b_scroll = TRUE; // histon;
n_keytab = 0;
n_render = 0;
startUp=0;
fromMenu = FALSE;
fullscreen = false;
- setCaption( "Konsole" );
- setIcon( Resource::loadPixmap( "qkonsole/qkonsole" ) );
+ setCaption( tr( "Konsole" ) );
+ setIcon( Resource::loadPixmap( "konsole/Terminal" ) );
Config cfg( "Konsole" );
cfg.setGroup("Font");
QString tmp;
// initialize the list of allowed fonts ///////////////////////////////////
QString cfgFontName = cfg.readEntry("FontName","Lcfont");
@@ -572,17 +571,17 @@ void Konsole::init(const char* _pgm, QStrList & _args)
#ifdef QT_QWS_OPIE
colorMenu->insertItem(tr( "Custom"));
#endif
configMenu->insertItem(tr( "Colors") ,colorMenu);
sessionList = new QPopupMenu(this);
- sessionList-> insertItem ( Resource::loadPixmap ( "qkonsole/qkonsole" ), tr( "new session" ), this,
+ sessionList-> insertItem ( Resource::loadPixmap ( "konsole/Terminal" ), tr( "new session" ), this,
SLOT(newSession()) );
// 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( tabMenu, SIGNAL( activated(int) ), this, SLOT( tabMenuSelected(int) ));
connect( scrollMenu, SIGNAL(activated(int)),this,SLOT(scrollMenuSelected(int)));
connect( editCommandListMenu,SIGNAL(activated(int)),this,SLOT(editCommandListMenuSelected(int)));
@@ -874,17 +873,17 @@ void Konsole::changeFontSize(int delta)
}
if (closest_font >= 0)
{
printf("font closest %d (%d)\n", closest_font, closest);
setFont(closest_font);
}
}
-int Konsole::findFont(QString name, int size, bool exactMatch)
+int Konsole::findFont(const QString& name, int size, bool exactMatch)
{
for(uint i = 0; i < fonts.count(); i++)
{
if (fonts.at(i)->getName() == name
&& fonts.at(i)->getSize() == size)
{
return(i);
}
@@ -1154,21 +1153,21 @@ void Konsole::doneSession(TEWidget* te, int )
nsessions--;
}
if (nsessions == 0)
{
close();
}
}
-void Konsole::changeTitle(TEWidget* te, QString newTitle )
+void Konsole::changeTitle(TEWidget* te, const QString& newTitle )
{
if (te == getTe())
{
- setCaption(newTitle + " - QKonsole");
+ setCaption( newTitle + " - " + tr( "Konsole " ) );
}
}
void Konsole::newSession()
{
if(nsessions < 15)
{ // seems to be something weird about 16 tabs on the Zaurus.... memory?
@@ -1195,18 +1194,18 @@ void Konsole::newSession()
if (cfont < 0)
cfont = 0;
te->setVTFont(fonts.at(cfont)->getFont());
tab->addTab(te);
TESession* se = new TESession(this, te, se_pgm, se_args, "xterm");
te->currentSession = se;
connect( se, SIGNAL(done(TEWidget*,int)), this, SLOT(doneSession(TEWidget*,int)) );
- connect( se, SIGNAL(changeTitle(TEWidget*,QString)), this,
- SLOT(changeTitle(TEWidget*,QString)) );
+ connect( se, SIGNAL(changeTitle(TEWidget*,const QString&)), this,
+ SLOT(changeTitle(TEWidget*,const QString&)) );
connect(te, SIGNAL(changeFontSize(int)), this, SLOT(changeFontSize(int)));
connect(te, SIGNAL(changeSession(int)), this, SLOT(changeSession(int)));
connect(te, SIGNAL(newSession()), this, SLOT(newSession()));
connect(te, SIGNAL(toggleFullScreen()), this, SLOT(toggleFullScreen()));
connect(te, SIGNAL(setFullScreen(bool)), this, SLOT(setFullScreen(bool)));
se->run();
se->setConnect(TRUE);
se->setHistory(b_scroll);
@@ -1304,21 +1303,21 @@ void Konsole::switchSession(QWidget* w)
}
}
for(int i = 0; i < (int)fontList->count(); i++)
{
fontList->setItemChecked(i + 1000, i == familyNum);
}
if (! te->currentSession->Title().isEmpty() )
{
- setCaption(te->currentSession->Title() + " - QKonsole");
+ setCaption( te->currentSession->Title() + " - " + tr( "Konsole" ) );
}
else
{
- setCaption( "Konsole" );
+ setCaption( tr( "Konsole" ) );
}
// colorMenuSelected(te->color_menu_item);
}
void Konsole::toggleFullScreen()
{
setFullScreen(! fullscreen);
diff --git a/core/apps/embeddedkonsole/konsole.h b/core/apps/embeddedkonsole/konsole.h
index 37babbb..e163cb8 100644
--- a/core/apps/embeddedkonsole/konsole.h
+++ b/core/apps/embeddedkonsole/konsole.h
@@ -68,17 +68,17 @@ public slots:
void setFullScreen(bool);
void changeSession(int);
void cycleZoom();
void newSession();
private slots:
void setDocument(const QString &);
void doneSession(TEWidget*,int);
- void changeTitle(TEWidget*,QString);
+ void changeTitle(TEWidget*, const QString&);
void changeColumns(int);
void setFont(int);
// void fontChanged(int);
void configMenuSelected(int );
void colorMenuSelected(int);
void colorMenuIsSelected(int);
void tabMenuSelected(int);
void sessionListSelected(int);
@@ -105,31 +105,31 @@ private slots:
private:
void doWrap();
void init(const char* _pgm, QStrList & _args);
void initSession(const char* _pgm, QStrList & _args);
void runSession(TESession* s);
void setColorPixmaps();
void setHistory(bool);
void setColors(QColor foreground, QColor background);
- int findFont(QString name, int size, bool exact = false);
+ int findFont(const QString& name, int size, bool exact = false);
QSize calcSize(int columns, int lines);
TEWidget* getTe();
QStringList commands;
QLabel * msgLabel;
QColor foreground, background;
bool fromMenu;
bool fullscreen;
private:
class VTFont
{
public:
- VTFont(QString name, QFont& font, QString family, int familyNum, int size)
+ VTFont(const QString& name, QFont& font, const QString& family, int familyNum, int size)
{
this->name = name;
this->font = font;
this->family = family;
this->size = size;
this->familyNum = familyNum;
}
diff --git a/core/apps/embeddedkonsole/session.h b/core/apps/embeddedkonsole/session.h
index f399e96..a4b33e2 100644
--- a/core/apps/embeddedkonsole/session.h
+++ b/core/apps/embeddedkonsole/session.h
@@ -63,17 +63,17 @@ public slots:
void run();
void done(int status);
void terminate();
void changeTitle(int, const QString& title);
signals:
void done(TEWidget*, int);
- void changeTitle(TEWidget*, QString);
+ void changeTitle(TEWidget*, const QString&);
private:
// TEPty* sh;
MyPty* sh;
TEWidget* te;
TEmulation* em;