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

Remove the editor quit confirmation when there are no unsaved changes #32321

Merged

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Sep 24, 2019

The editor will still ask for confirmation if the user is working on unsaved scenes.

I often find myself disabling this (to mimic the default behavior in most software) 🙂

@KoBeWi
Copy link
Member

KoBeWi commented Sep 24, 2019

Good to know this option exists.

@akien-mga akien-mga added this to the 3.2 milestone Sep 25, 2019
editor/editor_node.cpp Outdated Show resolved Hide resolved
@akien-mga
Copy link
Member

IMO such option doesn't make much sense when disabled by default, as I can't see many users look through the hundreds of editor settings to find one that would enable a quit confirmation dialog, without knowing that it exists beforehand.

A better approach would be to have a quit confirmation dialog enabled by default, but with a checkbox in the dialog to disable it ("Don't ask me again" style).

And of course it should stay when there are unsaved scenes, but that's the case already with this change IIUC.

@Calinou Calinou force-pushed the editor-disable-quit-confirmation branch from 079d27f to 5456f5e Compare September 25, 2019 22:44
@Calinou
Copy link
Member Author

Calinou commented Sep 25, 2019

@akien-mga Personally, I'd be in favor of removing the option entirely, but I can try looking at adding a "Don't ask again" checkbox to the quit dialog.

@eon-s
Copy link
Contributor

eon-s commented Sep 26, 2019

The popup is annoying, yes, but I would prefer a don't ask again checkbox/button instead.

@groud
Copy link
Member

groud commented Sep 26, 2019

@akien-mga Personally, I'd be in favor of removing the option entirely, but I can try looking at adding a "Don't ask again" checkbox to the quit dialog.

I would go for that. The popup is useless if there is nothing to save.

@akien-mga
Copy link
Member

The popup is useless if there is nothing to save.

The main use case is if you're editing a heavy project and have a few scenes open that take a non-negligible time to load. If you hit the Close button by mistake and don't get a chance to confirm, that can be annoying.

But computers are fast nowadays and Godot is still lightweight, so maybe that's not so much of an issue.

@groud
Copy link
Member

groud commented Sep 26, 2019

A solution might be to compute the time needed to start the project (just by computing the time it take at startup), and eventually display the popup if it took a significant amount of time ? That might be overcomplicated though.

@akien-mga
Copy link
Member

A solution might be to compute the time needed to start the project (just by computing the time it take at startup), and eventually display the popup if it took a significant amount of time ? That might be overcomplicated though.

That sounds quite overkill :)

@anissen
Copy link
Contributor

anissen commented Sep 26, 2019

The main use case is if you're editing a heavy project and have a few scenes open that take a non-negligible time to load. If you hit the Close button by mistake and don't get a chance to confirm, that can be annoying.

In that case, an alternative approach could be to handle this like e.g. Google Chrome and Microsoft Edge. They have an option to "Warn Before Quitting" which, when enabled, will show a prominent toast notification prompting the user to keep the buttons pressed if they wish to quit.
image
image

@akien-mga akien-mga modified the milestones: 3.2, 4.0 Nov 7, 2019
@Calinou Calinou force-pushed the editor-disable-quit-confirmation branch from 5456f5e to e6b3b2e Compare November 16, 2019 22:07
@Calinou Calinou changed the title Disable the editor quit confirmation by default Remove the editor quit confirmation Nov 16, 2019
@aaronfranke
Copy link
Member

@Calinou Is this still desired? If so, it needs to be rebased on the latest master branch.

The editor will still ask for confirmation if the user is working
on unsaved scenes.
@Calinou Calinou force-pushed the editor-disable-quit-confirmation branch from e6b3b2e to 6826400 Compare January 6, 2021 18:58
@Calinou Calinou changed the title Remove the editor quit confirmation Remove the editor quit confirmation when there are no unsaved changes Jan 6, 2021
@akien-mga
Copy link
Member

Well let's give it a spin, but I'm still not convinced. Brace yourselves for issues with users asking to add a confirmation dialog on quit, as otherwise they tend to quit by mistake and lose their work context (opened scenes, opened scripts, where they are in a script, etc.).

@akien-mga akien-mga closed this Jan 18, 2021
@akien-mga akien-mga reopened this Jan 18, 2021
@akien-mga akien-mga merged commit 688f4ae into godotengine:master Jan 18, 2021
@akien-mga
Copy link
Member

Thanks!

@KoBeWi
Copy link
Member

KoBeWi commented Jan 18, 2021

But Godot saves work context (except scenes by default), so it shouldn't be a problem.

@YuriSizov
Copy link
Contributor

YuriSizov commented Jan 19, 2021

This just occured to me: what about plugins? We can make some assumptions about the editor itself, but there is no global state that plugins can commit to to inform the editor that there are unsaved changes. So this could've been a useful option for some people using some plugins that don't handle data changes particularly well.

@Calinou
Copy link
Member Author

Calinou commented Jan 19, 2021

This just occured to me: what about plugins? We can make some assumptions about the editor itself, but there is no global state that plugins can commit to to inform the editor that there are unsaved changes.

We should aim to resolve this before 4.0 is released. I'll open a proposal.

I think a EditorInterface.set_dirty(bool p_dirty) method would go a long way already, as long as it's usable in the UndoRedo system.

@CarpenterBlue
Copy link

Reminder that when you run the game, everything is automatically saved making this extremely annoying.

Turns Exported Variables from useful tool to deadly one. Same for scripts reloading.
During 1 hour of testing of my game, I closed Godot 13 times on accident. Should I provide video evidence for this?
I juggle more than one program, frequently I have Godot, Blender and Photoshop running at the same time, losing context is extremely easy and unlike with other software, where it is not such a massive issue since you usually save and then doing any change makes the project have unsaved changes.

In Godot you sometimes have to save to see the changes in your game.
With other software because you don't have to save the project to run external application. This is MAJOR difference.

I am for reverting this, if not so, at least consider making the project be dirty when you run the game.

@Calinou
Copy link
Member Author

Calinou commented Jan 8, 2024

I am for reverting this, if not so, at least consider making the project be dirty when you run the game.

Running the project doesn't write any files to the project folder, so there's no reason for making it dirty.

To address cases where you accidentally close the editor due to the running project crashing, this can be done by adding a GUI crash dialog that would intercept the Alt + F4 press: #61906

We could also make the quit confirmation appear if you exit the editor while a project is running from the editor (as there's no way to reattach the editor to the running project after reopening it, unless you quit and restart the running project).

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.

9 participants