-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 | |||
@@ -104,12 +104,21 @@ QColor EmulationHandler::foreColor(int col) { | |||
104 | co = Qt::white; | 104 | co = Qt::white; |
105 | break; | 105 | break; |
106 | case Profile::Black: | 106 | case Profile::Black: |
107 | qWarning("Foreground white"); | 107 | qWarning("Foreground white"); |
108 | co = Qt::black; | 108 | co = Qt::black; |
109 | break; | 109 | break; |
110 | case Profile::Green: | ||
111 | qWarning("Foreground green"); | ||
112 | co = Qt::green; | ||
113 | break; | ||
114 | case Profile::Orange: | ||
115 | qWarning("Foreground orange"); | ||
116 | // FIXME needs better color here | ||
117 | co = Qt::darkYellow; | ||
118 | break; | ||
110 | } | 119 | } |
111 | 120 | ||
112 | return co; | 121 | return co; |
113 | } | 122 | } |
114 | QColor EmulationHandler::backColor(int col ) { | 123 | QColor EmulationHandler::backColor(int col ) { |
115 | QColor co; | 124 | QColor co; |
@@ -122,10 +131,18 @@ QColor EmulationHandler::backColor(int col ) { | |||
122 | co = Qt::black; | 131 | co = Qt::black; |
123 | break; | 132 | break; |
124 | case Profile::Black: | 133 | case Profile::Black: |
125 | qWarning("Background black"); | 134 | qWarning("Background black"); |
126 | co = Qt::white; | 135 | co = Qt::white; |
127 | break; | 136 | break; |
137 | case Profile::Green: | ||
138 | qWarning("Background black"); | ||
139 | co = Qt::black; | ||
140 | break; | ||
141 | case Profile::Orange: | ||
142 | qWarning("Background black"); | ||
143 | co = Qt::black; | ||
144 | break; | ||
128 | } | 145 | } |
129 | 146 | ||
130 | return co; | 147 | return co; |
131 | } | 148 | } |
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 | |||
@@ -314,18 +314,23 @@ void MainWindow::slotRunScript() { | |||
314 | void MainWindow::slotConnect() { | 314 | void MainWindow::slotConnect() { |
315 | if ( currentSession() ) { | 315 | if ( currentSession() ) { |
316 | bool ret = currentSession()->layer()->open(); | 316 | bool ret = currentSession()->layer()->open(); |
317 | if(!ret) QMessageBox::warning(currentSession()->widgetStack(), | 317 | if(!ret) QMessageBox::warning(currentSession()->widgetStack(), |
318 | QObject::tr("Failed"), | 318 | QObject::tr("Failed"), |
319 | QObject::tr("Connecting failed for this session.")); | 319 | QObject::tr("Connecting failed for this session.")); |
320 | m_connect->setEnabled( false ); | ||
321 | m_disconnect->setEnabled( true ); | ||
320 | } | 322 | } |
321 | } | 323 | } |
322 | 324 | ||
323 | void MainWindow::slotDisconnect() { | 325 | void MainWindow::slotDisconnect() { |
324 | if ( currentSession() ) | 326 | if ( currentSession() ) { |
325 | currentSession()->layer()->close(); | 327 | currentSession()->layer()->close(); |
328 | m_connect->setEnabled( true ); | ||
329 | m_disconnect->setEnabled( false ); | ||
330 | } | ||
326 | } | 331 | } |
327 | 332 | ||
328 | void MainWindow::slotTerminate() { | 333 | void MainWindow::slotTerminate() { |
329 | if ( currentSession() ) | 334 | if ( currentSession() ) |
330 | currentSession()->layer()->close(); | 335 | currentSession()->layer()->close(); |
331 | 336 | ||
@@ -402,29 +407,29 @@ void MainWindow::create( const Profile& prof ) { | |||
402 | m_sessions.append( ses ); | 407 | m_sessions.append( ses ); |
403 | tabWidget()->add( ses ); | 408 | tabWidget()->add( ses ); |
404 | m_curSession = ses; | 409 | m_curSession = ses; |
405 | 410 | ||
406 | // dicide if its a local term ( then no connction and no tranfer), maybe make a wrapper method out of it | 411 | // dicide if its a local term ( then no connction and no tranfer), maybe make a wrapper method out of it |
407 | m_connect->setEnabled( true ); | 412 | m_connect->setEnabled( true ); |
408 | m_disconnect->setEnabled( true ); | 413 | m_disconnect->setEnabled( false ); |
409 | m_terminate->setEnabled( true ); | 414 | m_terminate->setEnabled( true ); |
410 | m_transfer->setEnabled( true ); | 415 | m_transfer->setEnabled( true ); |
411 | m_recordScript->setEnabled( true ); | 416 | m_recordScript->setEnabled( true ); |
412 | m_saveScript->setEnabled( true ); | 417 | m_saveScript->setEnabled( true ); |
413 | m_runScript->setEnabled( true ); | 418 | m_runScript->setEnabled( true ); |
414 | m_fullscreen->setEnabled( true ); | 419 | m_fullscreen->setEnabled( true ); |
415 | m_closewindow->setEnabled( true ); | 420 | m_closewindow->setEnabled( true ); |
416 | } | 421 | } |
417 | 422 | ||
418 | void MainWindow::slotTransfer() | 423 | void MainWindow::slotTransfer() |
419 | { | 424 | { |
420 | // if ( currentSession() ) { | 425 | if ( currentSession() ) { |
421 | TransferDialog dlg(this); | 426 | TransferDialog dlg(this); |
422 | dlg.showMaximized(); | 427 | dlg.showMaximized(); |
423 | dlg.exec(); | 428 | dlg.exec(); |
424 | // } | 429 | } |
425 | } | 430 | } |
426 | 431 | ||
427 | 432 | ||
428 | void MainWindow::slotOpenKeb(bool state) { | 433 | void MainWindow::slotOpenKeb(bool state) { |
429 | 434 | ||
430 | if (state) m_keyBar->show(); | 435 | if (state) m_keyBar->show(); |
@@ -432,12 +437,20 @@ void MainWindow::slotOpenKeb(bool state) { | |||
432 | 437 | ||
433 | } | 438 | } |
434 | void MainWindow::slotSessionChanged( Session* ses ) { | 439 | void MainWindow::slotSessionChanged( Session* ses ) { |
435 | if ( ses ) { | 440 | if ( ses ) { |
436 | qWarning("changing %s", ses->name().latin1() ); | 441 | qWarning("changing %s", ses->name().latin1() ); |
437 | m_curSession = ses; | 442 | m_curSession = ses; |
443 | |||
444 | if ( m_curSession->isConnected() ) { | ||
445 | m_connect->setEnabled( false ); | ||
446 | m_disconnect->setEnabled( true ); | ||
447 | } else { | ||
448 | m_connect->setEnabled( true ); | ||
449 | m_disconnect->setEnabled( false ); | ||
450 | } | ||
438 | } | 451 | } |
439 | } | 452 | } |
440 | 453 | ||
441 | void MainWindow::slotFullscreen() { | 454 | void MainWindow::slotFullscreen() { |
442 | 455 | ||
443 | if ( m_isFullscreen ) { | 456 | if ( m_isFullscreen ) { |
@@ -452,13 +465,13 @@ void MainWindow::slotFullscreen() { | |||
452 | ( m_curSession->widgetStack() )->reparent( 0,WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop, | 465 | ( m_curSession->widgetStack() )->reparent( 0,WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop, |
453 | QPoint(0,0), false); | 466 | QPoint(0,0), false); |
454 | ( m_curSession->widgetStack() )->resize(qApp->desktop()->width(), qApp->desktop()->height()); | 467 | ( m_curSession->widgetStack() )->resize(qApp->desktop()->width(), qApp->desktop()->height()); |
455 | ( m_curSession->widgetStack() )->setFocus(); | 468 | ( m_curSession->widgetStack() )->setFocus(); |
456 | ( m_curSession->widgetStack() )->show(); | 469 | ( m_curSession->widgetStack() )->show(); |
457 | 470 | ||
458 | // QPushButton *cornerButton = new QPushButton( this ); | 471 | //QPushButton *cornerButton = new QPushButton( ); |
459 | //cornerButton->setPixmap( QPixmap( (const char**)menu_xpm ) ); | 472 | //cornerButton->setPixmap( QPixmap( (const char**)menu_xpm ) ); |
460 | //connect( cornerButton, SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); | 473 | //connect( cornerButton, SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); |
461 | // need teh scrollbar | 474 | // need teh scrollbar |
462 | // ( m_curSession->widgetStack() )->setCornerWidget( cornerButton ); | 475 | // ( m_curSession->widgetStack() )->setCornerWidget( cornerButton ); |
463 | m_fullscreen->setText( tr("Stop full screen") ); | 476 | m_fullscreen->setText( tr("Stop full screen") ); |
464 | } | 477 | } |
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 | |||
@@ -14,13 +14,15 @@ | |||
14 | */ | 14 | */ |
15 | class Profile { | 15 | class Profile { |
16 | public: | 16 | public: |
17 | typedef QValueList<Profile> ValueList; | 17 | typedef QValueList<Profile> ValueList; |
18 | enum Color { Black = 0, | 18 | enum Color { Black = 0, |
19 | White, | 19 | White, |
20 | Gray }; | 20 | Gray, |
21 | Green, | ||
22 | Orange}; | ||
21 | enum Terminal {VT102 = 0, VT100 }; | 23 | enum Terminal {VT102 = 0, VT100 }; |
22 | enum Font { Micro = 0, Small, Medium }; | 24 | enum Font { Micro = 0, Small, Medium }; |
23 | Profile(); | 25 | Profile(); |
24 | Profile( const QString& name, | 26 | Profile( const QString& name, |
25 | const QCString& iolayerName, | 27 | const QCString& iolayerName, |
26 | const QCString& termName, | 28 | const QCString& termName, |
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 | |||
@@ -42,32 +42,38 @@ WidgetLayer* Session::emulationWidget() { | |||
42 | } | 42 | } |
43 | */ | 43 | */ |
44 | void Session::connect() { | 44 | void Session::connect() { |
45 | if ( !m_layer || !m_emu ) | 45 | if ( !m_layer || !m_emu ) |
46 | return; | 46 | return; |
47 | 47 | ||
48 | m_connected = true; | ||
49 | |||
48 | qWarning("connection in session"); | 50 | qWarning("connection in session"); |
49 | QObject::connect(m_layer, SIGNAL(received(const QByteArray&) ), | 51 | QObject::connect(m_layer, SIGNAL(received(const QByteArray&) ), |
50 | m_emu, SLOT(recv(const QByteArray&) ) ); | 52 | m_emu, SLOT(recv(const QByteArray&) ) ); |
51 | QObject::connect(m_emu, SIGNAL(send(const QByteArray&) ), | 53 | QObject::connect(m_emu, SIGNAL(send(const QByteArray&) ), |
52 | m_layer, SLOT(send(const QByteArray&) ) ); | 54 | m_layer, SLOT(send(const QByteArray&) ) ); |
53 | |||
54 | } | 55 | } |
56 | |||
55 | void Session::disconnect() { | 57 | void Session::disconnect() { |
56 | 58 | ||
57 | if ( !m_layer || !m_emu ) | 59 | if ( !m_layer || !m_emu ) |
58 | return; | 60 | return; |
59 | 61 | ||
62 | m_connected = false; | ||
63 | |||
60 | QObject::disconnect(m_layer, SIGNAL(received(const QByteArray&) ), | 64 | QObject::disconnect(m_layer, SIGNAL(received(const QByteArray&) ), |
61 | m_emu, SLOT(recv(const QByteArray&) ) ); | 65 | m_emu, SLOT(recv(const QByteArray&) ) ); |
62 | QObject::disconnect(m_emu, SIGNAL(send(const QByteArray&) ), | 66 | QObject::disconnect(m_emu, SIGNAL(send(const QByteArray&) ), |
63 | m_layer, SLOT(send(const QByteArray&) ) ); | 67 | m_layer, SLOT(send(const QByteArray&) ) ); |
64 | } | 68 | } |
69 | |||
65 | void Session::setName( const QString& na){ | 70 | void Session::setName( const QString& na){ |
66 | m_name = na; | 71 | m_name = na; |
67 | } | 72 | } |
73 | |||
68 | void Session::setWidgetStack( QWidgetStack* wid ) { | 74 | void Session::setWidgetStack( QWidgetStack* wid ) { |
69 | delete m_emu; | 75 | delete m_emu; |
70 | m_emu = 0l; | 76 | m_emu = 0l; |
71 | delete m_widget; | 77 | delete m_widget; |
72 | /* the EmulationLayer was destroyed... */ | 78 | /* the EmulationLayer was destroyed... */ |
73 | 79 | ||
@@ -85,6 +91,10 @@ void Session::setEmulationHandler( EmulationHandler* lay ) { | |||
85 | /* | 91 | /* |
86 | void Session::setEmulationWidget( WidgetLayer* lay ) { | 92 | void Session::setEmulationWidget( WidgetLayer* lay ) { |
87 | delete m_widLay; | 93 | delete m_widLay; |
88 | m_widLay = lay; | 94 | m_widLay = lay; |
89 | } | 95 | } |
90 | */ | 96 | */ |
97 | |||
98 | bool Session::isConnected() { | ||
99 | return m_connected; | ||
100 | } | ||
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 | |||
@@ -56,15 +56,18 @@ public: | |||
56 | 56 | ||
57 | void setWidgetStack( QWidgetStack* widget ); | 57 | void setWidgetStack( QWidgetStack* widget ); |
58 | void setEmulationHandler( EmulationHandler* lay ); | 58 | void setEmulationHandler( EmulationHandler* lay ); |
59 | void setIOLayer( IOLayer* ); | 59 | void setIOLayer( IOLayer* ); |
60 | void setName( const QString& ); | 60 | void setName( const QString& ); |
61 | 61 | ||
62 | bool isConnected(); | ||
63 | |||
62 | private: | 64 | private: |
63 | QString m_name; | 65 | QString m_name; |
64 | QWidgetStack* m_widget; | 66 | QWidgetStack* m_widget; |
65 | IOLayer* m_layer; | 67 | IOLayer* m_layer; |
66 | EmulationHandler* m_emu; | 68 | EmulationHandler* m_emu; |
69 | bool m_connected; | ||
67 | 70 | ||
68 | }; | 71 | }; |
69 | 72 | ||
70 | #endif | 73 | #endif |
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 | |||
@@ -16,13 +16,15 @@ namespace { | |||
16 | id_term_vt102, | 16 | id_term_vt102, |
17 | id_term_ansi | 17 | id_term_ansi |
18 | }; | 18 | }; |
19 | 19 | ||
20 | enum ColourIds { | 20 | enum ColourIds { |
21 | id_term_black, | 21 | id_term_black, |
22 | id_term_white | 22 | id_term_white, |
23 | id_term_green, | ||
24 | id_term_orange | ||
23 | }; | 25 | }; |
24 | 26 | ||
25 | enum FontIds { | 27 | enum FontIds { |
26 | id_size_small, | 28 | id_size_small, |
27 | id_size_medium, | 29 | id_size_medium, |
28 | id_size_large | 30 | id_size_large |
@@ -75,12 +77,14 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent, | |||
75 | m_terminalBox->insertItem( tr("VT 100"), id_term_vt100 ); | 77 | m_terminalBox->insertItem( tr("VT 100"), id_term_vt100 ); |
76 | m_terminalBox->insertItem( tr("VT 102"), id_term_vt102 ); | 78 | m_terminalBox->insertItem( tr("VT 102"), id_term_vt102 ); |
77 | //m_terminalBox->insertItem( tr("ANSI"), id_term_ansi ); | 79 | //m_terminalBox->insertItem( tr("ANSI"), id_term_ansi ); |
78 | 80 | ||
79 | m_colorCmb->insertItem( tr("black on white"), id_term_black ); | 81 | m_colorCmb->insertItem( tr("black on white"), id_term_black ); |
80 | m_colorCmb->insertItem( tr("white on black"), id_term_white ); | 82 | m_colorCmb->insertItem( tr("white on black"), id_term_white ); |
83 | m_colorCmb->insertItem( tr("green on black"), id_term_green ); | ||
84 | m_colorCmb->insertItem( tr("orange on black"), id_term_orange ); | ||
81 | 85 | ||
82 | // signals + slots | 86 | // signals + slots |
83 | /* | 87 | /* |
84 | connect(m_terminalBox, SIGNAL(activated(int) ), | 88 | connect(m_terminalBox, SIGNAL(activated(int) ), |
85 | this, SLOT(slotTermTerm(int) ) ); | 89 | this, SLOT(slotTermTerm(int) ) ); |
86 | connect(m_colorBox, SIGNAL(activated(int) ), | 90 | connect(m_colorBox, SIGNAL(activated(int) ), |
@@ -124,12 +128,18 @@ void TerminalWidget::load( const Profile& prof ) { | |||
124 | case Profile::Black: | 128 | case Profile::Black: |
125 | m_colorCmb->setCurrentItem(id_term_black ); | 129 | m_colorCmb->setCurrentItem(id_term_black ); |
126 | break; | 130 | break; |
127 | case Profile::White: | 131 | case Profile::White: |
128 | m_colorCmb->setCurrentItem(id_term_white ); | 132 | m_colorCmb->setCurrentItem(id_term_white ); |
129 | break; | 133 | break; |
134 | case Profile::Green: | ||
135 | m_colorCmb->setCurrentItem(id_term_green ); | ||
136 | break; | ||
137 | case Profile::Orange: | ||
138 | m_colorCmb->setCurrentItem(id_term_orange ); | ||
139 | break; | ||
130 | default: | 140 | default: |
131 | break; | 141 | break; |
132 | }; | 142 | }; |
133 | 143 | ||
134 | switch( fontsize ) { | 144 | switch( fontsize ) { |
135 | case Profile::Micro: | 145 | case Profile::Micro: |
@@ -172,12 +182,18 @@ void TerminalWidget::save( Profile& profile ) { | |||
172 | case id_term_black: | 182 | case id_term_black: |
173 | profile.writeEntry("Color", Profile::Black ); | 183 | profile.writeEntry("Color", Profile::Black ); |
174 | break; | 184 | break; |
175 | case id_term_white: | 185 | case id_term_white: |
176 | profile.writeEntry("Color", Profile::White ); | 186 | profile.writeEntry("Color", Profile::White ); |
177 | break; | 187 | break; |
188 | case id_term_green: | ||
189 | profile.writeEntry("Color", Profile::Green ); | ||
190 | break; | ||
191 | case id_term_orange: | ||
192 | profile.writeEntry("Color", Profile::Orange ); | ||
193 | break; | ||
178 | default: | 194 | default: |
179 | break; | 195 | break; |
180 | }; | 196 | }; |
181 | 197 | ||
182 | if (m_sizeSmall->isChecked() ) { | 198 | if (m_sizeSmall->isChecked() ) { |
183 | profile.writeEntry("Font", Profile::Micro ); | 199 | profile.writeEntry("Font", Profile::Micro ); |