diff libgui/src/m-editor/file-editor-tab.cc @ 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 dfa608a9c36e
children 72fe9df87fe8
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 ();