Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2021-10-19 19:07:22 +0300
committerSybren A. Stüvel <sybren@blender.org>2021-10-19 19:07:22 +0300
commit823996b0342b7352fc5b2e24eceb6204612438cd (patch)
tree08dca1ce5386c2b06ab01fad1f2f1ac5c236047a /source/blender/blenkernel/BKE_asset_library.hh
parentb6c3b41d413813d8059476f2c0357b7a4e51ad22 (diff)
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
Diffstat (limited to 'source/blender/blenkernel/BKE_asset_library.hh')
-rw-r--r--source/blender/blenkernel/BKE_asset_library.hh10
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/blenkernel/BKE_asset_library.hh b/source/blender/blenkernel/BKE_asset_library.hh
index 6d5c9836b26..64c8afecaef 100644
--- a/source/blender/blenkernel/BKE_asset_library.hh
+++ b/source/blender/blenkernel/BKE_asset_library.hh
@@ -38,6 +38,10 @@ namespace blender::bke {
* For now this is only for catalogs, later this can be expanded to indexes/caches/more.
*/
struct AssetLibrary {
+ /* Controlled by #ED_asset_catalogs_set_save_catalogs_when_file_is_saved,
+ * for managing the "Save Catalog Changes" in the quit-confirmation dialog box. */
+ static bool save_catalogs_when_file_is_saved;
+
std::unique_ptr<AssetCatalogService> catalog_service;
AssetLibrary();
@@ -53,10 +57,10 @@ struct AssetLibrary {
* meant to help recover from. */
void refresh_catalog_simplename(struct AssetMetaData *asset_data);
- void on_save_handler_register();
- void on_save_handler_unregister();
+ void on_blend_save_handler_register();
+ void on_blend_save_handler_unregister();
- void on_save_post(struct Main *, struct PointerRNA **pointers, const int num_pointers);
+ void on_blend_save_post(struct Main *, struct PointerRNA **pointers, const int num_pointers);
private:
bCallbackFuncStore on_save_callback_store_{};