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

Made reload current project ask for confirmation with unsaved changes #59442

Merged
merged 1 commit into from
Mar 27, 2022

Conversation

VitikaSoni
Copy link
Contributor

Fix #52287
I tested that this (and quit) doesn't work when save each scene on quit setting is turned off, idk if issue is reported or not but I left this problem as is because it should be covered in a separate PR.

@KoBeWi KoBeWi added bug topic:editor cherrypick:3.x Considered for cherry-picking into a future 3.x release labels Mar 23, 2022
@KoBeWi KoBeWi added this to the 4.0 milestone Mar 23, 2022
editor/editor_node.cpp Outdated Show resolved Hide resolved
editor/editor_node.h Outdated Show resolved Hide resolved
@@ -169,7 +170,7 @@ class EditorNode : public Node {
RUN_PLAY_CUSTOM_SCENE,
RUN_SETTINGS,
RUN_USER_DATA_FOLDER,
RUN_RELOAD_CURRENT_PROJECT,
RELOAD_CURRENT_PROJECT,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I had missed that FILE_CLOSE_ALL_AND_RUN_RELOAD_CURRENT_PROJECT was matching a pre-existing RUN_RELOAD_CURRENT_PROJECT. It seems like contributors over time have all prefixed their new actions with RUN_ without understanding that the original RUN_ actions are the actions to actually run the project/a scene.

So RUN_SETTINGS, RUN_USER_DATA_FOLDER, RUN_PROJECT_MANAGER are all misnomers. But this is material for a different PR refactoring that code.

@akien-mga akien-mga merged commit f2fd325 into godotengine:master Mar 27, 2022
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 3.5.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Mar 28, 2022
@belzecue
Copy link

belzecue commented Jul 11, 2022

Minor change (not really a regression) in behavior after the 3.5 fix:

3.4.4-stable behavior:

  • Make a change to the scenetree (don't manually save the change)
  • hit PROJECT > RELOAD CURRENT PROJECT
  • pending scenetree changes auto-discarded <--- bug
  • Project reloads WITH PREVIOUSLY ACTIVE SCENE/TAB OPEN AND ACTIVE

3.5-RC6 behavior:

  • Make a change to the scenetree (don't manually save the change)
  • hit PROJECT > RELOAD CURRENT PROJECT
  • "Please confirm" dialog asking to save changes <--- bug fixed, awesome!
  • Hit "Save and Reload"
  • Project reloaded with no active scene, i.e. PREVIOUSLY ACTIVE SCENE NOT REOPENED <--- unexpected change

For me, this is a small hit to usability, because it was nice previously to just hit "project reload" (after quickly hitting ctrl-shift-alt-S to force global save, due to the bug) when you need to clear any lingering editor issues and then land right back in the same scene after reload to continue on. But now we have to go find the scene we were working on and reopen it.

Not a big deal, but just noting the change in behavior. You can observe how the "save and reload" step now closes the active scene, leaving just the "empty" tab before reloading the project, so I guess that new step is why it doesn't reopen the previously active scene on reload.

Note that in both 3.4.4 and 3.5-RC6, if you ONLY make an unsaved change to a script (i.e. no change to scenetree) and hit RELOAD CURRENT PROJECT then it autosaves WITHOUT showing the "do you want to save" dialog, and in both cases the project will be reloaded with the previously active script tab open and active again. This post-fix change (no longer reopens the active scene) only exhibits when there are unsaved changes to the scenetree.

UPDATE: I missed that Vitika9 already referred to this in the first post:

"I tested that this (and quit) doesn't work when save each scene on quit setting is turned off, idk if issue is reported or not but I left this problem as is because it should be covered in a separate PR."

For me, the issue as I describe above does NOT happen when I turn OFF the editor setting "Save Each Scene On Quit" (default setting is ON). In that case, the last active scene DOES reopen on project reload.

@VitikaSoni
Copy link
Contributor Author

VitikaSoni commented Jul 11, 2022

3.5-RC6 behavior:

  • Make a change to the scenetree (don't manually save the change)
  • hit PROJECT > RELOAD CURRENT PROJECT
  • "Please confirm" dialog asking to save changes <--- bug fixed, awesome!
  • Hit "Save and Reload"
  • Project reloaded with no active scene, i.e. PREVIOUSLY ACTIVE SCENE NOT REOPENED <--- unexpected change

You are right about this happening in 3.5-RC6 but I am unable to reproduce it in master branch, so maybe its not about this PR.

@KoBeWi
Copy link
Member

KoBeWi commented Jul 12, 2022

Sounds similar to #33326
Not sure why it would happen only in 3.x though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reload Current Project doesn't ask for confirmation even with unsaved changes
4 participants