summaryrefslogtreecommitdiff
path: root/noncore
Side-by-side diff
Diffstat (limited to 'noncore') (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
@@ -56,7 +56,7 @@ public:
void reload( const Profile& );
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
@@ -50,7 +50,7 @@ extern "C" {
return new IOModem( prof );
}
IOLayer* newConsole( const Profile& prof ) {
- return new MyPty(prof );
+ return new MyPty( prof );
}
// Connection Widgets
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
@@ -79,6 +79,8 @@ public:
*/
virtual QBitArray supports()const = 0;
+ virtual bool isConnected() = 0;
+
signals:
/**
* received input as QCString
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
@@ -8,6 +8,7 @@ IOSerial::IOSerial(const Profile &config) : IOLayer(config) {
m_read = 0l;
m_error = 0l;
m_fd = 0;
+ m_connected = false;
reload(config);
}
@@ -32,7 +33,9 @@ void IOSerial::close() {
delete m_error;
::close(m_fd);
m_fd = 0;
+ m_connected = false;
} else {
+ m_connected = false;
emit error(Refuse, tr("Not connected"));
}
}
@@ -111,6 +114,7 @@ bool IOSerial::open() {
m_error = new QSocketNotifier(m_fd, QSocketNotifier::Exception, this);
connect(m_read, SIGNAL(activated(int)), this, SLOT(dataArrived()));
connect(m_error, SIGNAL(activated(int)), this, SLOT(errorOccured()));
+ m_connected = false;
return TRUE;
} else {
emit error(Refuse, tr("Device is already connected"));
@@ -194,3 +198,7 @@ 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
@@ -38,6 +38,7 @@ public:
int rawIO()const;
void closeRawIO(int fd );
QBitArray supports()const;
+ bool isConnected();
/*signals:
void received(const QByteArray &);
void error(int, const QString &);
@@ -62,6 +63,8 @@ protected:
int m_sbits;
int m_flow;
int m_fd;
+ bool m_connected;
+
};
#endif /* OPIE_IO_SERIAL */
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
@@ -205,7 +205,7 @@ void MainWindow::initUI() {
m_keyBar->hide();
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)));
@@ -439,8 +439,8 @@ void MainWindow::slotSessionChanged( Session* ses ) {
qWarning("changed!");
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 );
} else {
@@ -489,6 +489,6 @@ 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
@@ -51,8 +51,6 @@ void Session::connect() {
if ( !m_layer || !m_emu )
return;
- m_connected = true;
-
QObject::connect(m_layer, SIGNAL(received(const QByteArray&) ),
m_emu, SLOT(recv(const QByteArray&) ) );
QObject::connect(m_emu, SIGNAL(send(const QByteArray&) ),
@@ -64,8 +62,6 @@ void Session::disconnect() {
if ( !m_layer || !m_emu )
return;
- m_connected = false;
-
QObject::disconnect(m_layer, SIGNAL(received(const QByteArray&) ),
m_emu, SLOT(recv(const QByteArray&) ) );
QObject::disconnect(m_emu, SIGNAL(send(const QByteArray&) ),
@@ -100,6 +96,3 @@ 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
@@ -60,8 +60,6 @@ public:
void setIOLayer( IOLayer* );
void setName( const QString& );
- bool isConnected();
-
private:
QString m_name;
QWidgetStack* m_widget;