summaryrefslogtreecommitdiff
Unidiff
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 @@
1#include <qwidget.h> 1#include <qwidget.h>
2 2
3#include "TEWidget.h" 3#include "TEWidget.h"
4#include "TEmuVt102.h" 4#include "TEmuVt102.h"
5 5
6#include "emulation_handler.h" 6#include "emulation_handler.h"
7 7
8 8
9EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent, const char* name ) 9EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent,const char* name )
10 : QObject(0, name ) 10 : QObject(0, name )
11{ 11{
12 load(prof ); 12 m_teWid = new TEWidget( parent, "TerminalMain");
13 m_teWid = new TEWidget( parent, "TerminalMain" ); 13 m_teWid->setMinimumSize(150, 70 );
14 parent->resize( m_teWid->calcSize(80, 24 ) ); 14 parent->resize( m_teWid->calcSize(80, 24 ) );
15 m_teEmu = new TEmuVt102(m_teWid ); 15 m_teEmu = new TEmuVt102(m_teWid );
16 16
17 connect(m_teEmu,SIGNAL(ImageSizeChanged(int, int) ), 17 connect(m_teEmu,SIGNAL(ImageSizeChanged(int, int) ),
18 this, SIGNAL(changeSize(int, int) ) ); 18 this, SIGNAL(changeSize(int, int) ) );
19 connect(m_teEmu, SIGNAL(sndBlock(const char*, int) ), 19 connect(m_teEmu, SIGNAL(sndBlock(const char*, int) ),
20 this, SLOT(recvEmulation(const char*, int) ) ); 20 this, SLOT(recvEmulation(const char*, int) ) );
21 m_teEmu->setConnect( true );
22 load( prof );
23
24
21 25
22} 26}
23EmulationHandler::~EmulationHandler() { 27EmulationHandler::~EmulationHandler() {
24 delete m_teEmu; 28 delete m_teEmu;
25 delete m_teWid; 29 delete m_teWid;
26} 30}
27void EmulationHandler::load( const Profile& ) { 31void EmulationHandler::load( const Profile& ) {
28 32 QFont font = QFont("Fixed", 12, QFont::Normal );
33 font.setFixedPitch(TRUE);
34 m_teWid->setVTFont( font );
35 m_teWid->setBackgroundColor(Qt::black );
29} 36}
30void EmulationHandler::recv( const QByteArray& ar) { 37void EmulationHandler::recv( const QByteArray& ar) {
31 m_teEmu->onRcvBlock(ar.data(), ar.count() ); 38 m_teEmu->onRcvBlock(ar.data(), ar.count() );
32} 39}
33void EmulationHandler::recvEmulation(const char* src, int len ) { 40void EmulationHandler::recvEmulation(const char* src, int len ) {
34 QByteArray ar(len); 41 QByteArray ar(len);
35 memcpy(ar.data(), src, sizeof(char) * len ); 42 memcpy(ar.data(), src, sizeof(char) * len );
36 43
37 emit send(ar); 44 emit send(ar);
38} 45}
39QWidget* EmulationHandler::widget() { 46QWidget* EmulationHandler::widget() {
40 return m_teWid; 47 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()
618 defKeySyms(); 618 defKeySyms();
619} 619}
620 620
621// Global material ----------------------------------------------------------- 621// Global material -----------------------------------------------------------
622 622
623static int keytab_serial = 0; //FIXME: remove,localize 623static int keytab_serial = 0; //FIXME: remove,localize
624 624
625static QIntDict<KeyTrans> * numb2keymap = 0L; 625static QIntDict<KeyTrans> * numb2keymap = 0L;
626static QDict<KeyTrans> * path2keymap = 0L; 626static QDict<KeyTrans> * path2keymap = 0L;
627 627
628KeyTrans* KeyTrans::find(int numb) 628KeyTrans* KeyTrans::find(int numb)
629{ 629{
630 loadAll();
631 KeyTrans* res = numb2keymap->find(numb); 630 KeyTrans* res = numb2keymap->find(numb);
632 return res ? res : numb2keymap->find(0); 631 return res ? res : numb2keymap->find(0);
633} 632}
634 633
635KeyTrans* KeyTrans::find(const char* path) 634KeyTrans* KeyTrans::find(const char* path)
636{ 635{
637 loadAll();
638 KeyTrans* res = path2keymap->find(path); 636 KeyTrans* res = path2keymap->find(path);
639 return res ? res : numb2keymap->find(0); 637 return res ? res : numb2keymap->find(0);
640} 638}
641 639
642int KeyTrans::count() 640int KeyTrans::count()
643{ 641{
644 loadAll();
645 return numb2keymap->count(); 642 return numb2keymap->count();
646} 643}
647 644
648void KeyTrans::addKeyTrans() 645void KeyTrans::addKeyTrans()
649{ 646{
650 this->numb = keytab_serial ++; 647 this->numb = keytab_serial ++;
651 numb2keymap->insert(numb,this); 648 numb2keymap->insert(numb,this);
652 path2keymap->insert(path,this); 649 path2keymap->insert(path,this);
653} 650}
654 651
655void KeyTrans::loadAll() 652void KeyTrans::loadAll()
656{ 653{
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 @@
1#include <assert.h>
2
3
1 4
2#include <qaction.h> 5#include <qaction.h>
3#include <qmenubar.h> 6#include <qmenubar.h>
4#include <qlabel.h> 7#include <qlabel.h>
5#include <qpopupmenu.h> 8#include <qpopupmenu.h>
6#include <qtoolbar.h> 9#include <qtoolbar.h>
7#include <qpe/resource.h> 10#include <qpe/resource.h>
8#include <opie/ofiledialog.h> 11#include <opie/ofiledialog.h>
9#include <qmessagebox.h> 12#include <qmessagebox.h>
10 13
14#include "keytrans.h"
11#include "profileeditordialog.h" 15#include "profileeditordialog.h"
12#include "configdialog.h" 16#include "configdialog.h"
13#include "default.h" 17#include "default.h"
14#include "metafactory.h" 18#include "metafactory.h"
15#include "profile.h" 19#include "profile.h"
16#include "profilemanager.h" 20#include "profilemanager.h"
17#include "mainwindow.h" 21#include "mainwindow.h"
18#include "tabwidget.h" 22#include "tabwidget.h"
19#include "transferdialog.h" 23#include "transferdialog.h"
20#include "function_keyboard.h" 24#include "function_keyboard.h"
21#include "script.h" 25#include "script.h"
22 26
23MainWindow::MainWindow() { 27MainWindow::MainWindow() {
28 KeyTrans::loadAll();
29 for (int i = 0; i < KeyTrans::count(); i++ ) {
30 KeyTrans* s = KeyTrans::find(i );
31 assert( s );
32 }
24 m_factory = new MetaFactory(); 33 m_factory = new MetaFactory();
25 Default def(m_factory); 34 Default def(m_factory);
26 m_sessions.setAutoDelete( TRUE ); 35 m_sessions.setAutoDelete( TRUE );
27 m_curSession = 0; 36 m_curSession = 0;
28 m_manager = new ProfileManager( m_factory ); 37 m_manager = new ProfileManager( m_factory );
29 m_manager->load(); 38 m_manager->load();
30 39
31 initUI(); 40 initUI();
32 populateProfiles(); 41 populateProfiles();
33} 42}
34void MainWindow::initUI() { 43void MainWindow::initUI() {
35 setToolBarsMovable( FALSE ); 44 setToolBarsMovable( FALSE );