Mercurial > hg > octave-lyh
comparison libgui/src/main-window.h @ 17121: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 |
comparison
equal
deleted
inserted
replaced
17120:59acfe9209dd | 17121:47b504503a3f |
---|---|
180 void find_files_finished(int); | 180 void find_files_finished(int); |
181 | 181 |
182 // setting global shortcuts | 182 // setting global shortcuts |
183 void set_global_shortcuts (bool enable); | 183 void set_global_shortcuts (bool enable); |
184 | 184 |
185 // handling the clipboard | |
186 void clipboard_has_changed (QClipboard::Mode); | |
187 void clear_clipboard (); | |
188 | |
189 | |
185 protected: | 190 protected: |
186 void closeEvent (QCloseEvent * closeEvent); | 191 void closeEvent (QCloseEvent * closeEvent); |
187 | 192 |
188 private: | 193 private: |
189 | 194 |
284 QAction *_new_script_action; | 289 QAction *_new_script_action; |
285 QAction *_open_action; | 290 QAction *_open_action; |
286 | 291 |
287 QAction *_copy_action; | 292 QAction *_copy_action; |
288 QAction *_paste_action; | 293 QAction *_paste_action; |
294 QAction *_clear_clipboard_action; | |
289 QAction *_undo_action; | 295 QAction *_undo_action; |
290 | 296 |
291 QAction *_find_files_action; | 297 QAction *_find_files_action; |
292 QAction *_exit_action; | 298 QAction *_exit_action; |
293 | 299 |
303 | 309 |
304 octave_main_thread *_octave_main_thread; | 310 octave_main_thread *_octave_main_thread; |
305 | 311 |
306 octave_qt_link *_octave_qt_link; | 312 octave_qt_link *_octave_qt_link; |
307 | 313 |
314 QClipboard *_clipboard; | |
315 | |
308 // Flag for closing whole application. | 316 // Flag for closing whole application. |
309 bool _closing; | 317 bool _closing; |
310 }; | 318 }; |
311 | 319 |
312 #endif // MAINWINDOW_H | 320 #endif // MAINWINDOW_H |