Mercurial > octave-nkf
comparison libgui/src/m-editor/octave-qscintilla.cc @ 18801:095fdef3d67c gui-release
use editors run selection action for the context menu
* file-editor-tab.cc (constructor): initialize flag for octave file;
(update_lexer): set flag for octave file;
(set_file_name, handle_copy_available, change_editor_state):
editor_state_changed signal uses flag for octave file;
* file-editor-tab.h: flag for octave file, also used in editor_state_changed
* file-editor.cc (create_context_menu): add action for running selection;
(handle_editor_state_changed): gets flag whether file is an octave script,
enable run action and run selection action depending on selection and file
type;
(add_file_editor_tab): connect editor_state_changed to
handle_editor_state_changedwith new third parameter;
* file-editor.h: handle_editor_state_changed has a new third parameter
* octave-qscintilla.cc (contextMenuEvent): run selection is added by the edtior
author | Torsten <ttl@justmail.de> |
---|---|
date | Fri, 16 May 2014 20:01:27 +0200 |
parents | fac35875f6eb |
children | 888f8ce79bbe c6b89c4a9e63 |
comparison
equal
deleted
inserted
replaced
18794:be569698970c | 18801:095fdef3d67c |
---|---|
198 + " " + _word_at_cursor, | 198 + " " + _word_at_cursor, |
199 this, SLOT (contextmenu_doc (bool))); | 199 this, SLOT (contextmenu_doc (bool))); |
200 context_menu->addAction (tr ("Edit") + " " + _word_at_cursor, | 200 context_menu->addAction (tr ("Edit") + " " + _word_at_cursor, |
201 this, SLOT (contextmenu_edit (bool))); | 201 this, SLOT (contextmenu_edit (bool))); |
202 } | 202 } |
203 context_menu->addSeparator (); // separator before custom entries | |
204 if (hasSelectedText ()) | |
205 context_menu->addAction (tr ("&Run Selection"), | |
206 this, SLOT (contextmenu_run (bool))); | |
207 } | 203 } |
208 | 204 |
209 // finaly show the menu | 205 // finaly show the menu |
210 context_menu->exec (global_pos); | 206 context_menu->exec (global_pos); |
211 } | 207 } |