summaryrefslogtreecommitdiff
path: root/noncore/apps
authorzecke <zecke>2002-10-15 13:02:56 (UTC)
committer zecke <zecke>2002-10-15 13:02:56 (UTC)
commit09ba4d2c79a41b185902519639032a49c85deadb (patch) (unidiff)
treef1d9676bf3401bb93e527c8608a9307bf4adf244 /noncore/apps
parentb555d0c687db83cde89f1a75fccbd59723878621 (diff)
downloadopie-09ba4d2c79a41b185902519639032a49c85deadb.zip
opie-09ba4d2c79a41b185902519639032a49c85deadb.tar.gz
opie-09ba4d2c79a41b185902519639032a49c85deadb.tar.bz2
Add a Feature Support BitArray to the IOLayer
This way we know what an IOLayer supports Adjust IOSerial and MyPty to that change Fix the after close window the previous session window is empty bug in Mainwindow::remove we had a problem first we removed the currentSession from the tab and then deleted the session The problem is that removePage on OTabWidget does signal currentChanged so we did not delete the session intended but the wrong one because m_curSession got adjusted after a removePage... 3rd fix the close and reopen bug in MyPty
Diffstat (limited to 'noncore/apps') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/BUGS9
-rw-r--r--noncore/apps/opie-console/MyPty.cpp23
-rw-r--r--noncore/apps/opie-console/MyPty.h2
-rw-r--r--noncore/apps/opie-console/io_layer.h14
-rw-r--r--noncore/apps/opie-console/io_serial.cpp7
-rw-r--r--noncore/apps/opie-console/io_serial.h4
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp10
-rw-r--r--noncore/apps/opie-console/profilemanager.cpp15
-rw-r--r--noncore/apps/opie-console/session.cpp6
-rw-r--r--noncore/apps/opie-console/session.h1
-rw-r--r--noncore/apps/opie-console/tabwidget.cpp1
11 files changed, 72 insertions, 20 deletions
diff --git a/noncore/apps/opie-console/BUGS b/noncore/apps/opie-console/BUGS
new file mode 100644
index 0000000..ffaceef
--- a/dev/null
+++ b/noncore/apps/opie-console/BUGS
@@ -0,0 +1,9 @@
1Ok we all know we write perfect code
2but sometimes the compiler produces bad code
3and we need to work around some compiler bugs!! -zecke
4
5MyPty is broken in some ways
6 if you do connect/disconnect/connect sh will be executed in the
7 process of opie-console.... funny aye?
8
9OTabWidget seems to give us problems too
diff --git a/noncore/apps/opie-console/MyPty.cpp b/noncore/apps/opie-console/MyPty.cpp
index b6ae1d9..565d03f 100644
--- a/noncore/apps/opie-console/MyPty.cpp
+++ b/noncore/apps/opie-console/MyPty.cpp
@@ -119,3 +119,5 @@ void MyPty::donePty()
119 delete m_sn_e; 119 delete m_sn_e;
120 delete m_sn_r;
120 m_sn_e = 0l; 121 m_sn_e = 0l;
122 m_sn_r = 0l;
121 } 123 }
@@ -123,2 +125,3 @@ void MyPty::donePty()
123 m_cpid = 0; 125 m_cpid = 0;
126 m_fd = -1;
124// emit done(status); 127// emit done(status);
@@ -187,6 +190,7 @@ int MyPty::run(const char* cmd, QStrList &, const char*, int)
187 // parent - continue as a widget 190 // parent - continue as a widget
188 QSocketNotifier* sn_r = new QSocketNotifier(m_fd,QSocketNotifier::Read,this); 191 delete m_sn_r;
192 m_sn_r = new QSocketNotifier(m_fd,QSocketNotifier::Read,this);
189 delete m_sn_e; 193 delete m_sn_e;
190 m_sn_e = new QSocketNotifier(m_fd,QSocketNotifier::Exception,this); 194 m_sn_e = new QSocketNotifier(m_fd,QSocketNotifier::Exception,this);
191 connect(sn_r,SIGNAL(activated(int)),this,SLOT(readPty())); 195 connect(m_sn_r,SIGNAL(activated(int)),this,SLOT(readPty()));
192 connect(m_sn_e,SIGNAL(activated(int)),this,SLOT(error())); 196 connect(m_sn_e,SIGNAL(activated(int)),this,SLOT(error()));
@@ -223,3 +227,3 @@ int MyPty::openPty()
223 if ( ptyfd < 0 ) { 227 if ( ptyfd < 0 ) {
224 qApp->exit(1); 228 //qApp->exit(1);
225 return -1; 229 return -1;
@@ -236,2 +240,3 @@ MyPty::MyPty(const Profile&) : m_cpid(0)
236 m_sn_e = 0l; 240 m_sn_e = 0l;
241 m_sn_r = 0l;
237 m_fd = openPty(); 242 m_fd = openPty();
@@ -256,2 +261,5 @@ QString MyPty::name()const{
256bool MyPty::open() { 261bool MyPty::open() {
262 if (m_fd < 0)
263 m_fd = openPty();
264
257 start(); 265 start();
@@ -261,2 +269,3 @@ void MyPty::close() {
261 donePty(); 269 donePty();
270 m_fd = openPty();
262} 271}
@@ -288,3 +297,2 @@ void MyPty::readPty()
288 donePty(); 297 donePty();
289 delete sender();
290 return; 298 return;
@@ -308,2 +316,9 @@ void MyPty::readPty()
308} 316}
317QBitArray MyPty::supports()const {
318 QBitArray ar(3);
319 ar[0] = 1;
320 ar[1] = 0;
321 ar[2] = 0;
309 322
323 return ar;
324}
diff --git a/noncore/apps/opie-console/MyPty.h b/noncore/apps/opie-console/MyPty.h
index 3166fa0..ad271df 100644
--- a/noncore/apps/opie-console/MyPty.h
+++ b/noncore/apps/opie-console/MyPty.h
@@ -43,2 +43,3 @@ public:
43 QString name()const; 43 QString name()const;
44 QBitArray supports()const;
44 45
@@ -94,2 +95,3 @@ private:
94 QSocketNotifier* m_sn_e; 95 QSocketNotifier* m_sn_e;
96 QSocketNotifier* m_sn_r;
95}; 97};
diff --git a/noncore/apps/opie-console/io_layer.h b/noncore/apps/opie-console/io_layer.h
index 5f2fa3c..4977e94 100644
--- a/noncore/apps/opie-console/io_layer.h
+++ b/noncore/apps/opie-console/io_layer.h
@@ -3,3 +3,6 @@
3 3
4#include <qbitarray.h>
4#include <qobject.h> 5#include <qobject.h>
6
7
5#include <qpe/config.h> 8#include <qpe/config.h>
@@ -25,2 +28,7 @@ public:
25 }; 28 };
29 enum Feature {
30 AutoConnect = 0,
31 TransferFile =1,
32 Close =2
33 };
26 /** 34 /**
@@ -67,2 +75,7 @@ public:
67 75
76 /**
77 * What does the IOLayer support?
78 * Bits are related to features
79 */
80 virtual QBitArray supports()const = 0;
68 81
@@ -81,2 +94,3 @@ signals:
81 94
95 virtual void closed();
82public slots: 96public slots:
diff --git a/noncore/apps/opie-console/io_serial.cpp b/noncore/apps/opie-console/io_serial.cpp
index a4a6f0b..c10d5a8 100644
--- a/noncore/apps/opie-console/io_serial.cpp
+++ b/noncore/apps/opie-console/io_serial.cpp
@@ -189 +189,8 @@ void IOSerial::closeRawIO(int fd) {
189} 189}
190QBitArray IOSerial::supports()const {
191 QBitArray ar(3);
192 ar[0] = ar[2] = 0;
193 ar[1] = 1;
194
195 return ar;
196}
diff --git a/noncore/apps/opie-console/io_serial.h b/noncore/apps/opie-console/io_serial.h
index facbbc1..b1d1be1 100644
--- a/noncore/apps/opie-console/io_serial.h
+++ b/noncore/apps/opie-console/io_serial.h
@@ -39,5 +39,7 @@ public:
39 void closeRawIO(int fd ); 39 void closeRawIO(int fd );
40signals: 40 QBitArray supports()const;
41/*signals:
41 void received(const QByteArray &); 42 void received(const QByteArray &);
42 void error(int, const QString &); 43 void error(int, const QString &);
44*/
43public slots: 45public slots:
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 94c99bc..29dbcf3 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -362,7 +362,8 @@ void MainWindow::slotClose() {
362 362
363 Session* ses = currentSession();
364 qWarning("removing! currentSession %s", currentSession()->name().latin1() );
363 tabWidget()->remove( currentSession() ); 365 tabWidget()->remove( currentSession() );
364 /*it's autodelete */ 366 /*it's autodelete */
365 m_sessions.remove( m_curSession ); 367 m_sessions.remove( ses );
366 m_curSession = m_sessions.first(); 368 qWarning("after remove!!");
367 tabWidget()->setCurrent( m_curSession );
368 369
@@ -397,3 +398,3 @@ void MainWindow::create( const Profile& prof ) {
397 QObject::tr("Session failed"), 398 QObject::tr("Session failed"),
398 QObject::tr("Cannot open session: Not all components were found.")); 399 QObject::tr("<qt>Cannot open session: Not all components were found.</qt>"));
399 //if(ses) delete ses; 400 //if(ses) delete ses;
@@ -435,2 +436,3 @@ void MainWindow::slotOpenKeb(bool state) {
435void MainWindow::slotSessionChanged( Session* ses ) { 436void MainWindow::slotSessionChanged( Session* ses ) {
437 qWarning("changed!");
436 if ( ses ) { 438 if ( ses ) {
diff --git a/noncore/apps/opie-console/profilemanager.cpp b/noncore/apps/opie-console/profilemanager.cpp
index e5aedb6..7c15560 100644
--- a/noncore/apps/opie-console/profilemanager.cpp
+++ b/noncore/apps/opie-console/profilemanager.cpp
@@ -4,2 +4,3 @@
4#include <qfile.h> 4#include <qfile.h>
5#include <qhbox.h>
5#include <qlayout.h> 6#include <qlayout.h>
@@ -87,15 +88,7 @@ Session* ProfileManager::fromProfile( const Profile& prof, QWidget* parent) {
87 session->setWidgetStack( stack ); 88 session->setWidgetStack( stack );
88 QWidget* dummy = new QWidget( stack ); 89 QWidget* dummy = new QHBox( stack );
89 QHBoxLayout* lay = new QHBoxLayout( dummy ); 90 stack->raiseWidget( dummy );
90 stack->addWidget( dummy, 0 ); 91
91 stack->raiseWidget( 0 );
92 EmulationHandler* handler = new EmulationHandler(prof,dummy ); 92 EmulationHandler* handler = new EmulationHandler(prof,dummy );
93 session->setEmulationHandler( handler ); 93 session->setEmulationHandler( handler );
94 lay->addWidget( handler->widget() );
95// WidgetLayer* wid = new EmulationWidget( prof, dummy );
96// lay->addWidget( wid );
97
98// session->setEmulationWidget( wid );
99// session->setEmulationLayer( m_fact->newEmulationLayer( m_fact->external( prof.terminalName() ),
100// wid ) );
101 session->connect(); 94 session->connect();
diff --git a/noncore/apps/opie-console/session.cpp b/noncore/apps/opie-console/session.cpp
index e53dbc4..aad100d 100644
--- a/noncore/apps/opie-console/session.cpp
+++ b/noncore/apps/opie-console/session.cpp
@@ -38,2 +38,8 @@ EmulationHandler* Session::emulationHandler() {
38} 38}
39QWidget* Session::widget() {
40 if (!m_emu )
41 return 0l;
42
43 return m_emu->widget();
44}
39/* 45/*
diff --git a/noncore/apps/opie-console/session.h b/noncore/apps/opie-console/session.h
index a1121d3..ff92df3 100644
--- a/noncore/apps/opie-console/session.h
+++ b/noncore/apps/opie-console/session.h
@@ -36,2 +36,3 @@ public:
36 QWidgetStack* widgetStack(); 36 QWidgetStack* widgetStack();
37 QWidget* widget();
37 38
diff --git a/noncore/apps/opie-console/tabwidget.cpp b/noncore/apps/opie-console/tabwidget.cpp
index 8a691f9..419f8ac 100644
--- a/noncore/apps/opie-console/tabwidget.cpp
+++ b/noncore/apps/opie-console/tabwidget.cpp
@@ -13,2 +13,3 @@ TabWidget::~TabWidget() {
13void TabWidget::add( Session* ses ) { 13void TabWidget::add( Session* ses ) {
14 qWarning("session ses " + ses->name() );
14 if ( !ses->widgetStack() ) return; 15 if ( !ses->widgetStack() ) return;