Behavior about saving on exit

Pierre-Yves Chibon pingou at pingoured.fr
Tue Jul 17 14:56:07 PDT 2012


Hi,

I have started to work on this but I realize it might be better if I ask
for feedback on the ideas first.

When someone opens a file, change something in it and try to quit, the
program asked whether the data should be saved.
If 'Ok' then it shows the save-window and the user can choose to save
the file or rename it.
My habits in such case would be that since I opened a specific file, I
want to save to that specific file, therefore, when I press 'Ok', I want
it to save automatically to the file I opened.

So I have been working on changes that do:
- When a file has been opened by the user, save to this same file if the
user is 'Ok' while closing.
- Add a 'Cancel' option to the pop-up window that offers to save the
file while closing (at the moment it offers Yes and No but both keep the
program closing).
- Add a  'Save As' entry in the file menu 

This last change might be better off using overloading for the save_file
function for the case where it is accessed from the menu entry or while
closing the program. This would keep the current behavior still allowing
the described closing approach.

The beginning of this work is available at:
http://ambre.pingoured.fr/cgit/subsurface.git
I already found that there is at least one problem but this being my
first lines of C++ I'll have to dig/ask to people with more knowledge to
fix them if the ideas are considered interesting.

Looking forward to hear from you,

Regards,
Pierre


More information about the subsurface mailing list