I've lost track of what we think the status of the attached patch is.

rh


Index: src/Buffer.cpp
===================================================================
--- src/Buffer.cpp      (revision 31030)
+++ src/Buffer.cpp      (working copy)
@@ -328,6 +328,20 @@
                        theBufferList().releaseChild(this, child);
        }
 
+       if (!isClean()) {
+               docstring const text = bformat(_("The document %1$s has unsaved 
changes."
+                       "\n\nDo you want to save the document or discard the 
changes?"), from_utf8(absFileName()));
+               int const ret = Alert::prompt(_("Save changed document?"),
+                               text, 0, 2, _("&Save"), _("&Discard"));
+               switch (ret) {
+               case 0:
+                       save();
+                       break;
+               case 1:
+                       break;
+               }
+       }
+
        // clear references to children in macro tables
        d->children_positions.clear();
        d->position_to_children.clear();
Index: src/BufferList.cpp
===================================================================
--- src/BufferList.cpp  (revision 31030)
+++ src/BufferList.cpp  (working copy)
@@ -282,6 +282,8 @@
        }
 
        user_message += _("  Save failed! Bummer. Document is lost.");
+       // Don't try again.
+       buf->markClean();
        return user_message;
 }
 
Index: src/frontends/qt4/GuiView.cpp
===================================================================
--- src/frontends/qt4/GuiView.cpp       (revision 31030)
+++ src/frontends/qt4/GuiView.cpp       (working copy)
@@ -548,7 +548,7 @@
                return;
        }
 
-       // Make sure that nothing will use this close to be closed View.
+       // Make sure that nothing will use this to be closed View.
        guiApp->unregisterView(this);
 
        if (isFullScreen()) {
@@ -1990,6 +1990,8 @@
                // have no autosave file but I guess
                // this is really improbable (Jug)
                buf.removeAutosaveFile();
+               // clean, in the sense that it doesn't need saving
+               buf.markClean();
                break;
        case 2:
                return false;

Reply via email to