-rw-r--r-- | noncore/apps/opie-console/TEScreen.h | 0 | ||||
-rw-r--r-- | noncore/apps/opie-console/emulation_handler.cpp | 17 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 23 | ||||
-rw-r--r-- | noncore/apps/opie-console/profile.h | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/session.cpp | 12 | ||||
-rw-r--r-- | noncore/apps/opie-console/session.h | 3 | ||||
-rw-r--r-- | noncore/apps/opie-console/terminalwidget.cpp | 18 |
7 files changed, 69 insertions, 8 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 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 @@ -109,2 +109,11 @@ QColor EmulationHandler::foreColor(int col) { 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; } @@ -127,2 +136,10 @@ QColor EmulationHandler::backColor(int col ) { 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 @@ -319,2 +319,4 @@ void MainWindow::slotConnect() { QObject::tr("Connecting failed for this session.")); + m_connect->setEnabled( false ); + m_disconnect->setEnabled( true ); } @@ -323,4 +325,7 @@ void MainWindow::slotConnect() { void MainWindow::slotDisconnect() { - if ( currentSession() ) + if ( currentSession() ) { currentSession()->layer()->close(); + m_connect->setEnabled( true ); + m_disconnect->setEnabled( false ); + } } @@ -407,3 +412,3 @@ void MainWindow::create( const Profile& prof ) { m_connect->setEnabled( true ); - m_disconnect->setEnabled( true ); + m_disconnect->setEnabled( false ); m_terminate->setEnabled( true ); @@ -419,3 +424,3 @@ void MainWindow::slotTransfer() { - // if ( currentSession() ) { + if ( currentSession() ) { TransferDialog dlg(this); @@ -423,3 +428,3 @@ void MainWindow::slotTransfer() dlg.exec(); - // } + } } @@ -437,2 +442,10 @@ void MainWindow::slotSessionChanged( Session* ses ) { m_curSession = ses; + + if ( m_curSession->isConnected() ) { + m_connect->setEnabled( false ); + m_disconnect->setEnabled( true ); + } else { + m_connect->setEnabled( true ); + m_disconnect->setEnabled( false ); + } } @@ -457,3 +470,3 @@ void MainWindow::slotFullscreen() { - // QPushButton *cornerButton = new QPushButton( this ); + //QPushButton *cornerButton = new QPushButton( ); //cornerButton->setPixmap( QPixmap( (const char**)menu_xpm ) ); 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 @@ -19,3 +19,5 @@ public: White, - Gray }; + Gray, + Green, + Orange}; enum Terminal {VT102 = 0, VT100 }; 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 @@ -47,2 +47,4 @@ void Session::connect() { + m_connected = true; + qWarning("connection in session"); @@ -52,4 +54,4 @@ void Session::connect() { m_layer, SLOT(send(const QByteArray&) ) ); - } + void Session::disconnect() { @@ -59,2 +61,4 @@ void Session::disconnect() { + m_connected = false; + QObject::disconnect(m_layer, SIGNAL(received(const QByteArray&) ), @@ -64,2 +68,3 @@ void Session::disconnect() { } + void Session::setName( const QString& na){ @@ -67,2 +72,3 @@ void Session::setName( const QString& na){ } + void Session::setWidgetStack( QWidgetStack* wid ) { @@ -90 +96,5 @@ 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 @@ -61,2 +61,4 @@ public: + bool isConnected(); + private: @@ -66,2 +68,3 @@ private: 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 @@ -21,3 +21,5 @@ namespace { id_term_black, - id_term_white + id_term_white, + id_term_green, + id_term_orange }; @@ -80,2 +82,4 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent, 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 ); @@ -129,2 +133,8 @@ void TerminalWidget::load( const Profile& prof ) { break; + case Profile::Green: + m_colorCmb->setCurrentItem(id_term_green ); + break; + case Profile::Orange: + m_colorCmb->setCurrentItem(id_term_orange ); + break; default: @@ -177,2 +187,8 @@ void TerminalWidget::save( Profile& profile ) { break; + case id_term_green: + profile.writeEntry("Color", Profile::Green ); + break; + case id_term_orange: + profile.writeEntry("Color", Profile::Orange ); + break; default: |