Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-10-06 17:04:31 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-10-06 17:04:31 +0400
commitdd8e2897ba19daac5191a341add9955e00798262 (patch)
treeda30b474f92eb4c88887a061c31e19d7bb726151 /source/blender/makesrna/intern/rna_ui.c
parent2011ba50c84d61eff998812944354d444bd00041 (diff)
new operator - bpy.ops.wm.call_menu(name="SOME_MT_menu")
This calls a registered menu as a popup so we can reuse header menus , currently used for Node editor and Sequencer add menu (Shift+A), can be used for toolbox too.
Diffstat (limited to 'source/blender/makesrna/intern/rna_ui.c')
-rw-r--r--source/blender/makesrna/intern/rna_ui.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c
index f16180451a7..1a1172247fc 100644
--- a/source/blender/makesrna/intern/rna_ui.c
+++ b/source/blender/makesrna/intern/rna_ui.c
@@ -381,13 +381,9 @@ static StructRNA *rna_Menu_register(const bContext *C, ReportList *reports, void
return NULL;
/* check if we have registered this menu type before, and remove it */
- for(mt=art->menutypes.first; mt; mt=mt->next) {
- if(strcmp(mt->idname, dummymt.idname) == 0) {
- if(mt->ext.srna)
- rna_Menu_unregister(C, mt->ext.srna);
- break;
- }
- }
+ mt= BKE_spacemenu_find(dummymt.idname, dummymt.space_type);
+ if(mt && mt->ext.srna)
+ rna_Menu_unregister(C, mt->ext.srna);
/* create a new menu type */
mt= MEM_callocN(sizeof(MenuType), "python buttons menu");