Mercurial > octave
diff libgui/src/m-editor/file-editor.h @ 20986:00835323fb44
prevent shortcut ambiguity between main and editor window
* file-editor-interface.h: renamed insert_new_open_actions into
insert_global_actions
* file-editor-tab.h: no more signal for setting edit shortcuts
* file-editor.cc (file_editor): initialize actions that will be copied from
main window;
(request_undo, request_copy, request_paste, request_selectall): remove
slots for obsolete own action signals;
(do_undo, copyClipboard, pasteClipboard, selectAll): and move the relevant
code into these already existing slots of the related main window actions;
(handle_tab_remove_request): make sure that the focus stays in editor window
when tabs are closed;
(edit_status_update, handle_editor_state_changed): only enable undo or copy
action if already copied from main window;
(insert_global_actions) renamed from insert_new_open_actions, insert some
global actions and copy those global actions that are en/disabled depending
on editor state;
(enable_menu_shortcuts): when editor loses focus enable copy and undo
action since these are alwys active in the main window;
(construct): edit menu is stored in a class variable, actions that are
copied from the main menu are not added to the menus here;
(set_shortcuts): no shortcuts for the actions from the main menu;
(check_actions): do not disable paste-/select-all-action when no tab is open;
* file-editor.h: renamed insert_new_open_actions into insert_global_actions,
no more slots for the action that are now copied from the main window,
* octave-qscintilla.cc (octave_qscintilla): initialize undo and redo state
for editor actions;
(focusInEvent): emit undo and redo state for the editor actions;
* octave-qscintilla.h: focusInEvent
* main-window.cc (notice_settings): use renamed function for switching
menu_bar accelerators between main window and editor;
(construct): removed list and signal for adding common action to the dock
widgets, since these action are globally valid;
(construct_menu_bar): call function for inserting some action to the editor
here and not in construct_file_menu;
(disable_menu_shortcuts) renamed from enable_menu_shortcuts;
(construct_edit_menu): global edit actions with ApplicationShortcut context;
(set_global_edit_shortcuts): removed obsolete function since global edit
actions now only exist once
* main-window.h: removed obsolete function set_global_edit_shortcuts,
renamed function enable_menu_shortcuts into disable_menu_shortcuts,
* octave-dock-widget.cc (octave_dock_widget, add_actions): removed
obsolete slot for adding actions from the main window
* octave-dock-widget.h: removed slots add_actions
* shortcut-manager.cc (do_init_data): remove shortcuts for obsolete editor
actions which are now copied from the main window;
(init): do not store widget name in the shortcut hash since duplicate
shortcuts in different widgets are not possible anymore;
(do_fill_treewidget): adapt check for duplicate shortcuts accordingly;
(shortcut_dialog_finish): changes related to changed shortcut hash
author | Torsten <ttl@justmail.de> |
---|---|
date | Fri, 25 Dec 2015 22:31:23 +0100 |
parents | 9d9270e2f98f |
children | 98e75f952a36 |
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor.h Fri Dec 25 20:07:28 2015 +0100 +++ b/libgui/src/m-editor/file-editor.h Fri Dec 25 22:31:23 2015 +0100 @@ -85,7 +85,8 @@ QMenu *get_mru_menu (void) { return _mru_file_menu; } QMenu *debug_menu (void); QToolBar *toolbar (void); - void insert_new_open_actions (QAction*,QAction*,QAction*); + void insert_global_actions (QAction*, QAction*, QAction*, QAction*, + QAction*, QAction*, QAction*); void handle_enter_debug_mode (void); void handle_exit_debug_mode (void); @@ -161,12 +162,8 @@ void request_mru_open_file (QAction *action); void request_print_file (bool); - void request_undo (bool); void request_redo (bool); - void request_copy (bool); void request_cut (bool); - void request_paste (bool); - void request_selectall (bool); void request_context_help (bool); void request_context_doc (bool); void request_context_edit (bool); @@ -391,6 +388,7 @@ QAction *_previous_breakpoint_action; QAction *_remove_all_breakpoints_action; + QMenu *_edit_menu; QMenu *_edit_cmd_menu; QMenu *_edit_fmt_menu; QMenu *_edit_nav_menu;