From f9685eea444bf291086483efa5ad8c2656a9d9ce Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sat, 23 Apr 2011 23:54:56 +0200 Subject: [PATCH] Deny checking "Enable Script Links" (panel "Buttons Window", sub panel "Scripts") unless -666 given --- source/blender/src/buttons_script.c | 4 +++- source/creator/creator.c | 4 ++++ 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/source/blender/src/buttons_script.c b/source/blender/src/buttons_script.c index 647fc66..6166133 100644 --- a/source/blender/src/buttons_script.c +++ b/source/blender/src/buttons_script.c @@ -107,6 +107,8 @@ #include "blendef.h" #include "butspace.h" +extern int button_enable_script_links_enabled; + /* ************************ function prototypes ********************** */ void draw_scriptlink(uiBlock *, ScriptLink *, int , int , int ) ; @@ -323,7 +325,7 @@ static void script_panel_scriptlink(void) block= uiNewBlock(&curarea->uiblocks, "script_panel_scriptlink", UI_EMBOSS, UI_HELV, curarea->win); if(uiNewPanel(curarea, block, "Scriptlinks", "Script", 0, 0, 318, 204)==0) return; - uiDefButBitI(block, TOG, G_DOSCRIPTLINKS, REDRAWBUTSSCRIPT, + uiDefButBitI(block, button_enable_script_links_enabled ? TOG : BUT, G_DOSCRIPTLINKS, REDRAWBUTSSCRIPT, "Enable Script Links", xco, 200, 150, 20, &G.f, 0, 0, 0, 0, "Enable execution of all assigned Script links and Space Handelers"); /* for proper alignment: */ diff --git a/source/creator/creator.c b/source/creator/creator.c index 994180d..ccea569 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -108,6 +108,8 @@ #include "binreloc.h" #endif +int button_enable_script_links_enabled = 0; + // from buildinfo.c #ifdef BUILD_DATE extern char * build_date; @@ -391,6 +393,7 @@ int main(int argc, char **argv) if (!strcmp(argv[a], "-666")){ G.f |= G_DOSCRIPTLINKS; + button_enable_script_links_enabled = 1; } /* Handle -* switches */ @@ -412,6 +415,7 @@ int main(int argc, char **argv) case 'y': /* NOTE: -y works the exact opposite way in version 2.57! */ G.f &= ~G_DOSCRIPTLINKS; + button_enable_script_links_enabled = 0; break; case 'Y': -- 1.7.5.rc1