diff options
Diffstat (limited to 'source/blender/editors/space_script/script_edit.c')
-rw-r--r-- | source/blender/editors/space_script/script_edit.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/editors/space_script/script_edit.c b/source/blender/editors/space_script/script_edit.c index 96008004ee4..8074ec57474 100644 --- a/source/blender/editors/space_script/script_edit.c +++ b/source/blender/editors/space_script/script_edit.c @@ -36,6 +36,7 @@ #include "BLI_utildefines.h" #include "BKE_context.h" +#include "BKE_global.h" #include "WM_api.h" #include "WM_types.h" @@ -110,3 +111,23 @@ void SCRIPT_OT_reload(wmOperatorType *ot) /* api callbacks */ ot->exec = script_reload_exec; } + +static int script_autoexec_warn_clear_exec(bContext *UNUSED(C), wmOperator *UNUSED(op)) +{ + G.f |= G_SCRIPT_AUTOEXEC_FAIL_QUIET; + return OPERATOR_FINISHED; +} + +void SCRIPT_OT_autoexec_warn_clear(wmOperatorType *ot) +{ + /* identifiers */ + ot->name = "Continue Untrusted"; + ot->description = "Ignore autoexec warning"; + ot->idname = "SCRIPT_OT_autoexec_warn_clear"; + + /* flags */ + ot->flag = OPTYPE_INTERNAL; + + /* api callbacks */ + ot->exec = script_autoexec_warn_clear_exec; +} |