diff options
author | Matt Ebb <matt@mke3.net> | 2010-01-13 09:35:12 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-01-13 09:35:12 +0300 |
commit | 7df44b9cede3aa903c4463f9e5f885a705b4173a (patch) | |
tree | 1d9c9e221f1469989d7c3d901b5ffb424eba815d /source/blender/editors/interface/interface_templates.c | |
parent | 728359a6a5fd5736e1f1fdfa359f22474e76fd1d (diff) |
Fix: wasn't able to rename node group nodetree name, or access the nodetree at all. Now you
can switch between them too.
Wrapped group nodes in RNA as part of this.
Diffstat (limited to 'source/blender/editors/interface/interface_templates.c')
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 106875e3907..e00cd8986e0 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -446,12 +446,11 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str uiBlockEndAlign(block); } -static void ui_template_id(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propname, char *newop, char *openop, char *unlinkop, int previews, int prv_rows, int prv_cols) +static void ui_template_id(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propname, char *newop, char *openop, char *unlinkop, int flag, int prv_rows, int prv_cols) { TemplateID *template; PropertyRNA *prop; StructRNA *type; - int flag; prop= RNA_struct_find_property(ptr, propname); @@ -466,14 +465,10 @@ static void ui_template_id(uiLayout *layout, bContext *C, PointerRNA *ptr, char template->prv_rows = prv_rows; template->prv_cols = prv_cols; - flag= UI_ID_BROWSE|UI_ID_RENAME|UI_ID_DELETE; - if(newop) flag |= UI_ID_ADD_NEW; if(openop) flag |= UI_ID_OPEN; - if(previews) - flag |= UI_ID_PREVIEWS; type= RNA_property_pointer_type(ptr, prop); template->idlb= wich_libbase(CTX_data_main(C), RNA_type_to_ID_code(type)); @@ -492,12 +487,17 @@ static void ui_template_id(uiLayout *layout, bContext *C, PointerRNA *ptr, char void uiTemplateID(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propname, char *newop, char *openop, char *unlinkop) { - ui_template_id(layout, C, ptr, propname, newop, openop, unlinkop, 0, 0, 0); + ui_template_id(layout, C, ptr, propname, newop, openop, unlinkop, UI_ID_BROWSE|UI_ID_RENAME|UI_ID_DELETE, 0, 0); +} + +void uiTemplateIDBrowse(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propname, char *newop, char *openop, char *unlinkop) +{ + ui_template_id(layout, C, ptr, propname, newop, openop, unlinkop, UI_ID_BROWSE|UI_ID_RENAME, 0, 0); } void uiTemplateIDPreview(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propname, char *newop, char *openop, char *unlinkop, int rows, int cols) { - ui_template_id(layout, C, ptr, propname, newop, openop, unlinkop, 1, rows, cols); + ui_template_id(layout, C, ptr, propname, newop, openop, unlinkop, UI_ID_BROWSE|UI_ID_RENAME|UI_ID_DELETE|UI_ID_PREVIEWS, rows, cols); } /************************ ID Chooser Template ***************************/ |