Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_files.c
| Show First 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | |||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "RNA_define.h" | #include "RNA_define.h" | ||||
| #include "IMB_imbuf.h" | #include "IMB_imbuf.h" | ||||
| #include "IMB_imbuf_types.h" | #include "IMB_imbuf_types.h" | ||||
| #include "IMB_thumbs.h" | #include "IMB_thumbs.h" | ||||
| #include "ED_asset.h" | |||||
| #include "ED_datafiles.h" | #include "ED_datafiles.h" | ||||
| #include "ED_fileselect.h" | #include "ED_fileselect.h" | ||||
| #include "ED_image.h" | #include "ED_image.h" | ||||
| #include "ED_outliner.h" | #include "ED_outliner.h" | ||||
| #include "ED_screen.h" | #include "ED_screen.h" | ||||
| #include "ED_undo.h" | #include "ED_undo.h" | ||||
| #include "ED_util.h" | #include "ED_util.h" | ||||
| #include "ED_view3d.h" | #include "ED_view3d.h" | ||||
| ▲ Show 20 Lines • Show All 1,660 Lines • ▼ Show 20 Lines | if (BLI_path_cmp(li->filepath_abs, filepath) == 0) { | ||||
| BKE_reportf(reports, RPT_ERROR, "Cannot overwrite used library '%.240s'", filepath); | BKE_reportf(reports, RPT_ERROR, "Cannot overwrite used library '%.240s'", filepath); | ||||
| return ok; | return ok; | ||||
| } | } | ||||
| } | } | ||||
| /* Call pre-save callbacks before writing preview, | /* Call pre-save callbacks before writing preview, | ||||
| * that way you can generate custom file thumbnail. */ | * that way you can generate custom file thumbnail. */ | ||||
| BKE_callback_exec_null(bmain, BKE_CB_EVT_SAVE_PRE); | BKE_callback_exec_null(bmain, BKE_CB_EVT_SAVE_PRE); | ||||
| ED_assets_pre_save(bmain); | |||||
| /* Enforce full override check/generation on file save. */ | /* Enforce full override check/generation on file save. */ | ||||
| BKE_lib_override_library_main_operations_create(bmain, true); | BKE_lib_override_library_main_operations_create(bmain, true); | ||||
| if (!G.background) { | if (!G.background) { | ||||
| /* Redraw to remove menus that might be open. */ | /* Redraw to remove menus that might be open. */ | ||||
| WM_redraw_windows(C); | WM_redraw_windows(C); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 301 Lines • ▼ Show 20 Lines | static int wm_homefile_write_exec(bContext *C, wmOperator *op) | ||||
| const char *app_template = U.app_template[0] ? U.app_template : NULL; | const char *app_template = U.app_template[0] ? U.app_template : NULL; | ||||
| const char *const cfgdir = BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, app_template); | const char *const cfgdir = BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, app_template); | ||||
| if (cfgdir == NULL) { | if (cfgdir == NULL) { | ||||
| BKE_report(op->reports, RPT_ERROR, "Unable to create user config path"); | BKE_report(op->reports, RPT_ERROR, "Unable to create user config path"); | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| BKE_callback_exec_null(bmain, BKE_CB_EVT_SAVE_PRE); | BKE_callback_exec_null(bmain, BKE_CB_EVT_SAVE_PRE); | ||||
| ED_assets_pre_save(bmain); | |||||
| /* check current window and close it if temp */ | /* check current window and close it if temp */ | ||||
| if (win && WM_window_is_temp_screen(win)) { | if (win && WM_window_is_temp_screen(win)) { | ||||
| wm_window_close(C, wm, win); | wm_window_close(C, wm, win); | ||||
| } | } | ||||
| /* update keymaps in user preferences */ | /* update keymaps in user preferences */ | ||||
| WM_keyconfig_update(wm); | WM_keyconfig_update(wm); | ||||
| ▲ Show 20 Lines • Show All 1,666 Lines • Show Last 20 Lines | |||||