2/20/2008 Steven Mizuno Quantum GIS Documenting my expectations for triggering the "Save?" dialog and setting a related "dirty" flag - a boolean variable that indicates that the current project has been modified in ways that should cause a save file question to be asked when an action occurs to exit QGIS or create or load a project A. the "dirty" flag 1. the "dirty" flag should be set true when one of the following occurs: + a valid layer is added to the current project + a layer in the project is removed + a layer's In Overview status is changed + a layer's visibility is changed + a layer's Properties are changed + a layer's position in the Legend is changed + a Group is added to the Legend + a Group is removed from the Legend + a Group's position in the Legend is changed + a Decoration is added + a Decoration is removed + a Decoration is altered + the map canvas has been zoomed or panned by mouse, keyboard, or toolbar button actions (has actually changed - not just that a button, like Zoom In, for example, was clicked) [however, I have many times opened a project, then zoomed/panned, but did not want to save the project after these actions. So, should zoom/pan be setting the dirty flag?] Note that most of these actions cause a redraw of the map canvas unless Render is turned off. But a redraw of the map canvas should not be a trigger for setting the dirty flag. 2. the "dirty" flag should be set false when one of the following occurs: + QGIS is started + the current project has been saved + a project file has just been loaded + all layers in a new, unsaved project have been removed + a new project is started (File, New Project) B. the "Save?" dialog 1. the "Save?" dialog should appear when the "dirty" flag is true AND the "Ask to save project changes when required" in Settings, Options, General tab is enabled AND any of the following occurs: + a new project action occurs: + File->New Project on the menu is chosen + New Project toolbar button is clicked + File->Exit + an existing project file is loaded: + File->Open Project + File->Open Recent Project + QGIS exit action occurs: + File->Exit on the menu is chosen + Ctrl+Q or Alt+F4 or any similar key combination is hit + the close button is clicked 2. the "Save?" dialog should NOT appear + when the "dirty" flag is false AND any of the actions in B. 1. above occurs, OR + the "Ask to save project changes when required" in Settings, Options, General tab is disabled AND any of the actions is B. 1. above occurs. The state of the "dirty" flag should not matter. 3. actions on the "Save?" dialog + Save - should Save Project (no dialog) the current project if it was loaded from a file or pop up the Save Project As dialog if it is a new project + Discard - should clear the current project and proceed to New or Open Project as appropriate + Cancel - should return to the current project