author | ibotty <ibotty> | 2002-10-11 17:43:18 (UTC) |
---|---|---|
committer | ibotty <ibotty> | 2002-10-11 17:43:18 (UTC) |
commit | 01f26248efccbd764e7c82b74372f33a4bbae303 (patch) (unidiff) | |
tree | a13712dabfa9aaeb7d9ad9353e434b8976234836 | |
parent | 00005567e4841af1f0efe090160881b286574493 (diff) | |
download | opie-01f26248efccbd764e7c82b74372f33a4bbae303.zip opie-01f26248efccbd764e7c82b74372f33a4bbae303.tar.gz opie-01f26248efccbd764e7c82b74372f33a4bbae303.tar.bz2 |
changed references to widget into references to widgetLayer or EmulationWidget.
-rw-r--r-- | noncore/apps/opie-console/metafactory.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/metafactory.h | 6 | ||||
-rw-r--r-- | noncore/apps/opie-console/profilemanager.cpp | 5 | ||||
-rw-r--r-- | noncore/apps/opie-console/session.cpp | 6 | ||||
-rw-r--r-- | noncore/apps/opie-console/session.h | 8 | ||||
-rw-r--r-- | noncore/apps/opie-console/widget.cpp | 12 | ||||
-rw-r--r-- | noncore/apps/opie-console/widget_layer.h | 3 |
7 files changed, 23 insertions, 19 deletions
diff --git a/noncore/apps/opie-console/metafactory.cpp b/noncore/apps/opie-console/metafactory.cpp index 02a9f9b..2b672cf 100644 --- a/noncore/apps/opie-console/metafactory.cpp +++ b/noncore/apps/opie-console/metafactory.cpp | |||
@@ -112,13 +112,13 @@ ProfileDialogWidget *MetaFactory::newTerminalPlugin( const QString& str, QWidget | |||
112 | it = m_termFact.find( str ); | 112 | it = m_termFact.find( str ); |
113 | if ( it != m_termFact.end() ) { | 113 | if ( it != m_termFact.end() ) { |
114 | wid = (*(it.data() ) )(str,parent); | 114 | wid = (*(it.data() ) )(str,parent); |
115 | } | 115 | } |
116 | return wid; | 116 | return wid; |
117 | } | 117 | } |
118 | EmulationLayer* MetaFactory::newEmulationLayer( const QString& str, Widget* wid) { | 118 | EmulationLayer* MetaFactory::newEmulationLayer( const QString& str, WidgetLayer* wid) { |
119 | EmulationLayer* lay = 0l; | 119 | EmulationLayer* lay = 0l; |
120 | 120 | ||
121 | QMap<QString, emulationLayer>::Iterator it; | 121 | QMap<QString, emulationLayer>::Iterator it; |
122 | it = m_emu.find( str ); | 122 | it = m_emu.find( str ); |
123 | if ( it != m_emu.end() ) { | 123 | if ( it != m_emu.end() ) { |
124 | lay = (*(it.data() ) )(wid); | 124 | lay = (*(it.data() ) )(wid); |
diff --git a/noncore/apps/opie-console/metafactory.h b/noncore/apps/opie-console/metafactory.h index 71c35a2..d05ece4 100644 --- a/noncore/apps/opie-console/metafactory.h +++ b/noncore/apps/opie-console/metafactory.h | |||
@@ -14,19 +14,19 @@ | |||
14 | #include "io_layer.h" | 14 | #include "io_layer.h" |
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 | #include "emulation_layer.h" |
19 | 19 | ||
20 | class Widget; | 20 | class WidgetLayer; |
21 | class MetaFactory { | 21 | class MetaFactory { |
22 | public: | 22 | public: |
23 | typedef ProfileDialogWidget* (*configWidget)(const QString&, QWidget* parent); | 23 | typedef ProfileDialogWidget* (*configWidget)(const QString&, QWidget* parent); |
24 | typedef IOLayer* (*iolayer)(const Profile& ); | 24 | typedef IOLayer* (*iolayer)(const Profile& ); |
25 | typedef FileTransferLayer* (*filelayer)(IOLayer*); | 25 | typedef FileTransferLayer* (*filelayer)(IOLayer*); |
26 | typedef EmulationLayer* (*emulationLayer)(Widget* ); | 26 | typedef EmulationLayer* (*emulationLayer)(WidgetLayer* ); |
27 | 27 | ||
28 | MetaFactory(); | 28 | MetaFactory(); |
29 | ~MetaFactory(); | 29 | ~MetaFactory(); |
30 | 30 | ||
31 | /** | 31 | /** |
32 | * add a ProfileDialogWidget to the factory | 32 | * add a ProfileDialogWidget to the factory |
@@ -74,13 +74,13 @@ public: | |||
74 | /** | 74 | /** |
75 | * the generation... | 75 | * the generation... |
76 | */ | 76 | */ |
77 | IOLayer* newIOLayer( const QString&,const Profile& ); | 77 | IOLayer* newIOLayer( const QString&,const Profile& ); |
78 | ProfileDialogWidget *newConnectionPlugin ( const QString&, QWidget* ); | 78 | ProfileDialogWidget *newConnectionPlugin ( const QString&, QWidget* ); |
79 | ProfileDialogWidget* newTerminalPlugin( const QString&, QWidget* ); | 79 | ProfileDialogWidget* newTerminalPlugin( const QString&, QWidget* ); |
80 | EmulationLayer* newEmulationLayer(const QString&, Widget* ); | 80 | EmulationLayer* newEmulationLayer(const QString&, WidgetLayer* ); |
81 | 81 | ||
82 | /* | 82 | /* |
83 | * internal takes the maybe translated | 83 | * internal takes the maybe translated |
84 | * public QString and maps it to the internal | 84 | * public QString and maps it to the internal |
85 | * not translatable QCString | 85 | * not translatable QCString |
86 | */ | 86 | */ |
diff --git a/noncore/apps/opie-console/profilemanager.cpp b/noncore/apps/opie-console/profilemanager.cpp index dcf3cbd..78751e7 100644 --- a/noncore/apps/opie-console/profilemanager.cpp +++ b/noncore/apps/opie-console/profilemanager.cpp | |||
@@ -4,13 +4,14 @@ | |||
4 | #include <qfile.h> | 4 | #include <qfile.h> |
5 | #include <qlayout.h> | 5 | #include <qlayout.h> |
6 | #include <qwidgetstack.h> | 6 | #include <qwidgetstack.h> |
7 | 7 | ||
8 | #include <qpe/config.h> | 8 | #include <qpe/config.h> |
9 | 9 | ||
10 | #include "widget.h" | 10 | #include "widget_layer.h" |
11 | #include "emulation_widget.h" | ||
11 | #include "metafactory.h" | 12 | #include "metafactory.h" |
12 | #include "profileconfig.h" | 13 | #include "profileconfig.h" |
13 | #include "profilemanager.h" | 14 | #include "profilemanager.h" |
14 | 15 | ||
15 | ProfileManager::ProfileManager( MetaFactory* fact ) | 16 | ProfileManager::ProfileManager( MetaFactory* fact ) |
16 | : m_fact( fact ) | 17 | : m_fact( fact ) |
@@ -77,13 +78,13 @@ Session* ProfileManager::fromProfile( const Profile& prof, QWidget* parent) { | |||
77 | QWidgetStack *stack = new QWidgetStack(parent); | 78 | QWidgetStack *stack = new QWidgetStack(parent); |
78 | session->setWidgetStack( stack ); | 79 | session->setWidgetStack( stack ); |
79 | QWidget* dummy = new QWidget(stack ); | 80 | QWidget* dummy = new QWidget(stack ); |
80 | QHBoxLayout* lay = new QHBoxLayout(dummy ); | 81 | QHBoxLayout* lay = new QHBoxLayout(dummy ); |
81 | stack->addWidget( dummy, 0 ); | 82 | stack->addWidget( dummy, 0 ); |
82 | stack->raiseWidget( 0 ); | 83 | stack->raiseWidget( 0 ); |
83 | Widget* wid = new Widget(dummy ); | 84 | WidgetLayer* wid = new EmulationWidget( prof, dummy ); |
84 | lay->addWidget( wid ); | 85 | lay->addWidget( wid ); |
85 | 86 | ||
86 | session->setEmulationWidget( wid ); | 87 | session->setEmulationWidget( wid ); |
87 | session->setEmulationLayer( m_fact->newEmulationLayer( m_fact->external( prof.terminalName() ), | 88 | session->setEmulationLayer( m_fact->newEmulationLayer( m_fact->external( prof.terminalName() ), |
88 | wid ) ); | 89 | wid ) ); |
89 | session->connect(); | 90 | session->connect(); |
diff --git a/noncore/apps/opie-console/session.cpp b/noncore/apps/opie-console/session.cpp index 42b0583..ff2c3e2 100644 --- a/noncore/apps/opie-console/session.cpp +++ b/noncore/apps/opie-console/session.cpp | |||
@@ -1,11 +1,11 @@ | |||
1 | 1 | ||
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" | 5 | #include "widget_layer.h" |
6 | #include "emulation_layer.h" | 6 | #include "emulation_layer.h" |
7 | #include "session.h" | 7 | #include "session.h" |
8 | 8 | ||
9 | 9 | ||
10 | Session::Session() { | 10 | Session::Session() { |
11 | m_widget = 0l; | 11 | m_widget = 0l; |
@@ -34,13 +34,13 @@ QWidgetStack* Session::widgetStack() { | |||
34 | IOLayer* Session::layer() { | 34 | IOLayer* Session::layer() { |
35 | return m_layer; | 35 | return m_layer; |
36 | } | 36 | } |
37 | EmulationLayer* Session::emulationLayer() { | 37 | EmulationLayer* Session::emulationLayer() { |
38 | return m_emLay; | 38 | return m_emLay; |
39 | } | 39 | } |
40 | Widget* Session::emulationWidget() { | 40 | WidgetLayer* Session::emulationWidget() { |
41 | return m_widLay; | 41 | return m_widLay; |
42 | } | 42 | } |
43 | void Session::connect() { | 43 | void Session::connect() { |
44 | if ( !m_layer || !m_emLay ) | 44 | if ( !m_layer || !m_emLay ) |
45 | return; | 45 | return; |
46 | 46 | ||
@@ -72,10 +72,10 @@ void Session::setIOLayer( IOLayer* lay ) { | |||
72 | m_layer = lay; | 72 | m_layer = lay; |
73 | } | 73 | } |
74 | void Session::setEmulationLayer( EmulationLayer* lay ) { | 74 | void Session::setEmulationLayer( EmulationLayer* lay ) { |
75 | delete m_emLay; | 75 | delete m_emLay; |
76 | m_emLay = lay; | 76 | m_emLay = lay; |
77 | } | 77 | } |
78 | void Session::setEmulationWidget( Widget* lay ) { | 78 | void Session::setEmulationWidget( WidgetLayer* lay ) { |
79 | delete m_widLay; | 79 | delete m_widLay; |
80 | m_widLay = lay; | 80 | m_widLay = lay; |
81 | } | 81 | } |
diff --git a/noncore/apps/opie-console/session.h b/noncore/apps/opie-console/session.h index c3673fc..64c2cdb 100644 --- a/noncore/apps/opie-console/session.h +++ b/noncore/apps/opie-console/session.h | |||
@@ -2,13 +2,13 @@ | |||
2 | #define OPIE_SESSION_H | 2 | #define OPIE_SESSION_H |
3 | 3 | ||
4 | #include <qwidgetstack.h> | 4 | #include <qwidgetstack.h> |
5 | 5 | ||
6 | class IOLayer; | 6 | class IOLayer; |
7 | class EmulationLayer; | 7 | class EmulationLayer; |
8 | class Widget; | 8 | class WidgetLayer; |
9 | /** | 9 | /** |
10 | * This is a Session. A session contains | 10 | * This is a Session. A session contains |
11 | * a QWidget pointer and a IOLayer | 11 | * a QWidget pointer and a IOLayer |
12 | * Imagine a session like a collection of what | 12 | * Imagine a session like a collection of what |
13 | * is needed to show your widget in a tab ;) | 13 | * is needed to show your widget in a tab ;) |
14 | */ | 14 | */ |
@@ -39,13 +39,13 @@ public: | |||
39 | /** | 39 | /** |
40 | * return the layer | 40 | * return the layer |
41 | */ | 41 | */ |
42 | IOLayer* layer(); | 42 | IOLayer* layer(); |
43 | 43 | ||
44 | EmulationLayer* emulationLayer(); | 44 | EmulationLayer* emulationLayer(); |
45 | Widget* emulationWidget(); | 45 | WidgetLayer* emulationWidget(); |
46 | 46 | ||
47 | /* | 47 | /* |
48 | * connects the data flow from | 48 | * connects the data flow from |
49 | * the IOLayer to the EmulationLayer | 49 | * the IOLayer to the EmulationLayer |
50 | */ | 50 | */ |
51 | void connect(); | 51 | void connect(); |
@@ -55,20 +55,20 @@ public: | |||
55 | * this will be done for ft | 55 | * this will be done for ft |
56 | */ | 56 | */ |
57 | void disconnect(); | 57 | void disconnect(); |
58 | 58 | ||
59 | void setWidgetStack( QWidgetStack* widget ); | 59 | void setWidgetStack( QWidgetStack* widget ); |
60 | void setEmulationLayer( EmulationLayer* lay ); | 60 | void setEmulationLayer( EmulationLayer* lay ); |
61 | void setEmulationWidget( Widget* lay ); | 61 | void setEmulationWidget( WidgetLayer* lay ); |
62 | void setIOLayer( IOLayer* ); | 62 | void setIOLayer( IOLayer* ); |
63 | void setName( const QString& ); | 63 | void setName( const QString& ); |
64 | 64 | ||
65 | private: | 65 | private: |
66 | QString m_name; | 66 | QString m_name; |
67 | QWidgetStack* m_widget; | 67 | QWidgetStack* m_widget; |
68 | IOLayer* m_layer; | 68 | IOLayer* m_layer; |
69 | EmulationLayer* m_emLay; | 69 | EmulationLayer* m_emLay; |
70 | Widget* m_widLay; | 70 | WidgetLayer* m_widLay; |
71 | 71 | ||
72 | }; | 72 | }; |
73 | 73 | ||
74 | #endif | 74 | #endif |
diff --git a/noncore/apps/opie-console/widget.cpp b/noncore/apps/opie-console/widget.cpp index b8f2906..d948179 100644 --- a/noncore/apps/opie-console/widget.cpp +++ b/noncore/apps/opie-console/widget.cpp | |||
@@ -18,12 +18,13 @@ | |||
18 | 18 | ||
19 | /* ibot: | 19 | /* ibot: |
20 | i changed | 20 | i changed |
21 | "currentSession->getEmulation()->sendString()" to | 21 | "currentSession->getEmulation()->sendString()" to |
22 | "currentSession->layer()->send()" | 22 | "currentSession->layer()->send()" |
23 | # this is not right! EmulationLayer should send it... | 23 | # this is not right! EmulationLayer should send it... |
24 | i changed all those to use emulationLayer()->send() instead | ||
24 | i had to create a QByteArray before... | 25 | i had to create a QByteArray before... |
25 | 26 | ||
26 | TODO: | 27 | TODO: |
27 | alter Widget to use only QByteArray, where applicable. | 28 | alter Widget to use only QByteArray, where applicable. |
28 | */ | 29 | */ |
29 | 30 | ||
@@ -1227,24 +1228,25 @@ void Widget::dropEvent(QDropEvent* event) | |||
1227 | else | 1228 | else |
1228 | { | 1229 | { |
1229 | if (currentSession) { | 1230 | if (currentSession) { |
1230 | //currentSession->getEmulation()->sendString(dropText.local8Bit()); | 1231 | //currentSession->getEmulation()->sendString(dropText.local8Bit()); |
1231 | QByteArray tmp; | 1232 | QByteArray tmp; |
1232 | // ibot: this should be pretty wrong... | 1233 | // ibot: this should be pretty wrong... |
1233 | currentSession->layer()->send( tmp.setRawData( dropText.local8Bit())); | 1234 | // now it sends to the right layer |
1235 | currentSession-> emulationLayer()->send( tmp.setRawData( dropText.local8Bit())); | ||
1234 | } | 1236 | } |
1235 | // kdDebug() << "Drop:" << dropText.local8Bit() << "\n"; | 1237 | // kdDebug() << "Drop:" << dropText.local8Bit() << "\n"; |
1236 | } | 1238 | } |
1237 | } | 1239 | } |
1238 | } | 1240 | } |
1239 | else if(QTextDrag::decode(event, dropText)) { | 1241 | else if(QTextDrag::decode(event, dropText)) { |
1240 | // kdDebug() << "Drop:" << dropText.local8Bit() << "\n"; | 1242 | // kdDebug() << "Drop:" << dropText.local8Bit() << "\n"; |
1241 | if (currentSession) { | 1243 | if (currentSession) { |
1242 | //currentSession->getEmulation()->sendString(dropText.local8Bit()); | 1244 | //currentSession->getEmulation()->sendString(dropText.local8Bit()); |
1243 | QByteArray tmp; | 1245 | QByteArray tmp; |
1244 | currentSession->layer()->send( tmp.setRawData( dropText.local8Bit())); | 1246 | currentSession->emulationLayer()->send( tmp.setRawData( dropText.local8Bit())); |
1245 | } | 1247 | } |
1246 | // Paste it | 1248 | // Paste it |
1247 | } | 1249 | } |
1248 | } | 1250 | } |
1249 | #endif | 1251 | #endif |
1250 | 1252 | ||
@@ -1254,20 +1256,20 @@ void Widget::drop_menu_activated(int item) | |||
1254 | #ifndef QT_NO_DRAGANDDROP | 1256 | #ifndef QT_NO_DRAGANDDROP |
1255 | QByteArray tmp; | 1257 | QByteArray tmp; |
1256 | switch (item) | 1258 | switch (item) |
1257 | { | 1259 | { |
1258 | case 0: // paste | 1260 | case 0: // paste |
1259 | //currentSession->getEmulation()->sendString(dropText.local8Bit()); | 1261 | //currentSession->getEmulation()->sendString(dropText.local8Bit()); |
1260 | currentSession->layer()->send( tmp.setRawData( dropText.local8Bit())); | 1262 | currentSession->emulationLayer()->send( tmp.setRawData( dropText.local8Bit())); |
1261 | 1263 | ||
1262 | // KWM::activate((Window)this->winId()); | 1264 | // KWM::activate((Window)this->winId()); |
1263 | break; | 1265 | break; |
1264 | case 1: // cd ... | 1266 | case 1: // cd ... |
1265 | //currentSession->getEmulation()->sendString("cd "); | 1267 | //currentSession->getEmulation()->sendString("cd "); |
1266 | tmp.setRawData( "cd " ); | 1268 | tmp.setRawData( "cd " ); |
1267 | currentSession->layer()->send( tmp ); | 1269 | currentSession->emulationLayer()->send( tmp ); |
1268 | struct stat statbuf; | 1270 | struct stat statbuf; |
1269 | if ( ::stat( QFile::encodeName( dropText ), &statbuf ) == 0 ) | 1271 | if ( ::stat( QFile::encodeName( dropText ), &statbuf ) == 0 ) |
1270 | { | 1272 | { |
1271 | if ( !S_ISDIR(statbuf.st_mode) ) | 1273 | if ( !S_ISDIR(statbuf.st_mode) ) |
1272 | { | 1274 | { |
1273 | /* | 1275 | /* |
@@ -1279,13 +1281,13 @@ void Widget::drop_menu_activated(int item) | |||
1279 | } | 1281 | } |
1280 | dropText.replace(QRegExp(" "), "\\ "); // escape spaces | 1282 | dropText.replace(QRegExp(" "), "\\ "); // escape spaces |
1281 | QByteArray tmp2; | 1283 | QByteArray tmp2; |
1282 | tmp.setRawDate( dropText.local8Bit() + "\n" ); | 1284 | tmp.setRawDate( dropText.local8Bit() + "\n" ); |
1283 | //currentSession->getEmulation()->sendString(dropText.local8Bit()); | 1285 | //currentSession->getEmulation()->sendString(dropText.local8Bit()); |
1284 | //currentSession->getEmulation()->sendString("\n"); | 1286 | //currentSession->getEmulation()->sendString("\n"); |
1285 | currentSession->layer()->send( tmp ); | 1287 | currentSession->emulationLayer()->send( tmp ); |
1286 | // KWM::activate((Window)this->winId()); | 1288 | // KWM::activate((Window)this->winId()); |
1287 | break; | 1289 | break; |
1288 | } | 1290 | } |
1289 | #endif | 1291 | #endif |
1290 | } | 1292 | } |
1291 | 1293 | ||
diff --git a/noncore/apps/opie-console/widget_layer.h b/noncore/apps/opie-console/widget_layer.h index 5bd2ef9..01a4614 100644 --- a/noncore/apps/opie-console/widget_layer.h +++ b/noncore/apps/opie-console/widget_layer.h | |||
@@ -99,14 +99,15 @@ public: | |||
99 | */ | 99 | */ |
100 | void pasteClipboard(); | 100 | void pasteClipboard(); |
101 | 101 | ||
102 | 102 | ||
103 | /** | 103 | /** |
104 | * reload configuration | 104 | * reload configuration |
105 | * @param const Profile& config, the config to be used (may be the same as in constructor) | ||
105 | */ | 106 | */ |
106 | virtual void reloadConfig() = 0; | 107 | virtual void reloadConfig( const Profile& config ) = 0; |
107 | 108 | ||
108 | 109 | ||
109 | /** | 110 | /** |
110 | * sets the scrollbar (if implemented by successor of this class) | 111 | * sets the scrollbar (if implemented by successor of this class) |
111 | */ | 112 | */ |
112 | virtual void setScroll( int cursor, int slines ); | 113 | virtual void setScroll( int cursor, int slines ); |