Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_files.c
| Show First 20 Lines • Show All 2,719 Lines • ▼ Show 20 Lines | static void wm_block_autorun_warning_ignore(bContext *C, void *arg_block, void *UNUSED(arg)) | ||||
| wmWindow *win = CTX_wm_window(C); | wmWindow *win = CTX_wm_window(C); | ||||
| UI_popup_block_close(C, win, arg_block); | UI_popup_block_close(C, win, arg_block); | ||||
| } | } | ||||
| static void wm_block_autorun_warning_allow(bContext *C, void *arg_block, void *UNUSED(arg)) | static void wm_block_autorun_warning_allow(bContext *C, void *arg_block, void *UNUSED(arg)) | ||||
| { | { | ||||
| PointerRNA props_ptr; | PointerRNA props_ptr; | ||||
| wmWindow *win = CTX_wm_window(C); | wmWindow *win = CTX_wm_window(C); | ||||
| wmWindowManager *wm = CTX_wm_manager(C); | |||||
| UI_popup_block_close(C, win, arg_block); | UI_popup_block_close(C, win, arg_block); | ||||
| /* Save user preferences for permanent execution. */ | /* Save user preferences for permanent execution. */ | ||||
| if ((U.flag & USER_SCRIPT_AUTOEXEC_DISABLE) == 0) { | if ((U.flag & USER_SCRIPT_AUTOEXEC_DISABLE) == 0) { | ||||
| WM_operator_name_call(C, "WM_OT_save_userpref", WM_OP_EXEC_DEFAULT, NULL); | WM_operator_name_call(C, "WM_OT_save_userpref", WM_OP_EXEC_DEFAULT, NULL); | ||||
| } | } | ||||
| if (!wm->file_saved) { | |||||
| WM_operator_name_call(C, "WM_OT_save_mainfile", WM_OP_EXEC_DEFAULT, NULL); | |||||
| } | |||||
| /* Load file again with scripts enabled. */ | /* Load file again with scripts enabled. */ | ||||
| wmOperatorType *ot = WM_operatortype_find("WM_OT_revert_mainfile", false); | wmOperatorType *ot = WM_operatortype_find("WM_OT_revert_mainfile", false); | ||||
| WM_operator_properties_create_ptr(&props_ptr, ot); | WM_operator_properties_create_ptr(&props_ptr, ot); | ||||
| RNA_boolean_set(&props_ptr, "use_scripts", true); | RNA_boolean_set(&props_ptr, "use_scripts", true); | ||||
| WM_operator_name_call_ptr(C, ot, WM_OP_EXEC_DEFAULT, &props_ptr); | WM_operator_name_call_ptr(C, ot, WM_OP_EXEC_DEFAULT, &props_ptr); | ||||
| WM_operator_properties_free(&props_ptr); | WM_operator_properties_free(&props_ptr); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 348 Lines • Show Last 20 Lines | |||||