Mercurial > octave
diff libgui/src/octave-qt-link.h @ 25742:d3c6de326bae
close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
* file-editor.cc (handle_file_remove): new code structure
* main-window.cc (construct): connect new signals from octave_qt_link to the
slot handle_file_renamed and the new proxy slot file_remove_proxy;
(file_remove_proxy): proxy calling handle_file_remove but protected by the
mutex of octave_qt_link synchronizing worker and gui thread
* main-window.h: new slot file_remove_proxy
* octave-qt-link.cc (do_file_remove): new method for renaming or removing
files which signals the editor (gui thread) for closing the files before
removing is carried out;
(do_file_renamed): new method for re-loading renamed files into editor;
* octave-qt-link.h: new methods do_file_remove and do_file_renamed,
new signals used in the new methods for signaling the editor slots
* dirfns.cc (rmdir): call the new static octave_link method for removing
a file, which might be opened in the editor before removing a dir;
(rename): call the new static octave_link method for renaming a file,
which might be opened in the editor before renaming it and call the method
for reloading the new renamed file;
* octave-link.h (file_remove): new static method calling purely virtual method
do_file_remove, which is implemented in octave_qt_link;
(file_renamed): new static method calling purely virtual method
do_file_renamed, which is implemented in octave_qt_link
* syscalls.cc (unlink): call the new static octave_link method for removing
a file, which might be opened in the editor before removing it
author | Torsten <mttl@mailbox.org> |
---|---|
date | Sun, 17 Sep 2017 05:52:33 +0200 |
parents | 3418d3729a51 |
children | 9c47eedc44e2 |
line wrap: on
line diff
--- a/libgui/src/octave-qt-link.h Sat Aug 04 13:35:29 2018 +0200 +++ b/libgui/src/octave-qt-link.h Sun Sep 17 05:52:33 2017 +0200 @@ -112,6 +112,10 @@ void do_change_directory (const std::string& dir); + void do_file_remove (const std::string& old_name, + const std::string& new_name); + void do_file_renamed (bool load_new = true); + void do_execute_command_in_terminal (const std::string& command); void do_set_workspace (bool top_level, bool debug, @@ -173,6 +177,9 @@ void change_directory_signal (const QString& dir); + void file_remove_signal (const QString& old_name, const QString& new_name); + void file_renamed_signal (bool load_new); + void execute_command_in_terminal_signal (const QString& command); void set_workspace_signal (bool top_level, bool debug,