changeset 20049:a09471d938a5

fix closing a tab with modification * file-editor-tab.cc (closeEvent): reset static flag _cancelled to false
author Torsten <ttl@justmail.de>
date Mon, 23 Feb 2015 19:04:28 +0100
parents 0178c5a98d6f
children 29692bc97899
files libgui/src/m-editor/file-editor-tab.cc
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor-tab.cc
+++ b/libgui/src/m-editor/file-editor-tab.cc
@@ -184,10 +184,14 @@
 void
 file_editor_tab::closeEvent (QCloseEvent *e)
 {
-  // ignore close event if file is not saved and user cancels
-  // closing this window
+  _cancelled = false;  // prevent unwanted interaction of previous
+                       // exits of octave which were canceled by the user
+
   if (check_file_modified () == QMessageBox::Cancel)
-    e->ignore ();
+    { // ignore close event if file is not saved and user cancels
+      // closing this window
+      e->ignore ();
+    }
   else
     {
       e->accept ();