Fix status bar message showing saved when saving failed

Resolves the following issues:

- For the first time you save a .blend file, there was no feedback.
- If the file fails to save (eg "No space left on device") the status
  bar message replaces the error with an invalid "Saved" message.

  While there is a popup, the user may cancel it with mouse motion
  and be left with the status bar message saying the file saved.

D7371 by @XDroid with edits.
This commit is contained in:
Campbell Barton 2020-04-08 13:19:09 +10:00
parent 056ebb56b1
commit 1c58311440
Notes: blender-bot 2023-02-14 01:52:41 +01:00
Referenced by issue #71493, No Info in status bar when saving file from the menu (as opposed to using the hotkey)
1 changed files with 3 additions and 2 deletions

View File

@ -1433,6 +1433,9 @@ static bool wm_file_write(bContext *C, const char *filepath, int fileflags, Repo
ibuf_thumb = IMB_thumb_create(filepath, THB_LARGE, THB_SOURCE_BLEND, ibuf_thumb);
}
/* Without this there is no feedback the file was saved. */
BKE_reportf(reports, RPT_INFO, "Saved \"%s\"", BLI_path_basename(filepath));
/* Success. */
ok = true;
}
@ -2715,8 +2718,6 @@ static int wm_save_mainfile_invoke(bContext *C, wmOperator *op, const wmEvent *U
RNA_string_get(op->ptr, "filepath", 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);