My addon code calls bpy.ops.wm.quit_blender()
And after that there is simply an exit from Blender. But I want to see the standard Blender quit dialog. Is it possible?
You would have to pass 'INVOKE_DEFAULT' to call the invoke method of the operator:
bpy.ops.wm.quit_blender('INVOKE_DEFAULT')
Read: https://docs.blender.org/api/current/bpy.ops.html#execution-context
To close Blender and pop-up the UI window "Save changes before closing", you need to run the code stated below.
import bpy
bpy.ops.wm.window_close()
NOTE: The option Save Prompt must be turned on, which can be found in the Save & Load category of the "User Preferences" editor in able for the code to work properly.
quit_blender, but it won't terminate blender if you have multiple windows open in one file. Good to know though :) – Gorgious May 27 '21 at 20:41invokemethod rather than directly theexecuteone) – Gorgious May 27 '21 at 21:42