author | zecke <zecke> | 2002-10-14 19:58:07 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-14 19:58:07 (UTC) |
commit | 0547ecc794209a0824fd7662e434706ac625dbb2 (patch) (side-by-side diff) | |
tree | 90243ddbca14b2c01552d55b413be0d044c3a108 /noncore | |
parent | 7114c1567399d9b134af337824ef56e7d5facee7 (diff) | |
download | opie-0547ecc794209a0824fd7662e434706ac625dbb2.zip opie-0547ecc794209a0824fd7662e434706ac625dbb2.tar.gz opie-0547ecc794209a0824fd7662e434706ac625dbb2.tar.bz2 |
Make it work
history and other stuff
-rw-r--r-- | noncore/apps/opie-console/emulation_handler.cpp | 6 | ||||
-rw-r--r-- | noncore/apps/opie-console/profilemanager.cpp | 9 | ||||
-rw-r--r-- | noncore/apps/opie-console/session.cpp | 47 | ||||
-rw-r--r-- | noncore/apps/opie-console/session.h | 12 |
4 files changed, 43 insertions, 31 deletions
diff --git a/noncore/apps/opie-console/emulation_handler.cpp b/noncore/apps/opie-console/emulation_handler.cpp index c67c7c7..9e7f56c 100644 --- a/noncore/apps/opie-console/emulation_handler.cpp +++ b/noncore/apps/opie-console/emulation_handler.cpp @@ -21,2 +21,3 @@ EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent,const c m_teEmu->setConnect( true ); + m_teEmu->setHistory( TRUE ); load( prof ); @@ -34,5 +35,6 @@ void EmulationHandler::load( const Profile& ) { m_teWid->setVTFont( font ); - m_teWid->setBackgroundColor(Qt::black ); + m_teWid->setBackgroundColor(Qt::gray ); } void EmulationHandler::recv( const QByteArray& ar) { + qWarning("received in EmulationHandler!"); m_teEmu->onRcvBlock(ar.data(), ar.count() ); @@ -40,3 +42,5 @@ void EmulationHandler::recv( const QByteArray& ar) { void EmulationHandler::recvEmulation(const char* src, int len ) { + qWarning("received from te "); QByteArray ar(len); + memcpy(ar.data(), src, sizeof(char) * len ); diff --git a/noncore/apps/opie-console/profilemanager.cpp b/noncore/apps/opie-console/profilemanager.cpp index e8bdb2e..95a46f9 100644 --- a/noncore/apps/opie-console/profilemanager.cpp +++ b/noncore/apps/opie-console/profilemanager.cpp @@ -74,2 +74,10 @@ Profile::ValueList ProfileManager::all()const { Session* ProfileManager::fromProfile( const Profile& prof, QWidget* parent) { +/* TEST PROFILE!!! + Profile prof; + QString str = "/dev/ttyS0"; + prof.writeEntry("Device",str ); + prof.writeEntry("Baud", 115200 ); + prof.setIOLayer("serial"); + prof.setName( "test"); +*/ Session* session = new Session(); @@ -87,2 +95,3 @@ Session* ProfileManager::fromProfile( const Profile& prof, QWidget* parent) { EmulationHandler* handler = new EmulationHandler(prof,dummy ); + session->setEmulationHandler( handler ); lay->addWidget( handler->widget() ); diff --git a/noncore/apps/opie-console/session.cpp b/noncore/apps/opie-console/session.cpp index 7cae0df..f4fbcf2 100644 --- a/noncore/apps/opie-console/session.cpp +++ b/noncore/apps/opie-console/session.cpp @@ -4,4 +4,3 @@ #include "file_layer.h" -#include "widget_layer.h" -#include "emulation_layer.h" +#include "emulation_handler.h" #include "session.h" @@ -12,4 +11,3 @@ Session::Session() { m_layer = 0l; -// m_widLay = 0l; -// m_emLay = 0l; + m_emu = 0l; } @@ -20,2 +18,3 @@ Session::Session( const QString& na, QWidgetStack* widget, IOLayer* lay) // m_emLay = 0l; + m_emu = 0l; } @@ -23,3 +22,3 @@ Session::~Session() { delete m_layer; -// delete m_emLay; + delete m_emu; delete m_widget; @@ -36,5 +35,6 @@ IOLayer* Session::layer() { } -/*EmulationLayer* Session::emulationLayer() { - return m_emLay; +EmulationHandler* Session::emulationHandler() { + return m_emu; } +/* WidgetLayer* Session::emulationWidget() { @@ -44,14 +44,15 @@ WidgetLayer* Session::emulationWidget() { void Session::connect() { -/* if ( !m_layer || !m_emLay ) + if ( !m_layer || !m_emu ) return; + qWarning("connection in session"); QObject::connect(m_layer, SIGNAL(received(const QByteArray&) ), - m_emLay, SLOT(onRcvBlock(const QByteArray&) ) ); - QObject::connect(m_emLay, SIGNAL(sndBlock(const QByteArray&) ), + m_emu, SLOT(recv(const QByteArray&) ) ); + QObject::connect(m_emu, SIGNAL(send(const QByteArray&) ), m_layer, SLOT(send(const QByteArray&) ) ); - */ + } void Session::disconnect() { -/* - if ( !m_layer || !m_emLay ) + + if ( !m_layer || !m_emu ) return; @@ -59,6 +60,5 @@ void Session::disconnect() { QObject::disconnect(m_layer, SIGNAL(received(const QByteArray&) ), - m_emLay, SLOT(onRcvBlock(const QByteArray&) ) ); - QObject::disconnect(m_emLay, SIGNAL(sndBlock(const QByteArray&) ), + m_emu, SLOT(recv(const QByteArray&) ) ); + QObject::disconnect(m_emu, SIGNAL(send(const QByteArray&) ), m_layer, SLOT(send(const QByteArray&) ) ); - */ } @@ -68,5 +68,7 @@ void Session::setName( const QString& na){ void Session::setWidgetStack( QWidgetStack* wid ) { + delete m_emu; + m_emu = 0l; delete m_widget; /* the EmulationLayer was destroyed... */ - //delete m_emLay; + m_widget = wid; @@ -77,7 +79,8 @@ void Session::setIOLayer( IOLayer* lay ) { } -/* -void Session::setEmulationLayer( EmulationLayer* lay ) { - delete m_emLay; - m_emLay = lay; + +void Session::setEmulationHandler( EmulationHandler* lay ) { + delete m_emu; + m_emu = lay; } +/* void Session::setEmulationWidget( WidgetLayer* lay ) { @@ -86,2 +89,2 @@ void Session::setEmulationWidget( WidgetLayer* lay ) { } -*/
\ No newline at end of file +*/ diff --git a/noncore/apps/opie-console/session.h b/noncore/apps/opie-console/session.h index 04bf257..c3f3661 100644 --- a/noncore/apps/opie-console/session.h +++ b/noncore/apps/opie-console/session.h @@ -6,4 +6,3 @@ class IOLayer; -class EmulationLayer; -class WidgetLayer; +class EmulationHandler; /** @@ -43,4 +42,3 @@ public: -// EmulationLayer* emulationLayer(); - WidgetLayer* emulationWidget(); + EmulationHandler* emulationHandler(); @@ -59,4 +57,3 @@ public: void setWidgetStack( QWidgetStack* widget ); -// void setEmulationLayer( EmulationLayer* lay ); -// void setEmulationWidget( WidgetLayer* lay ); + void setEmulationHandler( EmulationHandler* lay ); void setIOLayer( IOLayer* ); @@ -68,4 +65,3 @@ private: IOLayer* m_layer; -// EmulationLayer* m_emLay; -// WidgetLayer* m_widLay; + EmulationHandler* m_emu; |