diff libgui/src/main-window.h @ 27556:410622ac120f

improve run selection from editor (bug #42705) * file-editor-tab.cc (file_editor_tab): relay interpreter event signals to the ones of the editor widget * file-editor.cc (make_file_editor_tab): connect signal of edit area for giving focus to console window to the new slot in main_window * octave-qscintilla.cc: include headers required for interpreter threads and for additionally used Qt libs; (octave_qscintilla): connect new signals for finished run selection action to the new related slot; (contextmenu_run_temp_error): new method displaying a message box on error handling temp. files; (contextmenu_run): create a temp. file with all selected lines extended by commands for displaying each line and add it to the command history, disable opening a file at breakpoints, run this temp. file by the interpreter and emit new signal when running this file is finished; (ctx_menu_run_finished): slot when running the temp. file is finished, removing temp. files and reset modified editor preferences; * octave-qscintilla.h: include QSettings and interpreter-events, interpreter signal, signal for focusing console window and signal when running temp file is finished, new slot for the latter * main-window.cc (focus_console_after_command): do not return the related setting, but actually give console window the focus if desired, (run_file_in_terminal, execute_command_in_terminal): use this new form * main-window.h: change focus_console_method from private method into public slot * resource-manager.cc (resource_manager): initialize new list of created temp. files; (~resource_manager): remove any temp. files that are still existing; (do_create_tmp_file): create a new temp. file with the given contents and store its smart pointer into a list for removing the file later; (do_remove_tmp_file): remove given temp. file and remove it from the list; * resource-manager.h: include QPointer and QTemporaryFile, (create_tmp_file): new static method calling internal do_create_tmp_file; (remove_tmp_file): new static method calling internal do_create_tmp_file; new internal methods do_create_tmp_file and do_remove_tmp_file, new list for storing temp. file pointers
author Torsten Lilge <ttl-octave@mailbox.org>
date Fri, 25 Oct 2019 07:36:37 +0200
parents da1f59fe04b3
children f0e3f3e28a8e
line wrap: on
line diff
--- a/libgui/src/main-window.h	Thu Oct 24 22:33:37 2019 +0200
+++ b/libgui/src/main-window.h	Fri Oct 25 07:36:37 2019 +0200
@@ -199,6 +199,7 @@
 
     void gui_preference (const QString& key, const QString& value,
                          QString* read_value);
+    void focus_console_after_command (void);
     void handle_show_doc (const QString& file);
     void handle_register_doc (const QString& file);
     void handle_unregister_doc (const QString& file);
@@ -283,8 +284,6 @@
 
     QString gui_preference_adjust (const QString& key, const QString& value);
 
-    bool focus_console_after_command (void);
-
     void configure_shortcuts (void);
 
     QList<octave_dock_widget *> dock_widget_list (void);