robvdl/MapEditor — Issue #8: Add code so we know which projects are modified
Author: robvdl
Created: 2012-01-12 00:52:22+00:00
State: open

When the application closeEvent is triggered, at the moment we always show a message box "are you sure you want to quit?", but we can do better than that...

I want to have a look at all open projects that have been modified and have NOT been saved yet. First of all, if NO projects need saving, we can exit straight away without any message box.

If one or more projects need saving, we need to create a new dialog with a list of files that need saving (we need to put this list of files into the dialog procedurally), with a checkbox next to each file that needs saving. This is similar to the gimp when it exits (but don't worry about a thumbnail for each project like gimp does).

Start by adding a private bool called "modified" to the .h of ProjectWidget, and setting this to false in the ProjectWidget intitialiser list. Then add a public getter method to ProjectWidget called bool isModified() that returns the private modified variable. I don't think we should add a setModified method, because the ProjectWidget class should only really be able to set the modified state itself.

Do this task after we have finished with the options dialog, and once again, take your time, do it over several commits rather than all at once so I can see the progress and provided input.