Page MenuHome

UI: Exit After Successful Close_Save
AbandonedPublic

Authored by Harley Acheson (harley) on Jun 20 2019, 6:51 AM.

Details

Summary

For 2.81

If you have NOT already saved your current file, attempting to close will give you a prompt that "This has not been saved yet". But if you select "Save" and then do so, the program does NOT exit, which is the original intention. It does exit when you click "Save" if the file has been saved previously. So the unsaved behavior is unintended and inconsistent.

This patch makes is so clicking "Save" on the exit dialog will let you save and will exit if successful. Note that clicking the dialog "save" but then clicking "Cancel" in the File Browser will not exit. It will only exit if you do actually save.

Diff Detail

Repository
rB Blender

Event Timeline

Jacques Lucke (JacquesLucke) requested changes to this revision.Jun 20 2019, 4:08 PM

Unfortunately, this solution does not work when the file-close-dialog is used shortly before a new file is opened. Instead of opening the new file, Blender will exit.
The reason the functionality you want to implement is not there yet is, that I haven't found a clean way to implement it in the current architecture yet.

source/blender/windowmanager/intern/wm_files.c
2965

This operator should really always be found. The if is not necessary. If you want to put a check there, better use BLI_assert(ot != NULL).

This revision now requires changes to proceed.Jun 20 2019, 4:08 PM

Unfortunately, this solution does not work when the file-close-dialog is used shortly before a new file is opened. Instead of opening the new file, Blender will exit.
The reason the functionality you want to implement is not there yet is, that I haven't found a clean way to implement it in the current architecture yet.

Yes, I see that now. So many complicated little steps that I also can't see some easy way to get that final intention (quit or carry on) to where that needs to be decided after file save.

Will abandon this patch. I might have some brainwave later, but otherwise probably will not be the person to figure this one out.