summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/PLANS12
-rw-r--r--noncore/apps/opie-console/default.cpp7
-rw-r--r--noncore/apps/opie-console/default.h4
-rw-r--r--noncore/apps/opie-console/emulation_layer.h2
-rw-r--r--noncore/apps/opie-console/keytrans.cpp3
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp48
-rw-r--r--noncore/apps/opie-console/mainwindow.h4
-rw-r--r--noncore/apps/opie-console/metafactory.cpp25
-rw-r--r--noncore/apps/opie-console/metafactory.h21
-rw-r--r--noncore/apps/opie-console/profilemanager.cpp44
-rw-r--r--noncore/apps/opie-console/profilemanager.h2
-rw-r--r--noncore/apps/opie-console/session.cpp49
-rw-r--r--noncore/apps/opie-console/session.h38
-rw-r--r--noncore/apps/opie-console/tabwidget.cpp21
-rw-r--r--noncore/apps/opie-console/tabwidget.h5
-rw-r--r--noncore/apps/opie-console/vt102emulation.cpp2
-rw-r--r--noncore/apps/opie-console/vt102emulation.h2
17 files changed, 248 insertions, 41 deletions
diff --git a/noncore/apps/opie-console/PLANS b/noncore/apps/opie-console/PLANS
index 8f6b807..0ec45cb 100644
--- a/noncore/apps/opie-console/PLANS
+++ b/noncore/apps/opie-console/PLANS
@@ -1,5 +1,7 @@
1can we please get a working serial connection for now? if that works 1can we please get a working serial connection for now? if that works
2i can test file transfers and stuff. -hash 2i can test file transfers and stuff. -hash
3sure. I finished the ConfigDialog and now doing the Profile->Session
4stuff. Then you just need to click Open -zecke
3 5
4From a UNIX point of view we want to do something like minicom 6From a UNIX point of view we want to do something like minicom
5with a better GUI. 7with a better GUI.
@@ -18,17 +20,19 @@ the future
18Framework 20Framework
19Serial IOLayer 21Serial IOLayer
20Saving and Restoring Profiles 22Saving and Restoring Profiles
23ConfigDialog Framework
24FilesendingLayer - hash
21 25
22TASKS in progress: 26TASKS in progress:
23Profile->Session and MainWidget --- Harlekin 27Profile->Session and MainWidget --- Harlekin
24FilesendingLayer - hash
25IOLayer - wazlaf 28IOLayer - wazlaf
26Configuration - josef
27TE - ibotty 29TE - ibotty
28
29OPEN tasks:
30Session->Profile - hash 30Session->Profile - hash
31Scripting - wazlaf 31Scripting - wazlaf
32
33OPEN tasks:
34Irda ConfigWidget
35BT ConfigWidget
32Keys - open 36Keys - open
33IRDA-Layer - open 37IRDA-Layer - open
34Bluetooth-Layer - open 38Bluetooth-Layer - open
diff --git a/noncore/apps/opie-console/default.cpp b/noncore/apps/opie-console/default.cpp
index d9a0557..da6f3e2 100644
--- a/noncore/apps/opie-console/default.cpp
+++ b/noncore/apps/opie-console/default.cpp
@@ -2,6 +2,7 @@
2#include "sz_transfer.h" 2#include "sz_transfer.h"
3#include "serialconfigwidget.h" 3#include "serialconfigwidget.h"
4#include "terminalwidget.h" 4#include "terminalwidget.h"
5#include "vt102emulation.h"
5 6
6#include "default.h" 7#include "default.h"
7 8
@@ -44,6 +45,11 @@ extern "C" {
44 return new TerminalWidget(na, wid,0 ); 45 return new TerminalWidget(na, wid,0 );
45 } 46 }
46 47
48 // VT Emulations
49 EmulationLayer* newVT102( Widget* wid ) {
50 return new Vt102Emulation( wid );
51 }
52
47}; 53};
48 54
49Default::Default( MetaFactory* fact ) { 55Default::Default( MetaFactory* fact ) {
@@ -61,6 +67,7 @@ Default::Default( MetaFactory* fact ) {
61 67
62 fact->addTerminalWidgetFactory( "default", QObject::tr("Default Terminal"), newTerminalWidget ); 68 fact->addTerminalWidgetFactory( "default", QObject::tr("Default Terminal"), newTerminalWidget );
63 69
70 fact->addEmulationLayer( "default", QObject::tr("Default Terminal"), newVT102 );
64} 71}
65Default::~Default() { 72Default::~Default() {
66 73
diff --git a/noncore/apps/opie-console/default.h b/noncore/apps/opie-console/default.h
index ed78986..b9af898 100644
--- a/noncore/apps/opie-console/default.h
+++ b/noncore/apps/opie-console/default.h
@@ -3,6 +3,8 @@
3 3
4#include "metafactory.h" 4#include "metafactory.h"
5 5
6class Widget;
7
6extern "C" { 8extern "C" {
7 FileTransferLayer* newSZTransfer(IOLayer*); 9 FileTransferLayer* newSZTransfer(IOLayer*);
8 FileTransferLayer* newSYTransfer(IOLayer*); 10 FileTransferLayer* newSYTransfer(IOLayer*);
@@ -17,6 +19,8 @@ extern "C" {
17 ProfileDialogWidget* newBTWidget (const QString&, QWidget* ); 19 ProfileDialogWidget* newBTWidget (const QString&, QWidget* );
18 20
19 ProfileDialogWidget* newTerminalWidget(const QString&, QWidget* ); 21 ProfileDialogWidget* newTerminalWidget(const QString&, QWidget* );
22
23 EmulationLayer* newVT102( Widget* );
20}; 24};
21 25
22class MetaFactory; 26class MetaFactory;
diff --git a/noncore/apps/opie-console/emulation_layer.h b/noncore/apps/opie-console/emulation_layer.h
index 0f54331..5781acc 100644
--- a/noncore/apps/opie-console/emulation_layer.h
+++ b/noncore/apps/opie-console/emulation_layer.h
@@ -26,7 +26,7 @@
26#ifndef EMULATION_LAYER_H 26#ifndef EMULATION_LAYER_H
27#define EMULATION_LAYER_H 27#define EMULATION_LAYER_H
28 28
29#include "widget.h" 29#include "widget_layer.h"
30#include "screen.h" 30#include "screen.h"
31#include <qtimer.h> 31#include <qtimer.h>
32#include <stdio.h> 32#include <stdio.h>
diff --git a/noncore/apps/opie-console/keytrans.cpp b/noncore/apps/opie-console/keytrans.cpp
index d569ae0..5ea192e 100644
--- a/noncore/apps/opie-console/keytrans.cpp
+++ b/noncore/apps/opie-console/keytrans.cpp
@@ -627,18 +627,21 @@ static QDict<KeyTrans> * path2keymap = 0L;
627 627
628KeyTrans* KeyTrans::find(int numb) 628KeyTrans* KeyTrans::find(int numb)
629{ 629{
630 loadAll();
630 KeyTrans* res = numb2keymap->find(numb); 631 KeyTrans* res = numb2keymap->find(numb);
631 return res ? res : numb2keymap->find(0); 632 return res ? res : numb2keymap->find(0);
632} 633}
633 634
634KeyTrans* KeyTrans::find(const char* path) 635KeyTrans* KeyTrans::find(const char* path)
635{ 636{
637 loadAll();
636 KeyTrans* res = path2keymap->find(path); 638 KeyTrans* res = path2keymap->find(path);
637 return res ? res : numb2keymap->find(0); 639 return res ? res : numb2keymap->find(0);
638} 640}
639 641
640int KeyTrans::count() 642int KeyTrans::count()
641{ 643{
644 loadAll();
642 return numb2keymap->count(); 645 return numb2keymap->count();
643} 646}
644 647
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 3531478..aeb3742 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -5,9 +5,11 @@
5#include <qpopupmenu.h> 5#include <qpopupmenu.h>
6#include <qtoolbar.h> 6#include <qtoolbar.h>
7 7
8#include "profileeditordialog.h"
8#include "configdialog.h" 9#include "configdialog.h"
9#include "default.h" 10#include "default.h"
10#include "metafactory.h" 11#include "metafactory.h"
12#include "profile.h"
11#include "profilemanager.h" 13#include "profilemanager.h"
12#include "mainwindow.h" 14#include "mainwindow.h"
13#include "tabwidget.h" 15#include "tabwidget.h"
@@ -109,7 +111,9 @@ void MainWindow::initUI() {
109ProfileManager* MainWindow::manager() { 111ProfileManager* MainWindow::manager() {
110 return m_manager; 112 return m_manager;
111} 113}
112 114TabWidget* MainWindow::tabWidget() {
115 return m_consoleWindow;
116}
113void MainWindow::populateProfiles() { 117void MainWindow::populateProfiles() {
114 m_sessionsPop->clear(); 118 m_sessionsPop->clear();
115 Profile::ValueList list = manager()->all(); 119 Profile::ValueList list = manager()->all();
@@ -137,6 +141,12 @@ QList<Session> MainWindow::sessions() {
137 141
138void MainWindow::slotNew() { 142void MainWindow::slotNew() {
139 qWarning("New Connection"); 143 qWarning("New Connection");
144 ProfileEditorDialog dlg(factory() );
145 int ret = dlg.exec();
146
147 if ( ret == QDialog::Accepted ) {
148 create( dlg.profile() );
149 }
140} 150}
141 151
142void MainWindow::slotConnect() { 152void MainWindow::slotConnect() {
@@ -152,8 +162,8 @@ void MainWindow::slotDisconnect() {
152void MainWindow::slotTerminate() { 162void MainWindow::slotTerminate() {
153 if ( currentSession() ) 163 if ( currentSession() )
154 currentSession()->layer()->close(); 164 currentSession()->layer()->close();
155 delete m_curSession; 165
156 m_curSession = 0l; 166 slotClose();
157 /* FIXME move to the next session */ 167 /* FIXME move to the next session */
158} 168}
159 169
@@ -170,11 +180,37 @@ void MainWindow::slotConfigure() {
170 populateProfiles(); 180 populateProfiles();
171 } 181 }
172} 182}
173 183/*
184 * we will remove
185 * this window from the tabwidget
186 * remove it from the list
187 * delete it
188 * and set the currentSession()
189 */
174void MainWindow::slotClose() { 190void MainWindow::slotClose() {
175} 191 if (!currentSession() )
192 return;
176 193
177void MainWindow::slotProfile( int ) { 194 tabWidget()->remove( currentSession() );
195 tabWidget()->setCurrent( m_sessions.first() );
196 m_sessions.remove( m_curSession );
197 delete m_curSession;
198 m_curSession = m_sessions.first();
199}
178 200
201/*
202 * We will get the name
203 * Then the profile
204 * and then we will make a profile
205 */
206void MainWindow::slotProfile( int id) {
207 Profile prof = manager()->profile( m_sessionsPop->text( id) );
208 create( prof );
209}
210void MainWindow::create( const Profile& prof ) {
211 Session *ses = manager()->fromProfile( prof, tabWidget() );
179 212
213 m_sessions.append( ses );
214 tabWidget()->add( ses );
215 m_curSession = ses;
180} 216}
diff --git a/noncore/apps/opie-console/mainwindow.h b/noncore/apps/opie-console/mainwindow.h
index 36eb3a7..7ef9c26 100644
--- a/noncore/apps/opie-console/mainwindow.h
+++ b/noncore/apps/opie-console/mainwindow.h
@@ -17,7 +17,7 @@ class QAction;
17class MetaFactory; 17class MetaFactory;
18class TabWidget; 18class TabWidget;
19class ProfileManager; 19class ProfileManager;
20 20class Profile;
21class MainWindow : public QMainWindow { 21class MainWindow : public QMainWindow {
22 Q_OBJECT 22 Q_OBJECT
23public: 23public:
@@ -45,6 +45,7 @@ public:
45 * 45 *
46 */ 46 */
47 ProfileManager* manager(); 47 ProfileManager* manager();
48 TabWidget* tabWidget();
48 49
49private slots: 50private slots:
50 void slotNew(); 51 void slotNew();
@@ -58,6 +59,7 @@ private slots:
58private: 59private:
59 void initUI(); 60 void initUI();
60 void populateProfiles(); 61 void populateProfiles();
62 void create( const Profile& );
61 /** 63 /**
62 * the current session 64 * the current session
63 */ 65 */
diff --git a/noncore/apps/opie-console/metafactory.cpp b/noncore/apps/opie-console/metafactory.cpp
index 4501ec2..02a9f9b 100644
--- a/noncore/apps/opie-console/metafactory.cpp
+++ b/noncore/apps/opie-console/metafactory.cpp
@@ -30,6 +30,12 @@ void MetaFactory::addFileTransferLayer( const QCString& name,
30 m_strings.insert(str, name ); 30 m_strings.insert(str, name );
31 m_fileFact.insert( str, lay ); 31 m_fileFact.insert( str, lay );
32} 32}
33void MetaFactory::addEmulationLayer( const QCString& name,
34 const QString& str,
35 emulationLayer em) {
36 m_strings.insert(str, name );
37 m_emu.insert( str, em );
38}
33QStringList MetaFactory::ioLayers()const { 39QStringList MetaFactory::ioLayers()const {
34 QStringList list; 40 QStringList list;
35 QMap<QString, iolayer>::ConstIterator it; 41 QMap<QString, iolayer>::ConstIterator it;
@@ -62,6 +68,14 @@ QStringList MetaFactory::fileTransferLayers()const {
62 } 68 }
63 return list; 69 return list;
64} 70}
71QStringList MetaFactory::emulationLayers()const {
72 QStringList list;
73 QMap<QString, emulationLayer>::ConstIterator it;
74 for ( it = m_emu.begin(); it != m_emu.end(); ++it ) {
75 list << it.key();
76 }
77 return list;
78}
65 79
66IOLayer* MetaFactory::newIOLayer( const QString& str,const Profile& prof ) { 80IOLayer* MetaFactory::newIOLayer( const QString& str,const Profile& prof ) {
67 IOLayer* lay = 0l; 81 IOLayer* lay = 0l;
@@ -101,6 +115,17 @@ ProfileDialogWidget *MetaFactory::newTerminalPlugin( const QString& str, QWidget
101 } 115 }
102 return wid; 116 return wid;
103} 117}
118EmulationLayer* MetaFactory::newEmulationLayer( const QString& str, Widget* wid) {
119 EmulationLayer* lay = 0l;
120
121 QMap<QString, emulationLayer>::Iterator it;
122 it = m_emu.find( str );
123 if ( it != m_emu.end() ) {
124 lay = (*(it.data() ) )(wid);
125 }
126
127 return lay;
128}
104QCString MetaFactory::internal( const QString& str )const { 129QCString MetaFactory::internal( const QString& str )const {
105 return m_strings[str]; 130 return m_strings[str];
106} 131}
diff --git a/noncore/apps/opie-console/metafactory.h b/noncore/apps/opie-console/metafactory.h
index 3f7ddce..71c35a2 100644
--- a/noncore/apps/opie-console/metafactory.h
+++ b/noncore/apps/opie-console/metafactory.h
@@ -15,12 +15,15 @@
15#include "file_layer.h" 15#include "file_layer.h"
16#include "profile.h" 16#include "profile.h"
17#include "profiledialogwidget.h" 17#include "profiledialogwidget.h"
18#include "emulation_layer.h"
18 19
20class Widget;
19class MetaFactory { 21class MetaFactory {
20public: 22public:
21 typedef ProfileDialogWidget* (*configWidget)(const QString&, QWidget* parent); 23 typedef ProfileDialogWidget* (*configWidget)(const QString&, QWidget* parent);
22 typedef IOLayer* (*iolayer)(const Profile& ); 24 typedef IOLayer* (*iolayer)(const Profile& );
23 typedef FileTransferLayer* (*filelayer)(IOLayer*); 25 typedef FileTransferLayer* (*filelayer)(IOLayer*);
26 typedef EmulationLayer* (*emulationLayer)(Widget* );
24 27
25 MetaFactory(); 28 MetaFactory();
26 ~MetaFactory(); 29 ~MetaFactory();
@@ -50,14 +53,31 @@ public:
50 const QString&, 53 const QString&,
51 filelayer ); 54 filelayer );
52 55
56 /**
57 * adds a Factory for Emulation to the Layer..
58 */
59 void addEmulationLayer ( const QCString& name,
60 const QString& uiString,
61 emulationLayer );
62
53 /* translated UI Strings */ 63 /* translated UI Strings */
54 QStringList ioLayers()const; 64 QStringList ioLayers()const;
55 QStringList connectionWidgets()const; 65 QStringList connectionWidgets()const;
66
67 /**
68 * Terminal Configuration widgets
69 */
56 QStringList terminalWidgets()const; 70 QStringList terminalWidgets()const;
57 QStringList fileTransferLayers()const; 71 QStringList fileTransferLayers()const;
72 QStringList emulationLayers()const;
73
74 /**
75 * the generation...
76 */
58 IOLayer* newIOLayer( const QString&,const Profile& ); 77 IOLayer* newIOLayer( const QString&,const Profile& );
59 ProfileDialogWidget *newConnectionPlugin ( const QString&, QWidget* ); 78 ProfileDialogWidget *newConnectionPlugin ( const QString&, QWidget* );
60 ProfileDialogWidget* newTerminalPlugin( const QString&, QWidget* ); 79 ProfileDialogWidget* newTerminalPlugin( const QString&, QWidget* );
80 EmulationLayer* newEmulationLayer(const QString&, Widget* );
61 81
62 /* 82 /*
63 * internal takes the maybe translated 83 * internal takes the maybe translated
@@ -79,6 +99,7 @@ private:
79 QMap<QString, configWidget> m_termFact; 99 QMap<QString, configWidget> m_termFact;
80 QMap<QString, iolayer> m_layerFact; 100 QMap<QString, iolayer> m_layerFact;
81 QMap<QString, filelayer> m_fileFact; 101 QMap<QString, filelayer> m_fileFact;
102 QMap<QString, emulationLayer> m_emu;
82}; 103};
83 104
84 105
diff --git a/noncore/apps/opie-console/profilemanager.cpp b/noncore/apps/opie-console/profilemanager.cpp
index e66ebcc..dcf3cbd 100644
--- a/noncore/apps/opie-console/profilemanager.cpp
+++ b/noncore/apps/opie-console/profilemanager.cpp
@@ -2,9 +2,12 @@
2#include <stdlib.h> 2#include <stdlib.h>
3 3
4#include <qfile.h> 4#include <qfile.h>
5#include <qlayout.h>
6#include <qwidgetstack.h>
5 7
6#include <qpe/config.h> 8#include <qpe/config.h>
7 9
10#include "widget.h"
8#include "metafactory.h" 11#include "metafactory.h"
9#include "profileconfig.h" 12#include "profileconfig.h"
10#include "profilemanager.h" 13#include "profilemanager.h"
@@ -51,17 +54,40 @@ void ProfileManager::clear() {
51Profile::ValueList ProfileManager::all()const { 54Profile::ValueList ProfileManager::all()const {
52 return m_list; 55 return m_list;
53} 56}
54Session* ProfileManager::fromProfile( const Profile& prof) { 57/*
58 * Our goal is to create a Session
59 * We will load the the IOLayer and EmulationLayer
60 * from the factory
61 * we will generate a QWidgetStack
62 * add a dummy widget with layout
63 * add "Widget" to the layout
64 * add the dummy to the stack
65 * raise the dummy
66 * call session->connect(=
67 * this way we only need to reparent
68 * in TabWidget
69 */
70Session* ProfileManager::fromProfile( const Profile& prof, QWidget* parent) {
55 Session* session = new Session(); 71 Session* session = new Session();
56 session->setName( prof.name() ); 72 session->setName( prof.name() );
57 session->setIOLayer(m_fact->newIOLayer(prof.ioLayerName(), 73 /* translate the internal name to the external */
58 prof) ); 74 session->setIOLayer(m_fact->newIOLayer( m_fact->external(prof.ioLayerName()) ,
59 /* 75 prof) );
60 * FIXME 76
61 * load emulation 77 QWidgetStack *stack = new QWidgetStack(parent);
62 * load widget? 78 session->setWidgetStack( stack );
63 * set colors + fonts 79 QWidget* dummy = new QWidget(stack );
64 */ 80 QHBoxLayout* lay = new QHBoxLayout(dummy );
81 stack->addWidget( dummy, 0 );
82 stack->raiseWidget( 0 );
83 Widget* wid = new Widget(dummy );
84 lay->addWidget( wid );
85
86 session->setEmulationWidget( wid );
87 session->setEmulationLayer( m_fact->newEmulationLayer( m_fact->external( prof.terminalName() ),
88 wid ) );
89 session->connect();
90
65 return session; 91 return session;
66} 92}
67void ProfileManager::save( ) { 93void ProfileManager::save( ) {
diff --git a/noncore/apps/opie-console/profilemanager.h b/noncore/apps/opie-console/profilemanager.h
index 1387247..33b7095 100644
--- a/noncore/apps/opie-console/profilemanager.h
+++ b/noncore/apps/opie-console/profilemanager.h
@@ -22,7 +22,7 @@ public:
22 void add( const Profile& prof ); 22 void add( const Profile& prof );
23 void remove( const Profile& prof ); 23 void remove( const Profile& prof );
24 Profile profile(const QString& name )const; 24 Profile profile(const QString& name )const;
25 Session* fromProfile( const Profile& ); 25 Session* fromProfile( const Profile& , QWidget* parent = 0l);
26 void setProfiles( const Profile::ValueList& ); 26 void setProfiles( const Profile::ValueList& );
27 void save(); 27 void save();
28private: 28private:
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 @@
2 2
3#include "io_layer.h" 3#include "io_layer.h"
4#include "file_layer.h" 4#include "file_layer.h"
5#include "widget.h"
6#include "emulation_layer.h"
5#include "session.h" 7#include "session.h"
6 8
9
7Session::Session() { 10Session::Session() {
8 m_widget = 0l; 11 m_widget = 0l;
9 m_layer = 0l; 12 m_layer = 0l;
13 m_widLay = 0l;
14 m_emLay = 0l;
10} 15}
11Session::Session( const QString& na, QWidget* widget, IOLayer* lay) 16Session::Session( const QString& na, QWidgetStack* widget, IOLayer* lay)
12 : m_name( na ), m_widget( widget ), m_layer( lay ) 17 : m_name( na ), m_widget( widget ), m_layer( lay )
13{ 18{
19 m_widLay = 0l;
20 m_emLay = 0l;
14} 21}
15Session::~Session() { 22Session::~Session() {
16 delete m_layer; 23 delete m_layer;
24 delete m_emLay;
17 delete m_widget; 25 delete m_widget;
26 /* the widget layer should be deleted by the m_widget */
18} 27}
19QString Session::name()const { 28QString Session::name()const {
20 return m_name; 29 return m_name;
21} 30}
22QWidget* Session::widget() { 31QWidgetStack* Session::widgetStack() {
23 return m_widget; 32 return m_widget;
24} 33}
25IOLayer* Session::layer() { 34IOLayer* Session::layer() {
26 return m_layer; 35 return m_layer;
27} 36}
37EmulationLayer* Session::emulationLayer() {
38 return m_emLay;
39}
40Widget* Session::emulationWidget() {
41 return m_widLay;
42}
43void Session::connect() {
44 if ( !m_layer || !m_emLay )
45 return;
46
47 QObject::connect(m_layer, SIGNAL(received(const QByteArray&) ),
48 m_emLay, SLOT(onRcvBlock(const QByteArray&) ) );
49 QObject::connect(m_emLay, SIGNAL(sndBlock(const QByteArray&) ),
50 m_layer, SLOT(send(const QByteArray&) ) );
51}
52void Session::disconnect() {
53 if ( !m_layer || !m_emLay )
54 return;
55
56 QObject::disconnect(m_layer, SIGNAL(received(const QByteArray&) ),
57 m_emLay, SLOT(onRcvBlock(const QByteArray&) ) );
58 QObject::disconnect(m_emLay, SIGNAL(sndBlock(const QByteArray&) ),
59 m_layer, SLOT(send(const QByteArray&) ) );
60}
28void Session::setName( const QString& na){ 61void Session::setName( const QString& na){
29 m_name = na; 62 m_name = na;
30} 63}
31void Session::setWidget( QWidget* wid ) { 64void Session::setWidgetStack( QWidgetStack* wid ) {
32 delete m_widget; 65 delete m_widget;
66 /* the EmulationLayer was destroyed... */
67 delete m_emLay;
33 m_widget = wid; 68 m_widget = wid;
34} 69}
35void Session::setIOLayer( IOLayer* lay ) { 70void Session::setIOLayer( IOLayer* lay ) {
36 delete m_layer; 71 delete m_layer;
37 m_layer = lay; 72 m_layer = lay;
38} 73}
74void Session::setEmulationLayer( EmulationLayer* lay ) {
75 delete m_emLay;
76 m_emLay = lay;
77}
78void Session::setEmulationWidget( Widget* lay ) {
79 delete m_widLay;
80 m_widLay = lay;
81}
diff --git a/noncore/apps/opie-console/session.h b/noncore/apps/opie-console/session.h
index 44b5fc8..c3673fc 100644
--- a/noncore/apps/opie-console/session.h
+++ b/noncore/apps/opie-console/session.h
@@ -1,9 +1,11 @@
1#ifndef OPIE_SESSION_H 1#ifndef OPIE_SESSION_H
2#define OPIE_SESSION_H 2#define OPIE_SESSION_H
3 3
4#include <qwidget.h> 4#include <qwidgetstack.h>
5 5
6class IOLayer; 6class IOLayer;
7class EmulationLayer;
8class Widget;
7/** 9/**
8 * This is a Session. A session contains 10 * This is a Session. A session contains
9 * a QWidget pointer and a IOLayer 11 * a QWidget pointer and a IOLayer
@@ -17,7 +19,7 @@ public:
17 * ownership get's transfered 19 * ownership get's transfered
18 */ 20 */
19 Session(); 21 Session();
20 Session( const QString&, QWidget* widget, IOLayer* ); 22 Session( const QString&, QWidgetStack* widget, IOLayer* );
21 ~Session(); 23 ~Session();
22 24
23 /** 25 /**
@@ -26,22 +28,46 @@ public:
26 QString name()const; 28 QString name()const;
27 29
28 /** 30 /**
29 * return the widget 31 * return the widgetstack
32 * this is used to be semi modal
33 * for FileTransfer
34 *
35 * semi modal == SessionModal
30 */ 36 */
31 QWidget* widget(); 37 QWidgetStack* widgetStack();
32 38
33 /** 39 /**
34 * return the layer 40 * return the layer
35 */ 41 */
36 IOLayer* layer(); 42 IOLayer* layer();
37 void setWidget( QWidget* widget ); 43
44 EmulationLayer* emulationLayer();
45 Widget* emulationWidget();
46
47 /*
48 * connects the data flow from
49 * the IOLayer to the EmulationLayer
50 */
51 void connect();
52
53 /*
54 * disconnect the dataflow
55 * this will be done for ft
56 */
57 void disconnect();
58
59 void setWidgetStack( QWidgetStack* widget );
60 void setEmulationLayer( EmulationLayer* lay );
61 void setEmulationWidget( Widget* lay );
38 void setIOLayer( IOLayer* ); 62 void setIOLayer( IOLayer* );
39 void setName( const QString& ); 63 void setName( const QString& );
40 64
41private: 65private:
42 QString m_name; 66 QString m_name;
43 QWidget* m_widget; 67 QWidgetStack* m_widget;
44 IOLayer* m_layer; 68 IOLayer* m_layer;
69 EmulationLayer* m_emLay;
70 Widget* m_widLay;
45 71
46}; 72};
47 73
diff --git a/noncore/apps/opie-console/tabwidget.cpp b/noncore/apps/opie-console/tabwidget.cpp
index 783bf13..cfaef91 100644
--- a/noncore/apps/opie-console/tabwidget.cpp
+++ b/noncore/apps/opie-console/tabwidget.cpp
@@ -2,7 +2,7 @@
2#include "tabwidget.h" 2#include "tabwidget.h"
3 3
4TabWidget::TabWidget( QWidget* parent, const char* name ) 4TabWidget::TabWidget( QWidget* parent, const char* name )
5 : OTabWidget( parent, name ) { 5 : QTabWidget( parent, name ) {
6 connect(this, SIGNAL( currentChanged(QWidget*) ), 6 connect(this, SIGNAL( currentChanged(QWidget*) ),
7 this, SLOT( slotCurChanged(QWidget*) ) ); 7 this, SLOT( slotCurChanged(QWidget*) ) );
8} 8}
@@ -11,14 +11,17 @@ TabWidget::~TabWidget() {
11} 11}
12 12
13void TabWidget::add( Session* ses ) { 13void TabWidget::add( Session* ses ) {
14 if ( !ses->widget() ) return; 14 if ( !ses->widgetStack() ) return;
15 addTab( ses->widget(), "console/konsole", ses->name() ); 15 qWarning("going to add it");
16 m_map.insert( ses->widget(), ses ); 16 //reparent( ses->widgetStack(), QPoint() );
17 //addTab( ses->widgetStack(), "console/konsole", ses->name() );
18 addTab( ses->widgetStack(), ses->name() );
19 m_map.insert( ses->widgetStack(), ses );
17} 20}
18 21
19void TabWidget::remove( Session* ses ) { 22void TabWidget::remove( Session* ses ) {
20 m_map.remove( ses->widget() ); 23 m_map.remove( ses->widgetStack() );
21 removePage( ses->widget() ); 24 removePage( ses->widgetStack() );
22} 25}
23 26
24void TabWidget::slotCurChanged( QWidget* wid ) { 27void TabWidget::slotCurChanged( QWidget* wid ) {
@@ -30,5 +33,11 @@ void TabWidget::slotCurChanged( QWidget* wid ) {
30 33
31 emit activated( it.data() ); 34 emit activated( it.data() );
32} 35}
36void TabWidget::setCurrent( Session* ses ) {
37 if (!ses )
38 return;
39
40 showPage( ses->widgetStack() );
41}
33 42
34 43
diff --git a/noncore/apps/opie-console/tabwidget.h b/noncore/apps/opie-console/tabwidget.h
index a701488..42a00ec 100644
--- a/noncore/apps/opie-console/tabwidget.h
+++ b/noncore/apps/opie-console/tabwidget.h
@@ -2,20 +2,21 @@
2#define OPIE_TAB_WIDGET_H 2#define OPIE_TAB_WIDGET_H
3 3
4#include <qmap.h> 4#include <qmap.h>
5#include <opie/otabwidget.h> 5#include <qtabwidget.h>
6 6
7#include "session.h" 7#include "session.h"
8/** 8/**
9 * This is our central tab widget 9 * This is our central tab widget
10 * we can add sessions here 10 * we can add sessions here
11 */ 11 */
12class TabWidget : public OTabWidget{ 12class TabWidget : public QTabWidget{
13 Q_OBJECT 13 Q_OBJECT
14public: 14public:
15 TabWidget(QWidget *parent, const char* name ); 15 TabWidget(QWidget *parent, const char* name );
16 ~TabWidget(); 16 ~TabWidget();
17 void add( Session* ); 17 void add( Session* );
18 void remove( Session* ); 18 void remove( Session* );
19 void setCurrent( Session* );
19 20
20signals: 21signals:
21 void activated(Session* ses ); 22 void activated(Session* ses );
diff --git a/noncore/apps/opie-console/vt102emulation.cpp b/noncore/apps/opie-console/vt102emulation.cpp
index dc977f5..2220f4e 100644
--- a/noncore/apps/opie-console/vt102emulation.cpp
+++ b/noncore/apps/opie-console/vt102emulation.cpp
@@ -622,7 +622,7 @@ void Vt102Emulation::sendString(const char* s)
622 emit sndBlock( tmp); 622 emit sndBlock( tmp);
623} 623}
624 624
625void Vt102Emulation::sendString(const QByteArray s) 625void Vt102Emulation::sendString(const QByteArray& s)
626{ 626{
627 emit sndBlock( s ); 627 emit sndBlock( s );
628} 628}
diff --git a/noncore/apps/opie-console/vt102emulation.h b/noncore/apps/opie-console/vt102emulation.h
index 018835e..a3d0ae6 100644
--- a/noncore/apps/opie-console/vt102emulation.h
+++ b/noncore/apps/opie-console/vt102emulation.h
@@ -86,7 +86,7 @@ public:
86 /** 86 /**
87 * sends a list of bytes to the IOLayer 87 * sends a list of bytes to the IOLayer
88 */ 88 */
89 void sendString(const QByteArray); 89 void sendString(const QByteArray&);
90 90
91 /** 91 /**
92 * @deprecated use QByteArray instead 92 * @deprecated use QByteArray instead