summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/session.cpp
authorzecke <zecke>2002-10-09 01:22:42 (UTC)
committer zecke <zecke>2002-10-09 01:22:42 (UTC)
commita74bf68065b94efaacb73736c7127ccb74474645 (patch) (side-by-side diff)
treed85c40d367a4922091cc1780d8e1228d38de22c8 /noncore/apps/opie-console/session.cpp
parent8c353ec8b86ee8f82cc25172fb69dd5fee65e848 (diff)
downloadopie-a74bf68065b94efaacb73736c7127ccb74474645.zip
opie-a74bf68065b94efaacb73736c7127ccb74474645.tar.gz
opie-a74bf68065b94efaacb73736c7127ccb74474645.tar.bz2
PLANS:
move around some stuff to done, open to progress... Default add EmulationLayer stuff (vt102) EmulationLayer tried to use WidgetLayer but this did not work out KeyTrans make sure to load the Q*Dict first before accessing it! ibotty please check if this was correct MainWindow make generation of Sessions possible TabWidget go back to QTabWidget for now... this is much more testedt and I do not have to debug it. Besides that OTabWidget is a kewl widget and we will take it as soon as Sessions are tested enough TabWidget also implement setCurrent for sessions Vt102 make it compile... const QByteArray != const QByteArray&
Diffstat (limited to 'noncore/apps/opie-console/session.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/session.cpp49
1 files changed, 46 insertions, 3 deletions
diff --git a/noncore/apps/opie-console/session.cpp b/noncore/apps/opie-console/session.cpp
index d32b340..42b0583 100644
--- a/noncore/apps/opie-console/session.cpp
+++ b/noncore/apps/opie-console/session.cpp
@@ -2,37 +2,80 @@
#include "io_layer.h"
#include "file_layer.h"
+#include "widget.h"
+#include "emulation_layer.h"
#include "session.h"
+
Session::Session() {
m_widget = 0l;
m_layer = 0l;
+ m_widLay = 0l;
+ m_emLay = 0l;
}
-Session::Session( const QString& na, QWidget* widget, IOLayer* lay)
+Session::Session( const QString& na, QWidgetStack* widget, IOLayer* lay)
: m_name( na ), m_widget( widget ), m_layer( lay )
{
+ m_widLay = 0l;
+ m_emLay = 0l;
}
Session::~Session() {
delete m_layer;
+ delete m_emLay;
delete m_widget;
+ /* the widget layer should be deleted by the m_widget */
}
QString Session::name()const {
return m_name;
}
-QWidget* Session::widget() {
+QWidgetStack* Session::widgetStack() {
return m_widget;
}
IOLayer* Session::layer() {
return m_layer;
}
+EmulationLayer* Session::emulationLayer() {
+ return m_emLay;
+}
+Widget* Session::emulationWidget() {
+ return m_widLay;
+}
+void Session::connect() {
+ if ( !m_layer || !m_emLay )
+ return;
+
+ QObject::connect(m_layer, SIGNAL(received(const QByteArray&) ),
+ m_emLay, SLOT(onRcvBlock(const QByteArray&) ) );
+ QObject::connect(m_emLay, SIGNAL(sndBlock(const QByteArray&) ),
+ m_layer, SLOT(send(const QByteArray&) ) );
+}
+void Session::disconnect() {
+ if ( !m_layer || !m_emLay )
+ return;
+
+ QObject::disconnect(m_layer, SIGNAL(received(const QByteArray&) ),
+ m_emLay, SLOT(onRcvBlock(const QByteArray&) ) );
+ QObject::disconnect(m_emLay, SIGNAL(sndBlock(const QByteArray&) ),
+ m_layer, SLOT(send(const QByteArray&) ) );
+}
void Session::setName( const QString& na){
m_name = na;
}
-void Session::setWidget( QWidget* wid ) {
+void Session::setWidgetStack( QWidgetStack* wid ) {
delete m_widget;
+ /* the EmulationLayer was destroyed... */
+ delete m_emLay;
m_widget = wid;
}
void Session::setIOLayer( IOLayer* lay ) {
delete m_layer;
m_layer = lay;
}
+void Session::setEmulationLayer( EmulationLayer* lay ) {
+ delete m_emLay;
+ m_emLay = lay;
+}
+void Session::setEmulationWidget( Widget* lay ) {
+ delete m_widLay;
+ m_widLay = lay;
+}