Fix T86566: Do Not Close if File Cannot Be Saved
If saving a file using CloseSave dialog, do not close if there is an error doing so, like if read-only. Differential Revision: https://developer.blender.org/D10722 Reviewed by Julian Eisel
This commit is contained in:
parent
8b049e4c2a
commit
cfa20ff03b
Notes:
blender-bot
2023-02-14 04:10:15 +01:00
Referenced by issue #86566, No read-only warning for read-only files when using Save & Close prompt
|
@ -3265,7 +3265,10 @@ static void wm_block_file_close_save(bContext *C, void *arg_block, void *arg_dat
|
|||
bool file_has_been_saved_before = BKE_main_blendfile_path(bmain)[0] != '\0';
|
||||
|
||||
if (file_has_been_saved_before) {
|
||||
WM_operator_name_call(C, "WM_OT_save_mainfile", WM_OP_EXEC_DEFAULT, NULL);
|
||||
if (WM_operator_name_call(C, "WM_OT_save_mainfile", WM_OP_EXEC_DEFAULT, NULL) &
|
||||
OPERATOR_CANCELLED) {
|
||||
execute_callback = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
WM_operator_name_call(C, "WM_OT_save_mainfile", WM_OP_INVOKE_DEFAULT, NULL);
|
||||
|
|
Loading…
Reference in New Issue