Mercurial > hg > octave-nkf
diff libgui/src/main-window.h @ 17117:47b504503a3f
disable global paste action when clipboard is empty
* main_window.cc(constructor): initialize class variable for the clipboard,
(construct_edit_menu): don't set shortcut for paste action here, add new
menu for clearing the clipboard, connect the clipboard's change signal to
the new slot clipboard_has_changed,
(clipboard_has_changed): new slot enabling or disabling the paste and
clear clipboard action when clipboard has changed
(clear_clipboard): new slot for the clear clipboard action
* main_window.h: new slots clipboard-has_changed and clear_clipboard,
new class variable _clipboard, new action _clear_clipboard
author | Torsten <ttl@justmail.de> |
---|---|
date | Wed, 31 Jul 2013 21:25:04 +0200 |
parents | 359c5ca795cd |
children | 756bb4b58ad0 |
line wrap: on
line diff
--- a/libgui/src/main-window.h +++ b/libgui/src/main-window.h @@ -182,6 +182,11 @@ // setting global shortcuts void set_global_shortcuts (bool enable); + // handling the clipboard + void clipboard_has_changed (QClipboard::Mode); + void clear_clipboard (); + + protected: void closeEvent (QCloseEvent * closeEvent); @@ -286,6 +291,7 @@ QAction *_copy_action; QAction *_paste_action; + QAction *_clear_clipboard_action; QAction *_undo_action; QAction *_find_files_action; @@ -305,6 +311,8 @@ octave_qt_link *_octave_qt_link; + QClipboard *_clipboard; + // Flag for closing whole application. bool _closing; };