-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 | |||
21 | m_teEmu->setConnect( true ); | 21 | m_teEmu->setConnect( true ); |
22 | m_teEmu->setHistory( TRUE ); | ||
22 | load( prof ); | 23 | load( prof ); |
@@ -34,5 +35,6 @@ void EmulationHandler::load( const Profile& ) { | |||
34 | m_teWid->setVTFont( font ); | 35 | m_teWid->setVTFont( font ); |
35 | m_teWid->setBackgroundColor(Qt::black ); | 36 | m_teWid->setBackgroundColor(Qt::gray ); |
36 | } | 37 | } |
37 | void EmulationHandler::recv( const QByteArray& ar) { | 38 | void EmulationHandler::recv( const QByteArray& ar) { |
39 | qWarning("received in EmulationHandler!"); | ||
38 | m_teEmu->onRcvBlock(ar.data(), ar.count() ); | 40 | m_teEmu->onRcvBlock(ar.data(), ar.count() ); |
@@ -40,3 +42,5 @@ void EmulationHandler::recv( const QByteArray& ar) { | |||
40 | void EmulationHandler::recvEmulation(const char* src, int len ) { | 42 | void EmulationHandler::recvEmulation(const char* src, int len ) { |
43 | qWarning("received from te "); | ||
41 | QByteArray ar(len); | 44 | QByteArray ar(len); |
45 | |||
42 | memcpy(ar.data(), src, sizeof(char) * len ); | 46 | 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 { | |||
74 | Session* ProfileManager::fromProfile( const Profile& prof, QWidget* parent) { | 74 | Session* ProfileManager::fromProfile( const Profile& prof, QWidget* parent) { |
75 | /* TEST PROFILE!!! | ||
76 | Profile prof; | ||
77 | QString str = "/dev/ttyS0"; | ||
78 | prof.writeEntry("Device",str ); | ||
79 | prof.writeEntry("Baud", 115200 ); | ||
80 | prof.setIOLayer("serial"); | ||
81 | prof.setName( "test"); | ||
82 | */ | ||
75 | Session* session = new Session(); | 83 | Session* session = new Session(); |
@@ -87,2 +95,3 @@ Session* ProfileManager::fromProfile( const Profile& prof, QWidget* parent) { | |||
87 | EmulationHandler* handler = new EmulationHandler(prof,dummy ); | 95 | EmulationHandler* handler = new EmulationHandler(prof,dummy ); |
96 | session->setEmulationHandler( handler ); | ||
88 | lay->addWidget( handler->widget() ); | 97 | 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 @@ | |||
4 | #include "file_layer.h" | 4 | #include "file_layer.h" |
5 | #include "widget_layer.h" | 5 | #include "emulation_handler.h" |
6 | #include "emulation_layer.h" | ||
7 | #include "session.h" | 6 | #include "session.h" |
@@ -12,4 +11,3 @@ Session::Session() { | |||
12 | m_layer = 0l; | 11 | m_layer = 0l; |
13 | // m_widLay = 0l; | 12 | m_emu = 0l; |
14 | // m_emLay = 0l; | ||
15 | } | 13 | } |
@@ -20,2 +18,3 @@ Session::Session( const QString& na, QWidgetStack* widget, IOLayer* lay) | |||
20 | // m_emLay = 0l; | 18 | // m_emLay = 0l; |
19 | m_emu = 0l; | ||
21 | } | 20 | } |
@@ -23,3 +22,3 @@ Session::~Session() { | |||
23 | delete m_layer; | 22 | delete m_layer; |
24 | // delete m_emLay; | 23 | delete m_emu; |
25 | delete m_widget; | 24 | delete m_widget; |
@@ -36,5 +35,6 @@ IOLayer* Session::layer() { | |||
36 | } | 35 | } |
37 | /*EmulationLayer* Session::emulationLayer() { | 36 | EmulationHandler* Session::emulationHandler() { |
38 | return m_emLay; | 37 | return m_emu; |
39 | } | 38 | } |
39 | /* | ||
40 | WidgetLayer* Session::emulationWidget() { | 40 | WidgetLayer* Session::emulationWidget() { |
@@ -44,14 +44,15 @@ WidgetLayer* Session::emulationWidget() { | |||
44 | void Session::connect() { | 44 | void Session::connect() { |
45 | /* if ( !m_layer || !m_emLay ) | 45 | if ( !m_layer || !m_emu ) |
46 | return; | 46 | return; |
47 | 47 | ||
48 | qWarning("connection in session"); | ||
48 | QObject::connect(m_layer, SIGNAL(received(const QByteArray&) ), | 49 | QObject::connect(m_layer, SIGNAL(received(const QByteArray&) ), |
49 | m_emLay, SLOT(onRcvBlock(const QByteArray&) ) ); | 50 | m_emu, SLOT(recv(const QByteArray&) ) ); |
50 | QObject::connect(m_emLay, SIGNAL(sndBlock(const QByteArray&) ), | 51 | QObject::connect(m_emu, SIGNAL(send(const QByteArray&) ), |
51 | m_layer, SLOT(send(const QByteArray&) ) ); | 52 | m_layer, SLOT(send(const QByteArray&) ) ); |
52 | */ | 53 | |
53 | } | 54 | } |
54 | void Session::disconnect() { | 55 | void Session::disconnect() { |
55 | /* | 56 | |
56 | if ( !m_layer || !m_emLay ) | 57 | if ( !m_layer || !m_emu ) |
57 | return; | 58 | return; |
@@ -59,6 +60,5 @@ void Session::disconnect() { | |||
59 | QObject::disconnect(m_layer, SIGNAL(received(const QByteArray&) ), | 60 | QObject::disconnect(m_layer, SIGNAL(received(const QByteArray&) ), |
60 | m_emLay, SLOT(onRcvBlock(const QByteArray&) ) ); | 61 | m_emu, SLOT(recv(const QByteArray&) ) ); |
61 | QObject::disconnect(m_emLay, SIGNAL(sndBlock(const QByteArray&) ), | 62 | QObject::disconnect(m_emu, SIGNAL(send(const QByteArray&) ), |
62 | m_layer, SLOT(send(const QByteArray&) ) ); | 63 | m_layer, SLOT(send(const QByteArray&) ) ); |
63 | */ | ||
64 | } | 64 | } |
@@ -68,5 +68,7 @@ void Session::setName( const QString& na){ | |||
68 | void Session::setWidgetStack( QWidgetStack* wid ) { | 68 | void Session::setWidgetStack( QWidgetStack* wid ) { |
69 | delete m_emu; | ||
70 | m_emu = 0l; | ||
69 | delete m_widget; | 71 | delete m_widget; |
70 | /* the EmulationLayer was destroyed... */ | 72 | /* the EmulationLayer was destroyed... */ |
71 | //delete m_emLay; | 73 | |
72 | m_widget = wid; | 74 | m_widget = wid; |
@@ -77,7 +79,8 @@ void Session::setIOLayer( IOLayer* lay ) { | |||
77 | } | 79 | } |
78 | /* | 80 | |
79 | void Session::setEmulationLayer( EmulationLayer* lay ) { | 81 | void Session::setEmulationHandler( EmulationHandler* lay ) { |
80 | delete m_emLay; | 82 | delete m_emu; |
81 | m_emLay = lay; | 83 | m_emu = lay; |
82 | } | 84 | } |
85 | /* | ||
83 | void Session::setEmulationWidget( WidgetLayer* lay ) { | 86 | void Session::setEmulationWidget( WidgetLayer* lay ) { |
@@ -86,2 +89,2 @@ void Session::setEmulationWidget( WidgetLayer* lay ) { | |||
86 | } | 89 | } |
87 | */ \ No newline at end of file | 90 | */ |
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 @@ | |||
6 | class IOLayer; | 6 | class IOLayer; |
7 | class EmulationLayer; | 7 | class EmulationHandler; |
8 | class WidgetLayer; | ||
9 | /** | 8 | /** |
@@ -43,4 +42,3 @@ public: | |||
43 | 42 | ||
44 | // EmulationLayer* emulationLayer(); | 43 | EmulationHandler* emulationHandler(); |
45 | WidgetLayer* emulationWidget(); | ||
46 | 44 | ||
@@ -59,4 +57,3 @@ public: | |||
59 | void setWidgetStack( QWidgetStack* widget ); | 57 | void setWidgetStack( QWidgetStack* widget ); |
60 | // void setEmulationLayer( EmulationLayer* lay ); | 58 | void setEmulationHandler( EmulationHandler* lay ); |
61 | // void setEmulationWidget( WidgetLayer* lay ); | ||
62 | void setIOLayer( IOLayer* ); | 59 | void setIOLayer( IOLayer* ); |
@@ -68,4 +65,3 @@ private: | |||
68 | IOLayer* m_layer; | 65 | IOLayer* m_layer; |
69 | // EmulationLayer* m_emLay; | 66 | EmulationHandler* m_emu; |
70 | // WidgetLayer* m_widLay; | ||
71 | 67 | ||