author | harlekin <harlekin> | 2002-10-15 10:46:40 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-10-15 10:46:40 (UTC) |
commit | daae7a75b0e9ccbf1ea4c699c631ad77825e6301 (patch) (unidiff) | |
tree | 94bd75c58f42d8752b62a2281a5175a8e746f9ff | |
parent | e09b7ab685d29eba947c3bb021192408acae70be (diff) | |
download | opie-daae7a75b0e9ccbf1ea4c699c631ad77825e6301.zip opie-daae7a75b0e9ccbf1ea4c699c631ad77825e6301.tar.gz opie-daae7a75b0e9ccbf1ea4c699c631ad77825e6301.tar.bz2 |
- more menu handling \n - added 2 more color shemes
-rw-r--r-- | noncore/apps/opie-console/TEScreen.h | 8 | ||||
-rw-r--r-- | noncore/apps/opie-console/emulation_handler.cpp | 17 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 31 | ||||
-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, 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 | |||
@@ -137,7 +137,7 @@ public: // these are all `Screen' operations | |||
137 | void resizeImage(int new_lines, int new_columns); | 137 | void resizeImage(int new_lines, int new_columns); |
138 | // | 138 | // |
139 | ca* getCookedImage(); | 139 | ca* getCookedImage(); |
140 | 140 | ||
141 | /*! return the number of lines. */ | 141 | /*! return the number of lines. */ |
142 | int getLines() { return lines; } | 142 | int getLines() { return lines; } |
143 | /*! return the number of columns. */ | 143 | /*! return the number of columns. */ |
@@ -166,7 +166,7 @@ private: // helper | |||
166 | 166 | ||
167 | void clearImage(int loca, int loce, char c); | 167 | void clearImage(int loca, int loce, char c); |
168 | void moveImage(int dst, int loca, int loce); | 168 | void moveImage(int dst, int loca, int loce); |
169 | 169 | ||
170 | void scrollUp(int from, int i); | 170 | void scrollUp(int from, int i); |
171 | void scrollDown(int from, int i); | 171 | void scrollDown(int from, int i); |
172 | 172 | ||
@@ -199,7 +199,7 @@ private: | |||
199 | 199 | ||
200 | int histCursor; // display position relative to start of the history buffer | 200 | int histCursor; // display position relative to start of the history buffer |
201 | HistoryScroll hist; | 201 | HistoryScroll hist; |
202 | 202 | ||
203 | // cursor location | 203 | // cursor location |
204 | 204 | ||
205 | int cuX; | 205 | int cuX; |
@@ -238,7 +238,7 @@ private: | |||
238 | 238 | ||
239 | // | 239 | // |
240 | // save cursor, rendition & states ------------ | 240 | // save cursor, rendition & states ------------ |
241 | // | 241 | // |
242 | 242 | ||
243 | // cursor location | 243 | // cursor location |
244 | 244 | ||
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 | |||
@@ -107,6 +107,15 @@ QColor EmulationHandler::foreColor(int col) { | |||
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; |
@@ -125,6 +134,14 @@ QColor EmulationHandler::backColor(int col ) { | |||
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; |
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,15 +314,20 @@ 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 | } | 320 | m_connect->setEnabled( false ); |
321 | m_disconnect->setEnabled( true ); | ||
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() { |
@@ -405,7 +410,7 @@ void MainWindow::create( const Profile& prof ) { | |||
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 ); |
@@ -417,11 +422,11 @@ void MainWindow::create( const Profile& prof ) { | |||
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 | ||
@@ -435,6 +440,14 @@ 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 | ||
@@ -455,7 +468,7 @@ void MainWindow::slotFullscreen() { | |||
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 |
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 | |||
@@ -17,7 +17,9 @@ 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(); |
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 | |||
@@ -45,26 +45,32 @@ 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; |
@@ -88,3 +94,7 @@ void Session::setEmulationWidget( WidgetLayer* lay ) { | |||
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 | |||
@@ -59,11 +59,14 @@ public: | |||
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 | ||
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 | |||
@@ -19,7 +19,9 @@ namespace { | |||
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 { |
@@ -78,6 +80,8 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent, | |||
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 | /* |
@@ -127,6 +131,12 @@ void TerminalWidget::load( const Profile& prof ) { | |||
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 | }; |
@@ -175,6 +185,12 @@ void TerminalWidget::save( Profile& profile ) { | |||
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 | }; |