Fix File > Save not showing red highlight when saving over existing files.

Don't disable the save over popup through the keymap, just remove it entirely
from the code so that the file browser interprets the property correctly.
This commit is contained in:
Brecht Van Lommel 2019-02-20 13:57:17 +01:00
parent cfbcd7f0da
commit b285f92d80
2 changed files with 5 additions and 12 deletions

View File

@ -289,8 +289,7 @@ def km_window(params):
("wm.read_homefile", {"type": 'N', "value": 'PRESS', "oskey": True}, None),
op_menu("TOPBAR_MT_file_open_recent", {"type": 'O', "value": 'PRESS', "shift": True, "oskey": True}),
("wm.open_mainfile", {"type": 'O', "value": 'PRESS', "oskey": True}, None),
("wm.save_mainfile", {"type": 'S', "value": 'PRESS', "oskey": True},
{"properties": [("check_existing", False)]}),
("wm.save_mainfile", {"type": 'S', "value": 'PRESS', "oskey": True}, None),
("wm.save_as_mainfile", {"type": 'S', "value": 'PRESS', "shift": True, "oskey": True}, None),
("wm.quit_blender", {"type": 'Q', "value": 'PRESS', "oskey": True}, None),
("wm.search_menu", {"type": 'F', "value": 'PRESS', "oskey": True}, None),
@ -301,8 +300,7 @@ def km_window(params):
("wm.read_homefile", {"type": 'N', "value": 'PRESS', "ctrl": True}, None),
op_menu("TOPBAR_MT_file_open_recent", {"type": 'O', "value": 'PRESS', "shift": True, "ctrl": True}),
("wm.open_mainfile", {"type": 'O', "value": 'PRESS', "ctrl": True}, None),
("wm.save_mainfile", {"type": 'S', "value": 'PRESS', "ctrl": True},
{"properties": [("check_existing", False)]}),
("wm.save_mainfile", {"type": 'S', "value": 'PRESS', "ctrl": True}, None),
("wm.save_as_mainfile", {"type": 'S', "value": 'PRESS', "shift": True, "ctrl": True}, None),
("wm.quit_blender", {"type": 'Q', "value": 'PRESS', "ctrl": True}, None),

View File

@ -2327,14 +2327,9 @@ static int wm_save_mainfile_invoke(bContext *C, wmOperator *op, const wmEvent *U
char path[FILE_MAX];
RNA_string_get(op->ptr, "filepath", path);
if (RNA_boolean_get(op->ptr, "check_existing") && BLI_exists(path)) {
ret = WM_operator_confirm_message_ex(C, op, IFACE_("Save Over?"), ICON_QUESTION, path);
}
else {
ret = wm_save_as_mainfile_exec(C, op);
/* Without this there is no feedback the file was saved. */
BKE_reportf(op->reports, RPT_INFO, "Saved \"%s\"", BLI_path_basename(path));
}
ret = wm_save_as_mainfile_exec(C, op);
/* Without this there is no feedback the file was saved. */
BKE_reportf(op->reports, RPT_INFO, "Saved \"%s\"", BLI_path_basename(path));
}
else {
WM_event_add_fileselect(C, op);