From f3c5206b717a9b2d6b78344e92277f6f58f24229 Mon Sep 17 00:00:00 2001 From: Willian Padovani Germano Date: Fri, 16 Jan 2004 23:40:14 +0000 Subject: Scripts menus: -- added re-eval entry to Scripts Win -> Scripts menu -- added it also as a button at Info Win -> File Paths, Python path -- updated bpymenus code: added 'Blender' tag, for version; made a .Bpymenus file be written only if there's actual data to save made file->export menu open a scriptspace only if none is available already -- bug fixes (bugs 866 and 879, related) for linking and sharing mesh data: http://projects.blender.org/tracker/?func=detail&atid=125&aid=866&group_id=9 http://projects.blender.org/tracker/?func=detail&atid=125&aid=879&group_id=9 --- source/blender/src/header_script.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'source/blender/src/header_script.c') diff --git a/source/blender/src/header_script.c b/source/blender/src/header_script.c index a56cede0746..3c97575e528 100644 --- a/source/blender/src/header_script.c +++ b/source/blender/src/header_script.c @@ -114,6 +114,27 @@ static uiBlock *script_scripts_submenus(void *int_menutype) return block; } +static void do_script_scriptsmenu(void *arg, int event) +{ + ScrArea *sa; + char dir[FILE_MAXDIR]; + + if(curarea->spacetype==SPACE_INFO) { + sa= closest_bigger_area(); + areawinset(sa->win); + } + + /* these are no defines, easier this way, the codes are in the function below */ + switch(event) { + case 0: /* update menus */ + BPyMenu_RemoveAllEntries(); + if (BPyMenu_Init(1) == -1) error("Invalid scripts dir: check console"); + break; + } + +// allqueue(REDRAWSCRIPT, 0); +} + /* Scripts menu */ static uiBlock *script_scriptsmenu(void *arg_unused) { @@ -124,12 +145,14 @@ static uiBlock *script_scriptsmenu(void *arg_unused) int i; block= uiNewBlock(&curarea->uiblocks, "script_scriptsmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - //uiBlockSetButmFunc(block, do_script_scriptsmenu, NULL); + uiBlockSetButmFunc(block, do_script_scriptsmenu, NULL); for (i = 0; i < PYMENU_TOTAL; i++) { uiDefIconTextBlockBut(block, script_scripts_submenus, (void *)i, ICON_RIGHTARROW_THIN, BPyMenu_group_itoa(i), 0, yco-=20, menuwidth, 19, ""); } + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Update Menus", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "Use when you modify the scripts dir or its contents"); + if(curarea->headertype==HEADERTOP) { uiBlockSetDirection(block, UI_DOWN); } -- cgit v1.2.3