summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/emulation_handler.cpp11
-rw-r--r--noncore/apps/opie-console/keytrans.cpp3
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp9
3 files changed, 18 insertions, 5 deletions
diff --git a/noncore/apps/opie-console/emulation_handler.cpp b/noncore/apps/opie-console/emulation_handler.cpp
index 787de67..c67c7c7 100644
--- a/noncore/apps/opie-console/emulation_handler.cpp
+++ b/noncore/apps/opie-console/emulation_handler.cpp
@@ -1,41 +1,48 @@
#include <qwidget.h>
#include "TEWidget.h"
#include "TEmuVt102.h"
#include "emulation_handler.h"
EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent, const char* name )
: QObject(0, name )
{
- load(prof );
m_teWid = new TEWidget( parent, "TerminalMain" );
+ m_teWid->setMinimumSize(150, 70 );
parent->resize( m_teWid->calcSize(80, 24 ) );
m_teEmu = new TEmuVt102(m_teWid );
connect(m_teEmu,SIGNAL(ImageSizeChanged(int, int) ),
this, SIGNAL(changeSize(int, int) ) );
connect(m_teEmu, SIGNAL(sndBlock(const char*, int) ),
this, SLOT(recvEmulation(const char*, int) ) );
+ m_teEmu->setConnect( true );
+ load( prof );
+
+
}
EmulationHandler::~EmulationHandler() {
delete m_teEmu;
delete m_teWid;
}
void EmulationHandler::load( const Profile& ) {
-
+ QFont font = QFont("Fixed", 12, QFont::Normal );
+ font.setFixedPitch(TRUE);
+ m_teWid->setVTFont( font );
+ m_teWid->setBackgroundColor(Qt::black );
}
void EmulationHandler::recv( const QByteArray& ar) {
m_teEmu->onRcvBlock(ar.data(), ar.count() );
}
void EmulationHandler::recvEmulation(const char* src, int len ) {
QByteArray ar(len);
memcpy(ar.data(), src, sizeof(char) * len );
emit send(ar);
}
QWidget* EmulationHandler::widget() {
return m_teWid;
}
diff --git a/noncore/apps/opie-console/keytrans.cpp b/noncore/apps/opie-console/keytrans.cpp
index 5ea192e..d569ae0 100644
--- a/noncore/apps/opie-console/keytrans.cpp
+++ b/noncore/apps/opie-console/keytrans.cpp
@@ -582,111 +582,108 @@ void KeyTransSymbols::defKeySyms()
defKeySym("G", Qt::Key_G );
defKeySym("H", Qt::Key_H );
defKeySym("I", Qt::Key_I );
defKeySym("J", Qt::Key_J );
defKeySym("K", Qt::Key_K );
defKeySym("L", Qt::Key_L );
defKeySym("M", Qt::Key_M );
defKeySym("N", Qt::Key_N );
defKeySym("O", Qt::Key_O );
defKeySym("P", Qt::Key_P );
defKeySym("Q", Qt::Key_Q );
defKeySym("R", Qt::Key_R );
defKeySym("S", Qt::Key_S );
defKeySym("T", Qt::Key_T );
defKeySym("U", Qt::Key_U );
defKeySym("V", Qt::Key_V );
defKeySym("W", Qt::Key_W );
defKeySym("X", Qt::Key_X );
defKeySym("Y", Qt::Key_Y );
defKeySym("Z", Qt::Key_Z );
defKeySym("BracketLeft", Qt::Key_BracketLeft );
defKeySym("Backslash", Qt::Key_Backslash );
defKeySym("BracketRight", Qt::Key_BracketRight);
defKeySym("AsciiCircum", Qt::Key_AsciiCircum );
defKeySym("Underscore", Qt::Key_Underscore );
defKeySym("QuoteLeft", Qt::Key_QuoteLeft );
defKeySym("BraceLeft", Qt::Key_BraceLeft );
defKeySym("Bar", Qt::Key_Bar );
defKeySym("BraceRight", Qt::Key_BraceRight );
defKeySym("AsciiTilde", Qt::Key_AsciiTilde );
}
KeyTransSymbols::KeyTransSymbols()
{
defModSyms();
defOprSyms();
defKeySyms();
}
// Global material -----------------------------------------------------------
static int keytab_serial = 0; //FIXME: remove,localize
static QIntDict<KeyTrans> * numb2keymap = 0L;
static QDict<KeyTrans> * path2keymap = 0L;
KeyTrans* KeyTrans::find(int numb)
{
- loadAll();
KeyTrans* res = numb2keymap->find(numb);
return res ? res : numb2keymap->find(0);
}
KeyTrans* KeyTrans::find(const char* path)
{
- loadAll();
KeyTrans* res = path2keymap->find(path);
return res ? res : numb2keymap->find(0);
}
int KeyTrans::count()
{
- loadAll();
return numb2keymap->count();
}
void KeyTrans::addKeyTrans()
{
this->numb = keytab_serial ++;
numb2keymap->insert(numb,this);
path2keymap->insert(path,this);
}
void KeyTrans::loadAll()
{
if (!numb2keymap)
numb2keymap = new QIntDict<KeyTrans>;
if (!path2keymap)
path2keymap = new QDict<KeyTrans>;
if (!syms)
syms = new KeyTransSymbols;
defaultKeyTrans()->addKeyTrans();
QString path = QPEApplication::qpeDir() + "etc/keytabs";
QDir dir(path);
QStringList lst = dir.entryList("*.keytab");
for(QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
QFile file(path + "/" + *it);
KeyTrans* sc = KeyTrans::fromDevice(*it, file);
if (sc) {
sc->addKeyTrans();
}
}
}
// Debugging material -----------------------------------------------------------
/*
void TestTokenizer(QBuffer &buf)
{
// opening sequence
buf.open(IO_ReadOnly);
cc = buf.getch();
lineno = 1;
// Test tokenizer
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 1d7a4be..02f8451 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -1,71 +1,80 @@
+#include <assert.h>
+
+
#include <qaction.h>
#include <qmenubar.h>
#include <qlabel.h>
#include <qpopupmenu.h>
#include <qtoolbar.h>
#include <qpe/resource.h>
#include <opie/ofiledialog.h>
#include <qmessagebox.h>
+#include "keytrans.h"
#include "profileeditordialog.h"
#include "configdialog.h"
#include "default.h"
#include "metafactory.h"
#include "profile.h"
#include "profilemanager.h"
#include "mainwindow.h"
#include "tabwidget.h"
#include "transferdialog.h"
#include "function_keyboard.h"
#include "script.h"
MainWindow::MainWindow() {
+ KeyTrans::loadAll();
+ for (int i = 0; i < KeyTrans::count(); i++ ) {
+ KeyTrans* s = KeyTrans::find(i );
+ assert( s );
+ }
m_factory = new MetaFactory();
Default def(m_factory);
m_sessions.setAutoDelete( TRUE );
m_curSession = 0;
m_manager = new ProfileManager( m_factory );
m_manager->load();
initUI();
populateProfiles();
}
void MainWindow::initUI() {
setToolBarsMovable( FALSE );
/* tool bar for the menu */
m_tool = new QToolBar( this );
m_tool->setHorizontalStretchable( TRUE );
m_bar = new QMenuBar( m_tool );
m_console = new QPopupMenu( this );
m_scripts = new QPopupMenu( this );
m_sessionsPop= new QPopupMenu( this );
m_settings = new QPopupMenu( this );
/* add a toolbar for icons */
m_icons = new QToolBar(this);
/*
* new Action for new sessions
*/
QAction* a = new QAction(tr("New Connection"),
Resource::loadPixmap( "new" ),
QString::null, 0, this, 0);
a->addTo( m_console );
a->addTo( m_icons );
connect(a, SIGNAL(activated() ),
this, SLOT(slotNew() ) );
/*
* connect action
*/
m_connect = new QAction();
m_connect->setText( tr("Connect") );
m_connect->addTo( m_console );
connect(m_connect, SIGNAL(activated() ),
this, SLOT(slotConnect() ) );
/*
* disconnect action