Asset Browser: Improved workflow for asset catalog saving

No longer save asset catalogs on blendfile save. Instead:

- extend the confirmation prompt for unsaved changes to show unsaved
  catalogs.
- In the confirmation prompt, make catalog saving explicit & optional,
  just like we do it for external images. {F10881736}
- In the Asset Browser catalog tree, show an operator icon to save the
  catalogs to disk. It's grayed out if there are no changes to save, or
  if the .blend wasn't saved yet (required to know where to save the
  catalog definitions to). {F10881743}

Much of the work was done by @Severin and reviewed by me, then we
swapped roles.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D12796
This commit is contained in:
2021-10-19 18:07:22 +02:00
parent b6c3b41d41
commit 823996b034
21 changed files with 402 additions and 51 deletions

View File

@@ -79,7 +79,7 @@ void wm_close_file_dialog(bContext *C, struct wmGenericCallback *post_action);
bool wm_operator_close_file_dialog_if_needed(bContext *C,
wmOperator *op,
wmGenericCallbackFn exec_fn);
bool wm_file_or_image_is_modified(const Main *bmain, const wmWindowManager *wm);
bool wm_file_or_session_data_has_unsaved_changes(const Main *bmain, const wmWindowManager *wm);
void WM_OT_save_homefile(struct wmOperatorType *ot);
void WM_OT_save_userpref(struct wmOperatorType *ot);