diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-12-22 14:59:30 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-12-22 14:59:30 +0300 |
commit | 0606dbe291a00edba9a3010e109c200541321d63 (patch) | |
tree | dd96e7265313a6483dcd832008597e3de89f7b9e /source/blender/editors | |
parent | 3221dea46eeb6c5441c4617d704ffb3e8caeeca3 (diff) |
Fix #20433: make single user doesn't work from menu. Popup menus for
operators were not passing along properties.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 1 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 23 |
2 files changed, 22 insertions, 2 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 8e44d7f386e..313791e28cb 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -678,6 +678,7 @@ void uiItemEnumR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, void uiItemEnumR_string(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, char *value); void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, char *propname); void uiItemPointerR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, struct PointerRNA *searchptr, char *searchpropname); +void uiItemsFullEnumO(uiLayout *layout, char *opname, char *propname, struct IDProperty *properties, int context, int flag); void uiItemL(uiLayout *layout, char *name, int icon); /* label */ void uiItemM(uiLayout *layout, struct bContext *C, char *name, int icon, char *menuname); /* menu */ diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index b0670be63a2..9dd5535ea30 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -695,7 +695,7 @@ void uiItemEnumO(uiLayout *layout, char *name, int icon, char *opname, char *pro uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext, 0); } -void uiItemsEnumO(uiLayout *layout, char *opname, char *propname) +void uiItemsFullEnumO(uiLayout *layout, char *opname, char *propname, IDProperty *properties, int context, int flag) { wmOperatorType *ot= WM_operatortype_find(opname, 0); PointerRNA ptr; @@ -721,7 +721,21 @@ void uiItemsEnumO(uiLayout *layout, char *opname, char *propname) for(i=0; i<totitem; i++) { if(item[i].identifier[0]) { - uiItemEnumO(column, (char*)item[i].name, item[i].icon, opname, propname, item[i].value); + if(properties) { + PointerRNA ptr; + + WM_operator_properties_create(&ptr, opname); + if(ptr.data) { + IDP_FreeProperty(ptr.data); + MEM_freeN(ptr.data); + } + ptr.data= IDP_CopyProperty(properties); + RNA_enum_set(&ptr, propname, item[i].value); + + uiItemFullO(column, (char*)item[i].name, item[i].icon, opname, ptr.data, context, flag); + } + else + uiItemEnumO(column, (char*)item[i].name, item[i].icon, opname, propname, item[i].value); } else { if(item[i].name) { @@ -745,6 +759,11 @@ void uiItemsEnumO(uiLayout *layout, char *opname, char *propname) } } +void uiItemsEnumO(uiLayout *layout, char *opname, char *propname) +{ + uiItemsFullEnumO(layout, opname, propname, NULL, layout->root->opcontext, 0); +} + /* for use in cases where we have */ void uiItemEnumO_string(uiLayout *layout, char *name, int icon, char *opname, char *propname, char *value_str) { |