summaryrefslogtreecommitdiff
authorzecke <zecke>2002-10-14 18:13:20 (UTC)
committer zecke <zecke>2002-10-14 18:13:20 (UTC)
commite789f01a4fc6ada39809d40f8c44a6f6deec7785 (patch) (side-by-side diff)
treefffa1e5394daf5f648f62aa331b4aa8a792ceba1
parent3e92f4eba0510e7d3744f096a62eaa175b15c993 (diff)
downloadopie-e789f01a4fc6ada39809d40f8c44a6f6deec7785.zip
opie-e789f01a4fc6ada39809d40f8c44a6f6deec7785.tar.gz
opie-e789f01a4fc6ada39809d40f8c44a6f6deec7785.tar.bz2
Make it work!
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/emulation_handler.cpp15
-rw-r--r--noncore/apps/opie-console/keytrans.cpp3
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp9
3 files changed, 20 insertions, 7 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,40 +1,47 @@
#include <qwidget.h>
#include "TEWidget.h"
#include "TEmuVt102.h"
#include "emulation_handler.h"
-EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent, const char* name )
+EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent,const char* name )
: QObject(0, name )
{
- load(prof );
- m_teWid = new TEWidget( parent, "TerminalMain" );
+ 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
@@ -618,39 +618,36 @@ KeyTransSymbols::KeyTransSymbols()
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()
{
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,35 +1,44 @@
+#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 );