rgheck wrote:
On 08/11/2009 12:21 PM, Jürgen Spitzmüller wrote:
If you add Pavel's valid concerns about multiple views to this, I
think theonly way to go now is your second approach: check for dirty
hidden buffers on exit. I agree that this is sub-optimal, but
everything else strikes me pretty complicated for the time being.
The more I look, the more problems there are with the other approach.
And I think the safety net in the ~Buffer approach is probably worth
it, anyway, if it can be made to work.
The only glitch I observed with this second route is that the dialog
shows up after the main window was closed. I think we should try to
keep this open, maybe even bring the hidden buffer up, in the given
case.
There's no way around this, I don't think. The Buffer only gets
destroyed at the very end, in prepareExit(). So the window is long
since gone, or may be.
So try the attached. The only change from before is the one line in
GuiView.cpp, which marks the Buffer clean if the user says she wants
to discard changes. It's clean in the sense that it doesn't need to be
saved. That way we don't get asked again about saving it when the
Buffer object is destroyed.
I did not read the whole thread but I have an idea:
Instead of switching the unsaved buffer one by one, what about offering
a dialog listing all the unsaved file with a checkbox and a save button?
The dialog would also have three button: "Discard all and exit", "Save
all and exit", "Cancel exit".
Abdel.