comparison libgui/src/main-window.cc @ 18684:86eca5d178a6 gui-release

disable some global shortcuts when editor gets focus to prevent conflicts * file-editor-tab.cc (constructor): connect signal from the qscintilla edit area about focus with the related new slot; (edit_area_has_focus): new slot for the focus signal from qscintilla edit area emitting a signal for enabling/disabling the common edit shortcuts * file-editor-tab.h: new slot edit_area_has_focus, new signal set_global_edit_shortcuts_signal * file-editor.cc (add_file_editor_tab ): connect new tab signal set_global_edit_shortcuts_signal with the related slot in main_window; (copyClipboard, pasteClipboard, selectAll): removed these functions because the related actions are triggered editor shortcuts * file-editor.h: remove copyClipboard, pasteClipboard, selectAll * octave-qscintilla.cc (focusInEvent, focusOutEvent): handlers emitting the signal about the focus state of the edit area * octave-qscintilla.h: new focus signal qsci_has_focus_signal, focus event handlers * main-window.cc (set_global_edit_shortcuts): new slot dis-/enabling the common edit shortcuts depending on focus of edit area * main-window.h: new slot set_global_edit_shortcuts
author Torsten <ttl@justmail.de>
date Sun, 27 Apr 2014 13:03:08 +0200
parents c199304dfb2a
children 7c78430535db 908523bd79b4
comparison
equal deleted inserted replaced
18675:c199304dfb2a 18684:86eca5d178a6
2276 { 2276 {
2277 2277
2278 } 2278 }
2279 2279
2280 void 2280 void
2281 main_window::set_global_edit_shortcuts (bool enable)
2282 {
2283 if (enable)
2284 {
2285 shortcut_manager::set_shortcut (_copy_action, "main_edit:copy");
2286 shortcut_manager::set_shortcut (_paste_action, "main_edit:paste");
2287 shortcut_manager::set_shortcut (_undo_action, "main_edit:undo");
2288 shortcut_manager::set_shortcut (_select_all_action, "main_edit:select_all");
2289 }
2290 else
2291 {
2292 QKeySequence no_key = QKeySequence ();
2293 _copy_action->setShortcut (no_key);
2294 _paste_action->setShortcut (no_key);
2295 _undo_action->setShortcut (no_key);
2296 _select_all_action->setShortcut (no_key);
2297 }
2298 }
2299
2300 void
2281 main_window::set_global_shortcuts (bool set_shortcuts) 2301 main_window::set_global_shortcuts (bool set_shortcuts)
2282 { 2302 {
2283 if (set_shortcuts) 2303 if (set_shortcuts)
2284 { 2304 {
2285 2305