summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/MyPty.h2
-rw-r--r--noncore/apps/opie-console/default.cpp2
-rw-r--r--noncore/apps/opie-console/io_layer.h2
-rw-r--r--noncore/apps/opie-console/io_serial.cpp8
-rw-r--r--noncore/apps/opie-console/io_serial.h3
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp8
-rw-r--r--noncore/apps/opie-console/session.cpp7
-rw-r--r--noncore/apps/opie-console/session.h2
8 files changed, 19 insertions, 15 deletions
diff --git a/noncore/apps/opie-console/MyPty.h b/noncore/apps/opie-console/MyPty.h
index ad271df..81abad5 100644
--- a/noncore/apps/opie-console/MyPty.h
+++ b/noncore/apps/opie-console/MyPty.h
@@ -57,5 +57,5 @@ public:
void setSize(int lines, int columns);
void error();
-
+ bool isConnected() { return true; };
signals:
diff --git a/noncore/apps/opie-console/default.cpp b/noncore/apps/opie-console/default.cpp
index 64c9542..8b905e1 100644
--- a/noncore/apps/opie-console/default.cpp
+++ b/noncore/apps/opie-console/default.cpp
@@ -51,5 +51,5 @@ extern "C" {
}
IOLayer* newConsole( const Profile& prof ) {
- return new MyPty(prof );
+ return new MyPty( prof );
}
diff --git a/noncore/apps/opie-console/io_layer.h b/noncore/apps/opie-console/io_layer.h
index 4977e94..d5f7eab 100644
--- a/noncore/apps/opie-console/io_layer.h
+++ b/noncore/apps/opie-console/io_layer.h
@@ -80,4 +80,6 @@ public:
virtual QBitArray supports()const = 0;
+ virtual bool isConnected() = 0;
+
signals:
/**
diff --git a/noncore/apps/opie-console/io_serial.cpp b/noncore/apps/opie-console/io_serial.cpp
index c10d5a8..b89a53b 100644
--- a/noncore/apps/opie-console/io_serial.cpp
+++ b/noncore/apps/opie-console/io_serial.cpp
@@ -9,4 +9,5 @@ IOSerial::IOSerial(const Profile &config) : IOLayer(config) {
m_error = 0l;
m_fd = 0;
+ m_connected = false;
reload(config);
}
@@ -33,5 +34,7 @@ void IOSerial::close() {
::close(m_fd);
m_fd = 0;
+ m_connected = false;
} else {
+ m_connected = false;
emit error(Refuse, tr("Not connected"));
}
@@ -112,4 +115,5 @@ bool IOSerial::open() {
connect(m_read, SIGNAL(activated(int)), this, SLOT(dataArrived()));
connect(m_error, SIGNAL(activated(int)), this, SLOT(errorOccured()));
+ m_connected = false;
return TRUE;
} else {
@@ -195,2 +199,6 @@ QBitArray IOSerial::supports()const {
return ar;
}
+
+bool IOSerial::isConnected() {
+ return m_connected;
+}
diff --git a/noncore/apps/opie-console/io_serial.h b/noncore/apps/opie-console/io_serial.h
index b1d1be1..7a1ea1d 100644
--- a/noncore/apps/opie-console/io_serial.h
+++ b/noncore/apps/opie-console/io_serial.h
@@ -39,4 +39,5 @@ public:
void closeRawIO(int fd );
QBitArray supports()const;
+ bool isConnected();
/*signals:
void received(const QByteArray &);
@@ -63,4 +64,6 @@ protected:
int m_flow;
int m_fd;
+ bool m_connected;
+
};
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index d3b6c8a..4326609 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -206,5 +206,5 @@ void MainWindow::initUI() {
m_kb = new FunctionKeyboard(m_keyBar);
- connect(m_kb, SIGNAL(keyPressed(ushort, ushort, bool, bool, bool)),
+ connect(m_kb, SIGNAL(keyPressed(ushort, ushort, bool, bool, bool)),
this, SLOT(slotKeyReceived(ushort, ushort, bool, bool, bool)));
@@ -440,6 +440,6 @@ void MainWindow::slotSessionChanged( Session* ses ) {
if ( ses ) {
m_curSession = ses;
-
- if ( m_curSession->isConnected() ) {
+ qDebug(QString("is connected : %1").arg( m_curSession->layer()->isConnected() ) );
+ if ( m_curSession->layer()->isConnected() ) {
m_connect->setEnabled( false );
m_disconnect->setEnabled( true );
@@ -490,5 +490,5 @@ void MainWindow::slotKeyReceived(ushort u, ushort q, bool, bool, bool) {
ke.ignore();
// where should i send this event? doesnt work sending it here
- QApplication::sendEvent((QObject *)m_curSession->widgetStack(), &ke);
+ QApplication::sendEvent((QObject *)m_curSession->widgetStack(), &ke);
}
}
diff --git a/noncore/apps/opie-console/session.cpp b/noncore/apps/opie-console/session.cpp
index aad100d..2ce6872 100644
--- a/noncore/apps/opie-console/session.cpp
+++ b/noncore/apps/opie-console/session.cpp
@@ -52,6 +52,4 @@ void Session::connect() {
return;
- m_connected = true;
-
QObject::connect(m_layer, SIGNAL(received(const QByteArray&) ),
m_emu, SLOT(recv(const QByteArray&) ) );
@@ -65,6 +63,4 @@ void Session::disconnect() {
return;
- m_connected = false;
-
QObject::disconnect(m_layer, SIGNAL(received(const QByteArray&) ),
m_emu, SLOT(recv(const QByteArray&) ) );
@@ -101,5 +97,2 @@ void Session::setEmulationWidget( WidgetLayer* lay ) {
*/
-bool Session::isConnected() {
- return m_connected;
-}
diff --git a/noncore/apps/opie-console/session.h b/noncore/apps/opie-console/session.h
index ff92df3..83b2046 100644
--- a/noncore/apps/opie-console/session.h
+++ b/noncore/apps/opie-console/session.h
@@ -61,6 +61,4 @@ public:
void setName( const QString& );
- bool isConnected();
-
private:
QString m_name;