-rw-r--r-- | noncore/apps/opie-console/emulation_handler.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 20 |
2 files changed, 7 insertions, 15 deletions
diff --git a/noncore/apps/opie-console/emulation_handler.cpp b/noncore/apps/opie-console/emulation_handler.cpp index c8022b9..956ac76 100644 --- a/noncore/apps/opie-console/emulation_handler.cpp +++ b/noncore/apps/opie-console/emulation_handler.cpp | |||
@@ -4,25 +4,25 @@ | |||
4 | #include "script.h" | 4 | #include "script.h" |
5 | 5 | ||
6 | /* OPIE */ | 6 | /* OPIE */ |
7 | #include <opie2/odebug.h> | 7 | #include <opie2/odebug.h> |
8 | using namespace Opie::Core; | 8 | using namespace Opie::Core; |
9 | 9 | ||
10 | EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent,const char* name ) | 10 | EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent,const char* name ) |
11 | : QObject(0, name ) | 11 | : QObject(0, name ) |
12 | { | 12 | { |
13 | m_teWid = new TEWidget( parent, "TerminalMain"); | 13 | m_teWid = new TEWidget( parent, "TerminalMain"); |
14 | // use setWrapAt(0) for classic behaviour (wrap at screen width, no scrollbar) | 14 | // use setWrapAt(0) for classic behaviour (wrap at screen width, no scrollbar) |
15 | // use setWrapAt(80) for normal console with scrollbar | 15 | // use setWrapAt(80) for normal console with scrollbar |
16 | setWrap(prof.readNumEntry("Wrap", 0) ? 0 : 80); | 16 | setWrap(prof.readNumEntry("Wrap", 80) ? 0 : 80); |
17 | m_teWid->setMinimumSize(150, 70 ); | 17 | m_teWid->setMinimumSize(150, 70 ); |
18 | m_script = 0; | 18 | m_script = 0; |
19 | parent->resize( m_teWid->calcSize(80, 24 ) ); | 19 | parent->resize( m_teWid->calcSize(80, 24 ) ); |
20 | m_teEmu = new TEmuVt102(m_teWid ); | 20 | m_teEmu = new TEmuVt102(m_teWid ); |
21 | 21 | ||
22 | connect(m_teEmu,SIGNAL(ImageSizeChanged(int,int) ), | 22 | connect(m_teEmu,SIGNAL(ImageSizeChanged(int,int) ), |
23 | this, SIGNAL(changeSize(int,int) ) ); | 23 | this, SIGNAL(changeSize(int,int) ) ); |
24 | connect(m_teEmu, SIGNAL(sndBlock(const char*,int) ), | 24 | connect(m_teEmu, SIGNAL(sndBlock(const char*,int) ), |
25 | this, SLOT(recvEmulation(const char*,int) ) ); | 25 | this, SLOT(recvEmulation(const char*,int) ) ); |
26 | m_teEmu->setConnect( true ); | 26 | m_teEmu->setConnect( true ); |
27 | m_teEmu->setHistory( TRUE ); | 27 | m_teEmu->setHistory( TRUE ); |
28 | load( prof ); | 28 | load( prof ); |
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index b160604..15290ce 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp | |||
@@ -132,36 +132,37 @@ void MainWindow::initUI() { | |||
132 | 132 | ||
133 | m_transfer = new QAction( tr("Transfer file..."), Resource::loadPixmap("pass") , QString::null, | 133 | m_transfer = new QAction( tr("Transfer file..."), Resource::loadPixmap("pass") , QString::null, |
134 | 0, this, 0 ); | 134 | 0, this, 0 ); |
135 | m_transfer->addTo( m_console ); | 135 | m_transfer->addTo( m_console ); |
136 | connect(m_transfer, SIGNAL(activated() ), | 136 | connect(m_transfer, SIGNAL(activated() ), |
137 | this, SLOT(slotTransfer() ) ); | 137 | this, SLOT(slotTransfer() ) ); |
138 | 138 | ||
139 | 139 | ||
140 | 140 | ||
141 | /* | 141 | /* |
142 | * immediate change of line wrap policy | 142 | * immediate change of line wrap policy |
143 | */ | 143 | */ |
144 | m_isWrapped = false; | 144 | m_isWrapped = true; |
145 | m_wrap = new QAction( tr("Line wrap"), Resource::loadPixmap( "linewrap" ), QString::null, 0, this, 0 ); | 145 | m_wrap = new QAction( tr("Line wrap"), Resource::loadPixmap( "linewrap" ), QString::null, 0, this, 0, true ); |
146 | m_wrap->addTo( m_console ); | 146 | m_wrap->addTo( m_console ); |
147 | m_wrap->setOn( true ); | ||
147 | connect( m_wrap, SIGNAL( activated() ), SLOT( slotWrap() ) ); | 148 | connect( m_wrap, SIGNAL( activated() ), SLOT( slotWrap() ) ); |
148 | 149 | ||
149 | /* | 150 | /* |
150 | * fullscreen | 151 | * fullscreen |
151 | */ | 152 | */ |
152 | m_isFullscreen = false; | 153 | m_isFullscreen = false; |
153 | 154 | ||
154 | m_fullscreen = new QAction( tr("Full screen"), Resource::loadPixmap( "fullscreen" ) | 155 | m_fullscreen = new QAction( tr("Full screen"), Resource::loadPixmap( "fullscreen" ) |
155 | , QString::null, 0, this, 0); | 156 | , QString::null, 0, this, 0, true ); |
156 | m_fullscreen->addTo( m_console ); | 157 | m_fullscreen->addTo( m_console ); |
157 | connect( m_fullscreen, SIGNAL( activated() ), | 158 | connect( m_fullscreen, SIGNAL( activated() ), |
158 | this, SLOT( slotFullscreen() ) ); | 159 | this, SLOT( slotFullscreen() ) ); |
159 | 160 | ||
160 | m_console->insertSeparator(); | 161 | m_console->insertSeparator(); |
161 | 162 | ||
162 | QAction *a = new QAction(); | 163 | QAction *a = new QAction(); |
163 | a->setText( tr("Save history") ); | 164 | a->setText( tr("Save history") ); |
164 | a->addTo( m_console ); | 165 | a->addTo( m_console ); |
165 | connect(a, SIGNAL(activated() ), | 166 | connect(a, SIGNAL(activated() ), |
166 | this, SLOT(slotSaveHistory() ) ); | 167 | this, SLOT(slotSaveHistory() ) ); |
167 | /* | 168 | /* |
@@ -525,25 +526,24 @@ void MainWindow::create( const Profile& prof ) { | |||
525 | m_closewindow->setEnabled( true ); | 526 | m_closewindow->setEnabled( true ); |
526 | m_transfer->setEnabled( false ); | 527 | m_transfer->setEnabled( false ); |
527 | m_recordScript->setEnabled( false ); | 528 | m_recordScript->setEnabled( false ); |
528 | m_saveScript->setEnabled( false ); | 529 | m_saveScript->setEnabled( false ); |
529 | m_scripts->setItemEnabled(m_runScript_id, false); | 530 | m_scripts->setItemEnabled(m_runScript_id, false); |
530 | 531 | ||
531 | // is io_layer wants direct connection, then autoconnect | 532 | // is io_layer wants direct connection, then autoconnect |
532 | //if ( ( m_curSession->layer() )->supports()[0] == 1 ) { | 533 | //if ( ( m_curSession->layer() )->supports()[0] == 1 ) { |
533 | if (prof.autoConnect()) { | 534 | if (prof.autoConnect()) { |
534 | slotConnect(); | 535 | slotConnect(); |
535 | } | 536 | } |
536 | 537 | ||
537 | |||
538 | QWidget *w = currentSession()->widget(); | 538 | QWidget *w = currentSession()->widget(); |
539 | if(w) w->setFocus(); | 539 | if(w) w->setFocus(); |
540 | 540 | ||
541 | if(currentSession()->profile().readNumEntry("Wrap", 80)){ | 541 | if(currentSession()->profile().readNumEntry("Wrap", 80)){ |
542 | m_isWrapped = true; | 542 | m_isWrapped = true; |
543 | } else { | 543 | } else { |
544 | m_isWrapped = false; | 544 | m_isWrapped = false; |
545 | } | 545 | } |
546 | 546 | ||
547 | m_kb->load(currentSession()->profile()); | 547 | m_kb->load(currentSession()->profile()); |
548 | } | 548 | } |
549 | 549 | ||
@@ -625,34 +625,26 @@ void MainWindow::slotSessionChanged( Session* ses ) { | |||
625 | 625 | ||
626 | m_kb->load(currentSession()->profile()); | 626 | m_kb->load(currentSession()->profile()); |
627 | } | 627 | } |
628 | } | 628 | } |
629 | 629 | ||
630 | void MainWindow::slotWrap() | 630 | void MainWindow::slotWrap() |
631 | { | 631 | { |
632 | if(m_curSession) | 632 | if(m_curSession) |
633 | { | 633 | { |
634 | EmulationHandler *e = m_curSession->emulationHandler(); | 634 | EmulationHandler *e = m_curSession->emulationHandler(); |
635 | if(e) | 635 | if(e) |
636 | { | 636 | { |
637 | if(m_isWrapped) | 637 | e->setWrap( m_isWrapped ? 80:0 ); |
638 | { | 638 | m_isWrapped = !m_isWrapped; |
639 | e->setWrap(80); | ||
640 | m_isWrapped = false; | ||
641 | } | ||
642 | else | ||
643 | { | ||
644 | e->setWrap(0); | ||
645 | m_isWrapped = true; | ||
646 | } | ||
647 | } | 639 | } |
648 | } | 640 | } |
649 | } | 641 | } |
650 | 642 | ||
651 | void MainWindow::slotFullscreen() { | 643 | void MainWindow::slotFullscreen() { |
652 | 644 | ||
653 | 645 | ||
654 | 646 | ||
655 | if ( m_isFullscreen ) { | 647 | if ( m_isFullscreen ) { |
656 | ( m_curSession->widgetStack() )->reparent( savedParentFullscreen, 0, QPoint(0,0), true ); | 648 | ( m_curSession->widgetStack() )->reparent( savedParentFullscreen, 0, QPoint(0,0), true ); |
657 | ( m_curSession->widgetStack() )->resize( savedParentFullscreen->width(), savedParentFullscreen->height() ); | 649 | ( m_curSession->widgetStack() )->resize( savedParentFullscreen->width(), savedParentFullscreen->height() ); |
658 | ( m_curSession->emulationHandler() )->cornerButton()->hide(); | 650 | ( m_curSession->emulationHandler() )->cornerButton()->hide(); |