Репозиторий Sisyphus
Последнее обновление: 27 февраля 2021 | Пакетов: 17840 | Посещений: 20348345
en ru br
Репозитории ALT

Группа :: Терминалы
Пакет: kde4-konsole

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: BR59256fixed.diff
Скачать


Index: Vt102Emulation.cpp
===================================================================
--- Vt102Emulation.cpp	(revision 939188)
+++ Vt102Emulation.cpp	(working copy)
@@ -957,6 +957,31 @@
             textToSend += _codec->fromUnicode(event->text());
 
         sendData( textToSend.constData() , textToSend.length() );
+        
+        if ( entry.command() != KeyboardTranslator::NoCommand && sender() )
+        {
+            switch ( entry.command() )
+            {
+                case KeyboardTranslator::ScrollLineUpCommand:
+                    QMetaObject::invokeMethod( sender(), "scrollLineUp" );
+                    break;
+
+                case KeyboardTranslator::ScrollLineDownCommand:
+                    QMetaObject::invokeMethod( sender(), "scrollLineDown" );
+                    break;
+
+                case KeyboardTranslator::ScrollPageUpCommand:
+                    QMetaObject::invokeMethod( sender(), "scrollPageUp" );
+                    break;
+
+                case KeyboardTranslator::ScrollPageDownCommand:
+                    QMetaObject::invokeMethod( sender(), "scrollPageDown" );
+                    break;
+
+                default:
+                    break;
+            }
+        }
     }
     else
     {
Index: TerminalDisplay.h
===================================================================
--- TerminalDisplay.h	(revision 939188)
+++ TerminalDisplay.h	(working copy)
@@ -485,6 +485,11 @@
      */
     void setForegroundColor(const QColor& color);
 
+    void scrollLineUp();
+    void scrollLineDown();
+    void scrollPageUp();
+    void scrollPageDown();
+
 signals:
 
     /**
@@ -662,6 +667,8 @@
     // redraws the cursor
     void updateCursor();
 
+    void scrolled();
+
     bool handleShortcutOverrideEvent(QKeyEvent* event);
 
     // the window onto the terminal screen which this display
Index: TerminalDisplay.cpp
===================================================================
--- TerminalDisplay.cpp	(revision 939188)
+++ TerminalDisplay.cpp	(working copy)
@@ -2446,44 +2446,6 @@
 
 void TerminalDisplay::keyPressEvent( QKeyEvent* event )
 {
-    bool emitKeyPressSignal = true;
-
-    // Keyboard-based navigation
-    if ( event->modifiers() == Qt::ShiftModifier )
-    {
-        bool update = true;
-
-        if ( event->key() == Qt::Key_PageUp )
-        {
-            _screenWindow->scrollBy( ScreenWindow::ScrollPages , -1 );
-        }
-        else if ( event->key() == Qt::Key_PageDown )
-        {
-            _screenWindow->scrollBy( ScreenWindow::ScrollPages , 1 );
-        }
-        else if ( event->key() == Qt::Key_Up )
-        {
-            _screenWindow->scrollBy( ScreenWindow::ScrollLines , -1 );
-        }
-        else if ( event->key() == Qt::Key_Down )
-        {
-            _screenWindow->scrollBy( ScreenWindow::ScrollLines , 1 );
-        }
-        else
-            update = false;
-
-        if ( update )
-        {
-            _screenWindow->setTrackOutput( _screenWindow->atEndOfOutput() );
-            
-            updateLineProperties();
-            updateImage();
-
-            // do not send key press to terminal
-            emitKeyPressSignal = false;
-        }
-    }
-
     _actSel=0; // Key stroke implies a screen update, so TerminalDisplay won't
               // know where the current selection is.
 
@@ -2496,8 +2458,7 @@
         _cursorBlinking = false;
     }
 
-    if ( emitKeyPressSignal )
-        emit keyPressedSignal(event);
+    emit keyPressedSignal(event);
 
     event->accept();
 }
@@ -2881,6 +2842,19 @@
   setVTFont(font()); // Trigger an update.
 }
 
+void TerminalDisplay::scrolled()
+{
+    _screenWindow->setTrackOutput( _screenWindow->atEndOfOutput() );
+    updateLineProperties();
+    updateImage();
+}
+
+void TerminalDisplay::scrollLineUp()    { _screenWindow->scrollBy( ScreenWindow::ScrollLines, -1 ); scrolled(); }
+void TerminalDisplay::scrollLineDown()  { _screenWindow->scrollBy( ScreenWindow::ScrollLines,  1 ); scrolled(); }
+void TerminalDisplay::scrollPageUp()    { _screenWindow->scrollBy( ScreenWindow::ScrollPages, -1 ); scrolled(); }
+void TerminalDisplay::scrollPageDown()  { _screenWindow->scrollBy( ScreenWindow::ScrollPages,  1 ); scrolled(); }
+
+
 AutoScrollHandler::AutoScrollHandler(QWidget* parent)
 : QObject(parent)
 , _timerId(0)
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin