author | josef <josef> | 2002-11-01 11:12:54 (UTC) |
---|---|---|
committer | josef <josef> | 2002-11-01 11:12:54 (UTC) |
commit | 4c5a56dbaddb3ac6b587c61a8ba6841987cf60fa (patch) (unidiff) | |
tree | 0172b37a635518ab48dcd0919d803371722a58c6 /noncore/apps/opie-console/mainwindow.cpp | |
parent | f99ad6016519a2f553c52812bac7859adb9aaa94 (diff) | |
download | opie-4c5a56dbaddb3ac6b587c61a8ba6841987cf60fa.zip opie-4c5a56dbaddb3ac6b587c61a8ba6841987cf60fa.tar.gz opie-4c5a56dbaddb3ac6b587c61a8ba6841987cf60fa.tar.bz2 |
- allow toggling of line wrap via menu, as requested
If there was an icon, an entry in the menu bar could be made.
Diffstat (limited to 'noncore/apps/opie-console/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 936b1b2..d221715 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp | |||
@@ -221,6 +221,13 @@ void MainWindow::initUI() { | |||
221 | connect(m_transfer, SIGNAL(activated() ), | 221 | connect(m_transfer, SIGNAL(activated() ), |
222 | this, SLOT(slotTransfer() ) ); | 222 | this, SLOT(slotTransfer() ) ); |
223 | 223 | ||
224 | /* | ||
225 | * immediate change of line wrap policy | ||
226 | */ | ||
227 | m_isWrapped = false; | ||
228 | m_wrap = new QAction( tr("Line wrap"), Resource::loadPixmap( "linewrap" ), QString::null, 0, this, 0 ); | ||
229 | m_wrap->addTo( m_console ); | ||
230 | connect( m_wrap, SIGNAL( activated() ), SLOT( slotWrap() ) ); | ||
224 | 231 | ||
225 | /* | 232 | /* |
226 | * fullscreen | 233 | * fullscreen |
@@ -324,6 +331,7 @@ void MainWindow::initUI() { | |||
324 | m_saveScript->setEnabled( false ); | 331 | m_saveScript->setEnabled( false ); |
325 | m_fullscreen->setEnabled( false ); | 332 | m_fullscreen->setEnabled( false ); |
326 | m_closewindow->setEnabled( false ); | 333 | m_closewindow->setEnabled( false ); |
334 | m_wrap->setEnabled( false ); | ||
327 | 335 | ||
328 | /* | 336 | /* |
329 | * connect to the menu activation | 337 | * connect to the menu activation |
@@ -525,6 +533,7 @@ void MainWindow::slotClose() { | |||
525 | m_saveScript->setEnabled( false ); | 533 | m_saveScript->setEnabled( false ); |
526 | m_scripts->setItemEnabled(m_runScript_id, false); | 534 | m_scripts->setItemEnabled(m_runScript_id, false); |
527 | m_fullscreen->setEnabled( false ); | 535 | m_fullscreen->setEnabled( false ); |
536 | m_wrap->setEnabled( false ); | ||
528 | m_closewindow->setEnabled( false ); | 537 | m_closewindow->setEnabled( false ); |
529 | } | 538 | } |
530 | 539 | ||
@@ -565,6 +574,7 @@ void MainWindow::create( const Profile& prof ) { | |||
565 | m_disconnect->setEnabled( false ); | 574 | m_disconnect->setEnabled( false ); |
566 | m_terminate->setEnabled( true ); | 575 | m_terminate->setEnabled( true ); |
567 | m_fullscreen->setEnabled( true ); | 576 | m_fullscreen->setEnabled( true ); |
577 | m_wrap->setEnabled( true ); | ||
568 | m_closewindow->setEnabled( true ); | 578 | m_closewindow->setEnabled( true ); |
569 | m_transfer->setEnabled( false ); | 579 | m_transfer->setEnabled( false ); |
570 | m_recordScript->setEnabled( false ); | 580 | m_recordScript->setEnabled( false ); |
@@ -581,6 +591,12 @@ void MainWindow::create( const Profile& prof ) { | |||
581 | QWidget *w = currentSession()->widget(); | 591 | QWidget *w = currentSession()->widget(); |
582 | if(w) w->setFocus(); | 592 | if(w) w->setFocus(); |
583 | 593 | ||
594 | if(currentSession()->profile().readNumEntry("Wrap", 80)){ | ||
595 | m_isWrapped = true; | ||
596 | } else { | ||
597 | m_isWrapped = false; | ||
598 | } | ||
599 | |||
584 | m_kb->load(currentSession()->profile()); | 600 | m_kb->load(currentSession()->profile()); |
585 | } | 601 | } |
586 | 602 | ||
@@ -654,10 +670,37 @@ void MainWindow::slotSessionChanged( Session* ses ) { | |||
654 | QWidget *w = m_curSession->widget(); | 670 | QWidget *w = m_curSession->widget(); |
655 | if(w) w->setFocus(); | 671 | if(w) w->setFocus(); |
656 | 672 | ||
673 | if(currentSession()->profile().readNumEntry("Wrap", 80)){ | ||
674 | m_isWrapped = true; | ||
675 | } else { | ||
676 | m_isWrapped = false; | ||
677 | } | ||
678 | |||
657 | m_kb->load(currentSession()->profile()); | 679 | m_kb->load(currentSession()->profile()); |
658 | } | 680 | } |
659 | } | 681 | } |
660 | 682 | ||
683 | void MainWindow::slotWrap() | ||
684 | { | ||
685 | if(m_curSession) | ||
686 | { | ||
687 | EmulationHandler *e = m_curSession->emulationHandler(); | ||
688 | if(e) | ||
689 | { | ||
690 | if(m_isWrapped) | ||
691 | { | ||
692 | e->setWrap(80); | ||
693 | m_isWrapped = false; | ||
694 | } | ||
695 | else | ||
696 | { | ||
697 | e->setWrap(0); | ||
698 | m_isWrapped = true; | ||
699 | } | ||
700 | } | ||
701 | } | ||
702 | } | ||
703 | |||
661 | void MainWindow::slotFullscreen() { | 704 | void MainWindow::slotFullscreen() { |
662 | 705 | ||
663 | 706 | ||