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 @@ -223,2 +223,9 @@ void MainWindow::initUI() { + /* + * immediate change of line wrap policy + */ + m_isWrapped = false; + m_wrap = new QAction( tr("Line wrap"), Resource::loadPixmap( "linewrap" ), QString::null, 0, this, 0 ); + m_wrap->addTo( m_console ); + connect( m_wrap, SIGNAL( activated() ), SLOT( slotWrap() ) ); @@ -326,2 +333,3 @@ void MainWindow::initUI() { m_closewindow->setEnabled( false ); + m_wrap->setEnabled( false ); @@ -527,2 +535,3 @@ void MainWindow::slotClose() { m_fullscreen->setEnabled( false ); + m_wrap->setEnabled( false ); m_closewindow->setEnabled( false ); @@ -567,2 +576,3 @@ void MainWindow::create( const Profile& prof ) { m_fullscreen->setEnabled( true ); + m_wrap->setEnabled( true ); m_closewindow->setEnabled( true ); @@ -583,2 +593,8 @@ void MainWindow::create( const Profile& prof ) { + if(currentSession()->profile().readNumEntry("Wrap", 80)){ + m_isWrapped = true; + } else { + m_isWrapped = false; + } + m_kb->load(currentSession()->profile()); @@ -656,2 +672,8 @@ void MainWindow::slotSessionChanged( Session* ses ) { + if(currentSession()->profile().readNumEntry("Wrap", 80)){ + m_isWrapped = true; + } else { + m_isWrapped = false; + } + m_kb->load(currentSession()->profile()); @@ -660,2 +682,23 @@ void MainWindow::slotSessionChanged( Session* ses ) { +void MainWindow::slotWrap() +{ + if(m_curSession) + { + EmulationHandler *e = m_curSession->emulationHandler(); + if(e) + { + if(m_isWrapped) + { + e->setWrap(80); + m_isWrapped = false; + } + else + { + e->setWrap(0); + m_isWrapped = true; + } + } + } +} + void MainWindow::slotFullscreen() { |