Mercurial > octave-nkf
comparison libgui/qterminal/libqterminal/unix/TerminalView.cpp @ 19724:bd1369a2a651
add extra action for interrupting with Ctrl-C (bug #44204)
* QTerminal.cc (notice_settings): check if copy-shortcut is Ctrl-C and set flag
for slots and enable/disable new interrupt-action accordingly
* QTerminal.h: new function setting flag (purely virtual);
(constructor): new interrupt-action with shortcut Ctrl-C
* QUnixTerminalImpl.cpp (copyClipboard): call internal function with flag;
(has_extra_interrupt): new function for setting flag for copy-/interrupt-
slots
* QUnixTerminalImpl.h new flag for slots and function setting flag
* TerminalView.cpp (copyClipboard): gets flag as parameter, only interrupts
if Ctrl-C is shortcut for copy
* TerminalView.h: copyClipboard with boolean parameter
* QWinTerminalImpl.cpp (copyClipboard): only interrupts if Ctrl-C is shortcut
for copy;
(has_extra_interrupt): function for setting flag for copy-/interrupts-slots
* QWinTerminalImpl.h: new flag and function setting the flag
author | Torsten <ttl@justmail.de> |
---|---|
date | Mon, 09 Feb 2015 09:56:25 +0100 |
parents | 0e1f5a750d00 |
children | 4197fc428c7d |
comparison
equal
deleted
inserted
replaced
19723:894b5c5e0b92 | 19724:bd1369a2a651 |
---|---|
2270 void TerminalView::setSelection(const QString& t) | 2270 void TerminalView::setSelection(const QString& t) |
2271 { | 2271 { |
2272 QApplication::clipboard()->setText(t, QClipboard::Selection); | 2272 QApplication::clipboard()->setText(t, QClipboard::Selection); |
2273 } | 2273 } |
2274 | 2274 |
2275 void TerminalView::copyClipboard() | 2275 void TerminalView::copyClipboard(bool extra_interrupt) |
2276 { | 2276 { |
2277 if ( !_screenWindow || !hasFocus()) | 2277 if ( !_screenWindow || !hasFocus()) |
2278 return; | 2278 return; |
2279 | 2279 |
2280 QString text = _screenWindow->selectedText(_preserveLineBreaks); | 2280 QString text = _screenWindow->selectedText(_preserveLineBreaks); |
2281 | 2281 |
2282 if (text.isEmpty ()) | 2282 if (text.isEmpty () && ! extra_interrupt) |
2283 emit interrupt_signal (); | 2283 emit interrupt_signal (); |
2284 else | 2284 else |
2285 QApplication::clipboard()->setText(text); | 2285 QApplication::clipboard()->setText(text); |
2286 } | 2286 } |
2287 | 2287 |
2309 | 2309 |
2310 void TerminalView::pasteSelection() | 2310 void TerminalView::pasteSelection() |
2311 { | 2311 { |
2312 emitSelection(true,false); | 2312 emitSelection(true,false); |
2313 } | 2313 } |
2314 | |
2314 | 2315 |
2315 /* ------------------------------------------------------------------------- */ | 2316 /* ------------------------------------------------------------------------- */ |
2316 /* */ | 2317 /* */ |
2317 /* Keyboard */ | 2318 /* Keyboard */ |
2318 /* */ | 2319 /* */ |