Bug report #6054
QGIS 1.8 doesn't warn about unsaved changes in layers on exit anymore
Status: | Closed | ||
---|---|---|---|
Priority: | Severe/Regression | ||
Assignee: | - | ||
Category: | GUI | ||
Affected QGIS version: | 1.8.0 | Regression?: | No |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | Yes | Resolution: | fixed |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 15417 |
Description
The title is self-explaining
Related issues
History
#1 Updated by Giovanni Manghi over 12 years ago
Hi Borys, is this a regression? If yes please tag the ticket as blocker.
#2 Updated by Borys Jurgiel over 12 years ago
- Priority changed from High to Severe/Regression
Yes, it's a regression. QGIS <= 1.7 used to warn at exit, if there were any unsaved changes in layers (I mean the layer contents. The unsaved project warning works ok). Now it exits quietly, losing the changes.
Note that when removing a layer from the TOC, the warning works ok.
#3 Updated by Alexander Bruy about 12 years ago
- File fix_6054.patch added
Seems this caused by 8d4a656e4d (author Tim). As I understand, the reason to not emit signal is performance improvement. Here is small patch that should fix this.
#4 Updated by Giovanni Manghi about 12 years ago
- Pull Request or Patch supplied changed from No to Yes
Alexander Bruy wrote:
Seems this caused by 8d4a656e4d (author Tim). As I understand, the reason to not emit signal is performance improvement. Here is small patch that should fix this.
Hi Alexander, maybe is better to make a pull request on github... it will have more chances to have the patch added upstream as soon as possible.
#5 Updated by Alexander Bruy about 12 years ago
Giovanni Manghi wrote:
Hi Alexander, maybe is better to make a pull request on github... it will have more chances to have the patch added upstream as soon as possible.
OK, I'll create a pull request, but IMO it is better to discuss this changes with Tim and Jurgen (original authors of this commit) first. I think they have reasons to disable this signal
#6 Updated by Alexander Bruy about 12 years ago
Pull request is here https://github.com/qgis/Quantum-GIS/pull/263
#7 Updated by Tim Sutton about 12 years ago
Hi
Yes there is a good reason to update this signal - if you have a plugin or other code that reacts to each layer removal event, it can lead to terrible performance problems when you remove many layers at once. So now we rather say layers added (list) or layers removed(list) and listener code can respond to one event and deal with all those removed layers.
Tim
#8 Updated by Larry Shaffer almost 12 years ago
Hi,
I have implemented a version of this here:
https://github.com/qgis/Quantum-GIS/pull/333
'Add option to warn on project close if any layer is in edit mode with unsaved edits'
It does not address the layer legend edit issue, but does address (I think) the original issue concern.
#9 Updated by Larry Shaffer almost 12 years ago
- Status changed from Open to Feedback
Better implementation here:
#10 Updated by Larry Shaffer almost 12 years ago
- File unsaved-provider-edits.png added
- Resolution set to fixed
Should be fixed (regarding layer edits) with commit 21370d9
Attached is warning shown on project close if there are unsaved provider edits.
It does not address the layer legend edit issue (needs different ticket?), but does address the original issue concern.
#11 Updated by Regis Haubourg almost 12 years ago
Hi Larry , it works! but I got trapped going too fast. The warning dialog may be a bit confusing. It warns you to save your edits, and just under it there is a save button. I jumped on it (a beautiful neuronal shortcut).. and it saved project only and not layers. I guess users do not read really well those messages like me.. Is there a way to open dialogs to save edits of all layers being edited? (this is the most common behaviour in other softs).
If not, I would just put warning red line in first position, and then propose a "Save project anyway?" on top of the three standars buttons.)
Thanks a lot again
Régis
#12 Updated by Larry Shaffer almost 12 years ago
- File unsaved-provider-edits_2.png added
Hi Régis,
regis Haubourg wrote:
... Is there a way to open dialogs to save edits of all layers being edited? (this is the most common behaviour in other softs).
I think this would be handy, but a bit redundant. The layers are already listed in the legend with an edit icon. Other GUI items, like the layer's edit undo stack are already available in the main interface. Even if the dialog was more robust (offering saving of edited layers), I envision users looking at a layer listing and not remembering what they were editing, then cancelling the dialog to get back to the main interface to refresh their memory about the state of their edits (I know I do). I think just a more prominent warning and layer listing is all that is needed for now.
Ideally, having the legend layer's icon shift to a different version, or have the layer's text turn a different color, to indicate a layer has unsaved edits, would be helpful (not just for after cancelling project close prompt).
If not, I would just put warning red line in first position, and then propose a "Save project anyway?" on top of the three standars buttons.)
I have reformatted the notification and made it a separate dialog presented just before project save dialog (so as not to be confused with it). It also shows a layer listing in the same order as the legend to help understand which layers are affected, in case they are hidden in collapsed groups. See unsaved-provider-edits_2.png
If a user ignores the new dialog's WARNING, and loses edits... IMHO, they will learn to read such a dialog in the future. It no longer looks like the project close dialog and is very straightforward.
Caveat (or feature): there are now sometimes two dialogs to click through to close the project. While occasionally annoying, having project close dialog come after the 'layer edits exist' notification reduces the chance of the user accidentally/quickly clicking to dismiss a single dialog, thereby protecting against layer editing loss. Though, there are still times where the layer edits don't trigger a dirty project and the 'layer edits exist' notification dialog is the only one.
Note: not committed yet.
#13 Updated by Regis Haubourg almost 12 years ago
+1 for me, I agree with your analysis, mine was maybe too quickly made. You can go for new dialog for me. Do other users have feedback on that point?
#14 Updated by Giovanni Manghi almost 12 years ago
can we close this ticket?
#15 Updated by Larry Shaffer almost 12 years ago
- Status changed from Feedback to Resolved
The current fix addresses the issue, but I am currently working on an integrated dialog to allow saving the unsaved edits, closing the project, or both (not a two-dialog approach as previously noted).
However, that is an additional feature beyond fixing this issue, so I'm closing the issue. Please reopen if needed.
#16 Updated by Larry Shaffer almost 12 years ago
- Status changed from Resolved to Closed