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-08 23:06:32 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-10-08 23:06:32 +0400
commit5c867406aa66a1d89260c233a6bbc1a2a7912dbe (patch)
tree0cce14e7a49cb61b6114b69f457ca6a920db8de4 /source/blender/makesrna/intern/rna_ui.c
parent3ebd58673fb9a8c5ef13048b2e8e8a4cb7bb3a4e (diff)
menus are now global (like operators), so for eg, the info add menu and the 3D add menu can be shared.
Diffstat (limited to 'source/blender/makesrna/intern/rna_ui.c')
-rw-r--r--source/blender/makesrna/intern/rna_ui.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c
index 1a1172247fc..a1b412c70f4 100644
--- a/source/blender/makesrna/intern/rna_ui.c
+++ b/source/blender/makesrna/intern/rna_ui.c
@@ -348,12 +348,11 @@ static void rna_Menu_unregister(const bContext *C, StructRNA *type)
if(!mt)
return;
- if(!(art=region_type_find(NULL, mt->space_type, RGN_TYPE_HEADER)))
- return;
RNA_struct_free_extension(type, &mt->ext);
- BLI_freelinkN(&art->menutypes, mt);
+ WM_menutype_freelink(mt);
+
RNA_struct_free(&BLENDER_RNA, type);
/* update while blender is running */
@@ -376,12 +375,9 @@ static StructRNA *rna_Menu_register(const bContext *C, ReportList *reports, void
/* validate the python class */
if(validate(&dummymtr, data, have_function) != 0)
return NULL;
-
- if(!(art=region_type_find(reports, dummymt.space_type, RGN_TYPE_HEADER)))
- return NULL;
/* check if we have registered this menu type before, and remove it */
- mt= BKE_spacemenu_find(dummymt.idname, dummymt.space_type);
+ mt= WM_menutype_find(dummymt.idname, TRUE);
if(mt && mt->ext.srna)
rna_Menu_unregister(C, mt->ext.srna);
@@ -398,7 +394,7 @@ static StructRNA *rna_Menu_register(const bContext *C, ReportList *reports, void
mt->poll= (have_function[0])? menu_poll: NULL;
mt->draw= (have_function[1])? menu_draw: NULL;
- BLI_addtail(&art->menutypes, mt);
+ WM_menutype_add(mt);
/* update while blender is running */
if(C)
@@ -734,11 +730,6 @@ static void rna_def_menu(BlenderRNA *brna)
RNA_def_property_string_sdna(prop, NULL, "type->label");
RNA_def_property_flag(prop, PROP_REGISTER);
- prop= RNA_def_property(srna, "space_type", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "type->space_type");
- RNA_def_property_enum_items(prop, space_type_items);
- RNA_def_property_flag(prop, PROP_REGISTER);
-
RNA_define_verify_sdna(1);
}