summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/TEScreen.h8
-rw-r--r--noncore/apps/opie-console/emulation_handler.cpp17
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp31
-rw-r--r--noncore/apps/opie-console/profile.h4
-rw-r--r--noncore/apps/opie-console/session.cpp12
-rw-r--r--noncore/apps/opie-console/session.h3
-rw-r--r--noncore/apps/opie-console/terminalwidget.cpp18
7 files changed, 77 insertions, 16 deletions
diff --git a/noncore/apps/opie-console/TEScreen.h b/noncore/apps/opie-console/TEScreen.h
index ba47ee5..473ce79 100644
--- a/noncore/apps/opie-console/TEScreen.h
+++ b/noncore/apps/opie-console/TEScreen.h
@@ -138,5 +138,5 @@ public: // these are all `Screen' operations
//
ca* getCookedImage();
-
+
/*! return the number of lines. */
int getLines() { return lines; }
@@ -167,5 +167,5 @@ private: // helper
void clearImage(int loca, int loce, char c);
void moveImage(int dst, int loca, int loce);
-
+
void scrollUp(int from, int i);
void scrollDown(int from, int i);
@@ -200,5 +200,5 @@ private:
int histCursor; // display position relative to start of the history buffer
HistoryScroll hist;
-
+
// cursor location
@@ -239,5 +239,5 @@ private:
//
// save cursor, rendition & states ------------
- //
+ //
// cursor location
diff --git a/noncore/apps/opie-console/emulation_handler.cpp b/noncore/apps/opie-console/emulation_handler.cpp
index 9f34d2c..836a05b 100644
--- a/noncore/apps/opie-console/emulation_handler.cpp
+++ b/noncore/apps/opie-console/emulation_handler.cpp
@@ -108,4 +108,13 @@ QColor EmulationHandler::foreColor(int col) {
co = Qt::black;
break;
+ case Profile::Green:
+ qWarning("Foreground green");
+ co = Qt::green;
+ break;
+ case Profile::Orange:
+ qWarning("Foreground orange");
+ // FIXME needs better color here
+ co = Qt::darkYellow;
+ break;
}
@@ -126,4 +135,12 @@ QColor EmulationHandler::backColor(int col ) {
co = Qt::white;
break;
+ case Profile::Green:
+ qWarning("Background black");
+ co = Qt::black;
+ break;
+ case Profile::Orange:
+ qWarning("Background black");
+ co = Qt::black;
+ break;
}
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 6dc9e6e..b770551 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -315,13 +315,18 @@ void MainWindow::slotConnect() {
if ( currentSession() ) {
bool ret = currentSession()->layer()->open();
- if(!ret) QMessageBox::warning(currentSession()->widgetStack(),
- QObject::tr("Failed"),
- QObject::tr("Connecting failed for this session."));
- }
+ if(!ret) QMessageBox::warning(currentSession()->widgetStack(),
+ QObject::tr("Failed"),
+ QObject::tr("Connecting failed for this session."));
+ m_connect->setEnabled( false );
+ m_disconnect->setEnabled( true );
+ }
}
void MainWindow::slotDisconnect() {
- if ( currentSession() )
+ if ( currentSession() ) {
currentSession()->layer()->close();
+ m_connect->setEnabled( true );
+ m_disconnect->setEnabled( false );
+ }
}
@@ -406,5 +411,5 @@ void MainWindow::create( const Profile& prof ) {
// dicide if its a local term ( then no connction and no tranfer), maybe make a wrapper method out of it
m_connect->setEnabled( true );
- m_disconnect->setEnabled( true );
+ m_disconnect->setEnabled( false );
m_terminate->setEnabled( true );
m_transfer->setEnabled( true );
@@ -418,9 +423,9 @@ void MainWindow::create( const Profile& prof ) {
void MainWindow::slotTransfer()
{
- // if ( currentSession() ) {
+ if ( currentSession() ) {
TransferDialog dlg(this);
dlg.showMaximized();
dlg.exec();
- // }
+ }
}
@@ -436,4 +441,12 @@ void MainWindow::slotSessionChanged( Session* ses ) {
qWarning("changing %s", ses->name().latin1() );
m_curSession = ses;
+
+ if ( m_curSession->isConnected() ) {
+ m_connect->setEnabled( false );
+ m_disconnect->setEnabled( true );
+ } else {
+ m_connect->setEnabled( true );
+ m_disconnect->setEnabled( false );
+ }
}
}
@@ -456,5 +469,5 @@ void MainWindow::slotFullscreen() {
( m_curSession->widgetStack() )->show();
- // QPushButton *cornerButton = new QPushButton( this );
+ //QPushButton *cornerButton = new QPushButton( );
//cornerButton->setPixmap( QPixmap( (const char**)menu_xpm ) );
//connect( cornerButton, SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) );
diff --git a/noncore/apps/opie-console/profile.h b/noncore/apps/opie-console/profile.h
index 1b71cda..64eb022 100644
--- a/noncore/apps/opie-console/profile.h
+++ b/noncore/apps/opie-console/profile.h
@@ -18,5 +18,7 @@ public:
enum Color { Black = 0,
White,
- Gray };
+ Gray,
+ Green,
+ Orange};
enum Terminal {VT102 = 0, VT100 };
enum Font { Micro = 0, Small, Medium };
diff --git a/noncore/apps/opie-console/session.cpp b/noncore/apps/opie-console/session.cpp
index f4fbcf2..d0ace6c 100644
--- a/noncore/apps/opie-console/session.cpp
+++ b/noncore/apps/opie-console/session.cpp
@@ -46,4 +46,6 @@ void Session::connect() {
return;
+ m_connected = true;
+
qWarning("connection in session");
QObject::connect(m_layer, SIGNAL(received(const QByteArray&) ),
@@ -51,6 +53,6 @@ void Session::connect() {
QObject::connect(m_emu, SIGNAL(send(const QByteArray&) ),
m_layer, SLOT(send(const QByteArray&) ) );
-
}
+
void Session::disconnect() {
@@ -58,4 +60,6 @@ void Session::disconnect() {
return;
+ m_connected = false;
+
QObject::disconnect(m_layer, SIGNAL(received(const QByteArray&) ),
m_emu, SLOT(recv(const QByteArray&) ) );
@@ -63,7 +67,9 @@ void Session::disconnect() {
m_layer, SLOT(send(const QByteArray&) ) );
}
+
void Session::setName( const QString& na){
m_name = na;
}
+
void Session::setWidgetStack( QWidgetStack* wid ) {
delete m_emu;
@@ -89,2 +95,6 @@ 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 c3f3661..a1121d3 100644
--- a/noncore/apps/opie-console/session.h
+++ b/noncore/apps/opie-console/session.h
@@ -60,4 +60,6 @@ public:
void setName( const QString& );
+ bool isConnected();
+
private:
QString m_name;
@@ -65,4 +67,5 @@ private:
IOLayer* m_layer;
EmulationHandler* m_emu;
+ bool m_connected;
};
diff --git a/noncore/apps/opie-console/terminalwidget.cpp b/noncore/apps/opie-console/terminalwidget.cpp
index 2d37be2..8badf96 100644
--- a/noncore/apps/opie-console/terminalwidget.cpp
+++ b/noncore/apps/opie-console/terminalwidget.cpp
@@ -20,5 +20,7 @@ namespace {
enum ColourIds {
id_term_black,
- id_term_white
+ id_term_white,
+ id_term_green,
+ id_term_orange
};
@@ -79,4 +81,6 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent,
m_colorCmb->insertItem( tr("black on white"), id_term_black );
m_colorCmb->insertItem( tr("white on black"), id_term_white );
+ m_colorCmb->insertItem( tr("green on black"), id_term_green );
+ m_colorCmb->insertItem( tr("orange on black"), id_term_orange );
// signals + slots
@@ -128,4 +132,10 @@ void TerminalWidget::load( const Profile& prof ) {
m_colorCmb->setCurrentItem(id_term_white );
break;
+ case Profile::Green:
+ m_colorCmb->setCurrentItem(id_term_green );
+ break;
+ case Profile::Orange:
+ m_colorCmb->setCurrentItem(id_term_orange );
+ break;
default:
break;
@@ -176,4 +186,10 @@ void TerminalWidget::save( Profile& profile ) {
profile.writeEntry("Color", Profile::White );
break;
+ case id_term_green:
+ profile.writeEntry("Color", Profile::Green );
+ break;
+ case id_term_orange:
+ profile.writeEntry("Color", Profile::Orange );
+ break;
default:
break;