summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-10-15 22:03:01 (UTC)
committer harlekin <harlekin>2002-10-15 22:03:01 (UTC)
commitce953c24f809385088905ffd02f6d6187d0a4f12 (patch) (side-by-side diff)
tree19f10579ebd5870cf38940d624c97111ea8137b3
parent676be5604cbdb3213c00775e0ff66f4e766f8dcb (diff)
downloadopie-ce953c24f809385088905ffd02f6d6187d0a4f12.zip
opie-ce953c24f809385088905ffd02f6d6187d0a4f12.tar.gz
opie-ce953c24f809385088905ffd02f6d6187d0a4f12.tar.bz2
next isConnected try
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
@@ -58,3 +58,3 @@ public:
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
@@ -52,3 +52,3 @@ 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
@@ -81,2 +81,4 @@ public:
+ 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
@@ -10,2 +10,3 @@ IOSerial::IOSerial(const Profile &config) : IOLayer(config) {
m_fd = 0;
+ m_connected = false;
reload(config);
@@ -34,3 +35,5 @@ void IOSerial::close() {
m_fd = 0;
+ m_connected = false;
} else {
+ m_connected = false;
emit error(Refuse, tr("Not connected"));
@@ -113,2 +116,3 @@ bool IOSerial::open() {
connect(m_error, SIGNAL(activated(int)), this, SLOT(errorOccured()));
+ m_connected = false;
return TRUE;
@@ -196 +200,5 @@ QBitArray IOSerial::supports()const {
}
+
+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
@@ -40,2 +40,3 @@ public:
QBitArray supports()const;
+ bool isConnected();
/*signals:
@@ -64,2 +65,4 @@ protected:
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
@@ -207,3 +207,3 @@ 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)));
@@ -441,4 +441,4 @@ void MainWindow::slotSessionChanged( Session* 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 );
@@ -491,3 +491,3 @@ void MainWindow::slotKeyReceived(ushort u, ushort q, bool, bool, bool) {
// 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
@@ -53,4 +53,2 @@ void Session::connect() {
- m_connected = true;
-
QObject::connect(m_layer, SIGNAL(received(const QByteArray&) ),
@@ -66,4 +64,2 @@ void Session::disconnect() {
- m_connected = false;
-
QObject::disconnect(m_layer, SIGNAL(received(const QByteArray&) ),
@@ -102,4 +98 @@ 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
@@ -62,4 +62,2 @@ public:
- bool isConnected();
-
private: