# HG changeset patch # User Torsten # Date 1421905957 -3600 # Node ID d258070914ef17a455fba7450ad7c7d584ee90a3 # Parent b6bd9159c1c9c4b6e6fba800bbc39993d69442b2 open file directly without edit command when editing a function from editor * file-editor-tab.cc (handle_context_menu_edit): append .m to file name if necessary, emit new signal to editor for the file open request * file-editor-tab.h: new signal requesting to open a file * file-editor.cc (add_file_editor_tab): connect new request-open-signal to the already existing slot for opening a file diff -r b6bd9159c1c9 -r d258070914ef libgui/src/m-editor/file-editor-tab.cc --- a/libgui/src/m-editor/file-editor-tab.cc Tue Jan 20 22:19:18 2015 +0100 +++ b/libgui/src/m-editor/file-editor-tab.cc Thu Jan 22 06:52:37 2015 +0100 @@ -311,8 +311,10 @@ filename = QString::fromStdString ( map.contents ("file").data ()[0].string_value ()); - emit execute_command_in_terminal_signal (QString("edit ") - + "\""+filename+"\""); + if (! filename.endsWith (".m")) + filename.append (".m"); + + emit request_open_file (filename); } void diff -r b6bd9159c1c9 -r d258070914ef libgui/src/m-editor/file-editor-tab.h --- a/libgui/src/m-editor/file-editor-tab.h Tue Jan 20 22:19:18 2015 +0100 +++ b/libgui/src/m-editor/file-editor-tab.h Thu Jan 22 06:52:37 2015 +0100 @@ -138,6 +138,7 @@ void execute_command_in_terminal_signal (const QString&); void set_global_edit_shortcuts_signal (bool); void create_context_menu_tab_signal (QMenu *); + void request_open_file (const QString&); protected: diff -r b6bd9159c1c9 -r d258070914ef libgui/src/m-editor/file-editor.cc --- a/libgui/src/m-editor/file-editor.cc Tue Jan 20 22:19:18 2015 +0100 +++ b/libgui/src/m-editor/file-editor.cc Thu Jan 22 06:52:37 2015 +0100 @@ -1615,6 +1615,9 @@ connect (f, SIGNAL (execute_command_in_terminal_signal (const QString&)), main_win (), SLOT (execute_command_in_terminal (const QString&))); + connect (f, SIGNAL (request_open_file (const QString&)), + this, SLOT (request_open_file (const QString&))); + connect (f, SIGNAL (set_global_edit_shortcuts_signal (bool)), main_win (), SLOT (set_global_edit_shortcuts (bool)));