diff libgui/qterminal/libqterminal/unix/TerminalView.cpp @ 16970:78116b88dbf5

enable readline key bindings in terminal widget of gui (bug #36986) * TerminalView.cpp(constructor): connect signal indicating focus change to related slot of main window for setting/resetting shortcuts, (focusInEvent,focusOutEvent): emit focus change signal * TerminalView.h: new signal set_global_shortcuts_signal for focus change * QWinTerminalImpl.cpp(constructor): connect signal indicating focus change to related slot in main window, (focusInEvent,focusOutEvent): emit focus change signal * QWinTerminalImpl.h: new signal set_global_shortcuts_signal for focus change * main-window.cc(construct): connect signal emitted on terminal focus change to related slot of the editor for setting/resetting shortcuts, call new function set_global_shortcuts for initializing shortcuts (construct_file_menu): add shortcut conext for open action, class variable for exit action (construct_new_menu): add shortcut conext for new action, (construct_edit_menu): make find files action a class variable, (set_global_shortcuts): new slot for setting or resetting some shortcuts, also emits signal for child widgets * main-window.h: new slot set_global_shortcuts, new signal set_widget_shortcuts_signal, class wide variables for find files and exit action * file-editor.cc(construct): change QActions into class wide variables and add _ before variale names, do not set shortcuts, call set_shortcuts instead, (set_shortcuts): new function for setting or resetting shortcuts * file-editor.h: new function set_shortcuts, new names for QActions
author Torsten <ttl@justmail.de>
date Sat, 13 Jul 2013 10:28:57 +0200
parents eefcfeb37446
children d63878346099
line wrap: on
line diff
--- a/libgui/qterminal/libqterminal/unix/TerminalView.cpp	Fri Jul 12 20:31:08 2013 -0700
+++ b/libgui/qterminal/libqterminal/unix/TerminalView.cpp	Sat Jul 13 10:28:57 2013 +0200
@@ -319,6 +319,10 @@
   _gridLayout->setMargin(0);
 
   setLayout( _gridLayout );
+
+  connect (this, SIGNAL (set_global_shortcuts_signal (bool)),
+           parent->parent (), SLOT (set_global_shortcuts (bool)));
+
 }
 
 TerminalView::~TerminalView()
@@ -1058,6 +1062,8 @@
 
 void TerminalView::focusInEvent(QFocusEvent *focusEvent)
 {
+  emit set_global_shortcuts_signal (false);  // disable some shortcuts
+
   setBlinkingCursorState(true);
   updateImage();
   repaint();
@@ -1068,6 +1074,8 @@
 
 void TerminalView::focusOutEvent(QFocusEvent *focusEvent)
 {
+  emit set_global_shortcuts_signal (true);  // re-enable shortcuts
+
   // Force the cursor to be redrawn.
   _cursorBlinking = true;
   setBlinkingCursorState(false);