Mercurial > hg > octave-nkf
diff libgui/src/m-editor/file-editor.h @ 19608:ed0df431631b gui-release
allow to cancel exiting if editor tabs are modified and exit is requested in gui
* file-editor-interface.h: new function check_closing
* file-editor-tab.cc (ctor): set default for app_closing to 0 (not closing);
(check_file_modified): dialog boxes for modified editor tabs depending on
app closing or not;
(conditional_close): no slot, but ordinary function returning close result;
* file-editor-tab.h: conditional_close is function, not a slot;
_app_closing is now int for closing from gui, from octave, not closing
* file-editor.cc (dtor): calling new function check_closing if there are
open tabs (exit requested octave), do not save session here since the tabs
might already have been closed;
(check_closing): new function saving session info and closing all tabs,
stop closing tabs and returning false if user cancels exiting if there is
a modified tab;
(request_close_file, request_close_all_files, request_close_other_files,
handle_tab_close_request):
use conditional_close instead of signal;
(construct): do not connect old signal for closing the tabs
* file-editor.h: remove signal fetab_close_request, new function check_closing
* main-window.cc (confirm_exit_octave): call file_editor::check_closing
before really closing the app
author | Torsten <ttl@justmail.de> |
---|---|
date | Sat, 20 Dec 2014 17:26:53 +0100 |
parents | 9582fad68730 |
children | 3c038da18218 |
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor.h +++ b/libgui/src/m-editor/file-editor.h @@ -69,7 +69,6 @@ signals: void fetab_settings_changed (const QSettings *settings); - void fetab_close_request (const QWidget* ID, bool app_closing = false); void fetab_change_request (const QWidget* ID); void fetab_file_name_query (const QWidget* ID); // Save is a ping-pong type of communication @@ -117,6 +116,7 @@ public slots: void focus (void); + bool check_closing (int closing_state); void request_new_file (const QString& commands); void request_new_script (const QString& commands);