Mercurial > octave
diff libgui/src/m-editor/file-editor-tab.h @ 27403:27967cb3dea5
attempt to avoid threading issues when saving a file in the file editor tab
* file-editor-tab.h, file-editor-tab.cc (file_editor_tab::do_save_file):
New private slot.
(file_editor_tab::confirm_dbquit_and_save): Rename from
exit_debug_and_clear and declare as a private slot.
(file_editor_tab::do_save_file_signal): New signal.
file_editor_tab::confirm_dbquit_and_save_signal): New signal.
(file_editor_tab::file_editor_tab): Connect
confirm_dbquit_and_save_signal signal to confirm_dbquit_and_save
slot. Connect do_save_file_signal signal to do_save_file slot.
(file_editor_tab::confirm_dbquit_and_save): Get input from user. If
choice is to save file, then emit interpreter event to quit debugger
and evaluator, then emit another signal to save the file in the GUI
thread.
(file_editor_tab::save_file): Use an interpreter event to check
whether the file is being executed in teh debugger. If it is, emit a
signal to quit debugging and save, otherwise, clear the function and
emit a signal to save the file.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 13 Sep 2019 07:38:36 -0400 |
parents | 1f595192b5a5 |
children | 646efbb5f407 |
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor-tab.h Fri Sep 13 07:24:17 2019 -0400 +++ b/libgui/src/m-editor/file-editor-tab.h Fri Sep 13 07:38:36 2019 -0400 @@ -199,6 +199,14 @@ void request_add_octave_apis (const QStringList&); void api_entries_added (void); + void do_save_file_signal (const QString& file_to_save, + bool remove_on_success, bool restore_breakpoints); + + void confirm_dbquit_and_save_signal (const QString& file_to_save, + const QString& base_name, + bool remove_on_success, + bool restore_breakpoints); + // FIXME: The following is similar to "process_octave_code" // signal. However, currently that signal is connected to // something that simply focuses a window and not actually @@ -254,6 +262,13 @@ void handle_add_octave_apis (const QStringList& api_entries); void handle_api_entries_added (void); + void do_save_file (const QString& file_to_save, bool remove_on_success, + bool restore_breakpoints); + + void confirm_dbquit_and_save (const QString& file_to_save, + const QString& base_name, + bool remove_on_success, + bool restore_breakpoints); private: struct bp_info @@ -272,8 +287,6 @@ void find_create (void); bool valid_file_name (const QString& file = QString ()); - bool exit_debug_and_clear (const QString& full_name, - const QString& base_name); void save_file (const QString& saveFileName, bool remove_on_success = false, bool restore_breakpoints = true); void save_file_as (bool remove_on_success = false);