Fix File > Save not showing red highlight when saving over existing files.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 20 Feb 2019 12:57:17 +0000 (13:57 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 20 Feb 2019 13:04:12 +0000 (14:04 +0100)
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.

release/scripts/presets/keyconfig/keymap_data/blender_default.py
source/blender/windowmanager/intern/wm_files.c

index 335076309bcd97461608e7e593ebd36fd7197474..95fd6aa3dda031c58692883076399dc56327dacf 100644 (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),
 
index 927a0411c3b38edc588a2bea97b10555f003f352..1354c3df6a5e70699872866919b14d51eb3607ef 100644 (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);