Mercurial > octave
diff libgui/src/m-editor/file-editor.h @ 23907:8fa415ff2cb3
reload editor tab when related file is renamed in file browser (bug #43922)
* files-dock-widget.cc (contextmenu_rename): emit remove signal (for editor)
before renaming a file and another signal when the was renamed for reloading
the new file
* files-dock-widget.h: new signal file_renamed_signal
* file-editor.cc (file_editor, check_closing): renamed the flag for
preventing editor from getting focus;
(handle_file_remove): always check old file name if it is open in the editor
and close it; for renaming the file, store the new name and the encoding;
(handle_file_renamed): new slot for the signal when the file is renamed,
which reloads the file under its new name
* file-editor.h: new slot handle_file_renamed, renamed flag for preventing
focus, new string list for the file and related encodings that have to be
reloaded after renaming
* main-window.cc (construct): connect new file browser signal for a
renamed file with the related new slot of the editor
author | Torsten <mttl@mailbox.org> |
---|---|
date | Sun, 13 Aug 2017 10:08:18 +0200 |
parents | ba46a8015b26 |
children | 1e54d9aba433 |
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor.h Sat Aug 12 15:55:11 2017 -0700 +++ b/libgui/src/m-editor/file-editor.h Sun Aug 13 10:08:18 2017 +0200 @@ -282,6 +282,7 @@ void handle_edit_file_request (const QString& file); void handle_file_remove (const QString&, const QString&); + void handle_file_renamed (void); // Tells the editor to react on changed settings. void notice_settings (const QSettings *settings); @@ -464,13 +465,16 @@ int _marker_breakpoint; bool _closed; - bool _external_close_request; + bool _no_focus; enum { MaxMRUFiles = 10 }; QMenu *_mru_file_menu; QAction *_mru_file_actions[MaxMRUFiles]; QStringList _mru_files; QStringList _mru_files_encodings; + + // List of temporarily closed files while they are renamed + QStringList _tmp_closed_files; }; #endif