Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prompt saves only when necessary #3194

Closed
jestarray opened this issue Dec 1, 2021 · 4 comments · Fixed by #3197
Closed

Prompt saves only when necessary #3194

jestarray opened this issue Dec 1, 2021 · 4 comments · Fixed by #3197
Assignees
Labels
usability Generally about making something more intuitive or efficient.

Comments

@jestarray
Copy link

At the moment if I use the selection tools, e. Select Same Tile, Magic Wand selection or Rectangle selection, etc just to highlight a selection of tiles and don't do anything with it, it registers as a file change despite not doing anything to change any contents of the map.

@eishiya
Copy link
Contributor

eishiya commented Dec 1, 2021

The reason for this is that anything that goes on the Undo stack also marks the document as modified.

I'd also like to see a distinction between actions that modify the map data, and those that do not. It might not be very important, but it can be confusing when a map is marked as changed when you don't remember making any changes.

@bjorn bjorn added the usability Generally about making something more intuitive or efficient. label Dec 3, 2021
bjorn added a commit that referenced this issue Dec 3, 2021
Changing the selected area is an undo command so that it can be undone,
but since it does not actually modify the file it should not cause the
file to get marked as modified.

Closes #3194
@bjorn
Copy link
Member

bjorn commented Dec 3, 2021

I've made a PR with a change that should fix this. Inspecting the QUndoStack was a little more involved that I had expected... I hope I got the indexes right now. I'd appreciate if somebody could give the resulting autobuilds some testing when they're done. :-)

@eishiya
Copy link
Contributor

eishiya commented Dec 3, 2021

Gave it a look, tried every kind of selection tool and mode I could think of and none of them marked the document as dirty. Tried the wand in every selection mode, the rectangular select in every selection mode, select all, select none, invert selection, select same tile in every selection mode. Also tried Undoing and Redoing these selections, no problems there.

Tried many other map tools (and a script macro) to check that they still mark as dirty. This was of course not an exhaustive test, but I haven't found issues so far. I'll keep using this build and report back if I notice anything weird.

I did have a crash when undoing some non-selection changes, but I suspect this is the same crashing I occasionally get that's probably related to scripts and stale references to nonexistent layers rather than directly related to this change.

@bjorn
Copy link
Member

bjorn commented Dec 3, 2021

I did have a crash when undoing some non-selection changes, but I suspect this is the same crashing I occasionally get that's probably related to scripts and stale references to nonexistent layers rather than directly related to this change.

Alright, well that's still a little worrying of course. Thanks for the test drive!

bjorn added a commit that referenced this issue Dec 6, 2021
Changing the selected area is an undo command so that it can be undone,
but since it does not actually modify the file it should not cause the
file to get marked as modified.

Closes #3194
@bjorn bjorn self-assigned this Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
usability Generally about making something more intuitive or efficient.
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants