Mercurial > octave
diff libgui/qterminal/libqterminal/QTerminal.h @ 20987:f99cbd86a0f9
Prevent closing GUI by Ctrl+D in terminal (bug #46661)
* QTerminal.cc (set_global_shortcuts): (un)set shortcut Ctrl-D for dummy action;
(notice_settings): do not consider obsolete shortcut sets, check whether
Ctrl+D is used as global shortcut and enable the dummy action accordingly
* QTerminal.h (QTerminal): new dummy action with shortcut Ctrl+D
* shortcut-manager.cc (do_init_data): reset flag for global Ctrl-D usage;
(init, do_write_shortcuts): check for Ctrl-D usage as global shortcut and
set the flag in settings accordingly
author | Torsten <ttl@justmail.de> |
---|---|
date | Sat, 26 Dec 2015 08:49:41 +0100 |
parents | 88233ac3f3ea |
children | dd1dcef1ee33 |
line wrap: on
line diff
--- a/libgui/qterminal/libqterminal/QTerminal.h Fri Dec 25 22:31:23 2015 +0100 +++ b/libgui/qterminal/libqterminal/QTerminal.h Sat Dec 26 08:49:41 2015 +0100 @@ -179,6 +179,13 @@ connect (_interrupt_action, SIGNAL (triggered ()), this, SLOT (terminal_interrupt ())); + + // dummy (nop) action catching Ctrl-D in terminal, no connection + _nop_action = new QAction (this); + addAction (_nop_action); + + _nop_action->setShortcut ( + QKeySequence (Qt::ControlModifier + Qt::Key_D)); } private: @@ -189,6 +196,7 @@ QAction * _selectall_action; QAction *_interrupt_action; + QAction *_nop_action; }; #endif // QTERMINAL_H