QGIS-expected_behavior_-_Save_dialog.txt

expectations for the Save? dialog to appear - Steven Mizuno, 2008-02-28 06:30 PM

Download (2.9 KB)

 
1
2/20/2008 Steven Mizuno
2

    
3
Quantum GIS
4

    
5
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 
6

    
7
A. the "dirty" flag
8
	1. the "dirty" flag should be set true when one of the following occurs:
9
		+ a valid layer is added to the current project
10
		+ a layer in the project is removed
11
		+ a layer's In Overview status is changed
12
		+ a layer's visibility is changed
13
		+ a layer's Properties are changed
14
		+ a layer's position in the Legend is changed
15
		+ a Group is added to the Legend
16
		+ a Group is removed from the Legend
17
		+ a Group's position in the Legend is changed
18
		+ a Decoration is added
19
		+ a Decoration is removed
20
		+ a Decoration is altered
21
		+ 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?]
22

    
23
		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.
24

    
25
	2. the "dirty" flag should be set false when one of the following occurs:
26
		+ QGIS is started
27
		+ the current project has been saved
28
		+ a project file has just been loaded
29
		+ all layers in a new, unsaved project have been removed
30
		+ a new project is started (File, New Project)
31

    
32
B. the "Save?" dialog
33
	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:
34
		+ a new project action occurs:
35
			+ File->New Project on the menu is chosen
36
			+ New Project toolbar button is clicked
37
			+ File->Exit
38
		+ an existing project file is loaded:
39
			+ File->Open Project
40
			+ File->Open Recent Project
41
		+ QGIS exit action occurs:
42
			+ File->Exit on the menu is chosen
43
			+ Ctrl+Q or Alt+F4 or any similar key combination is hit
44
			+ the close button is clicked
45

    
46
	2. the "Save?" dialog should NOT appear
47
		+ when the "dirty" flag is false AND any of the actions in B. 1. above occurs,
48
		OR 
49
		+ 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.
50

    
51
	3. actions on the "Save?" dialog
52
		+ 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
53
		+ Discard - should clear the current project and proceed to New or Open Project as appropriate
54
		+ Cancel - should return to the current project
55