diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-12-30 15:22:28 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-12-30 15:22:28 +0300 |
commit | 9733e5f76fdc87c3c5801a372f86062d47f844d4 (patch) | |
tree | 5cc5ba86a76a259c7d96ab6fdad3f55171ac9314 /source/blender/editors/interface | |
parent | e68a9ab95fb9cd3e94441c1ca8c664355533afbf (diff) |
revert part of Tons commit r33884.
- rather then use unlink="None", just don't pass unlink as a keyword. This is more pythonic.
- added an RNA flag for properties which cant be unlinked by setting to None.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index b034ddf7827..03e7f058b05 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -450,7 +450,7 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str } /* delete button */ - if(id && (flag & UI_ID_DELETE)) { + if(id && (flag & UI_ID_DELETE) && (RNA_property_flag(template->prop) & PROP_NEVER_UNLINK)==0) { if(unlinkop) { but= uiDefIconButO(block, BUT, unlinkop, WM_OP_INVOKE_REGION_WIN, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL); /* so we can access the template from operators, font unlinking needs this */ @@ -494,8 +494,6 @@ static void ui_template_id(uiLayout *layout, bContext *C, PointerRNA *ptr, const flag |= UI_ID_ADD_NEW; if(openop) flag |= UI_ID_OPEN; - if(unlinkop && strcmp(unlinkop, "None") == 0) - flag &= ~UI_ID_DELETE; type= RNA_property_pointer_type(ptr, prop); template->idlb= which_libbase(CTX_data_main(C), RNA_type_to_ID_code(type)); |