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>2010-12-30 15:22:28 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-12-30 15:22:28 +0300
commit9733e5f76fdc87c3c5801a372f86062d47f844d4 (patch)
tree5cc5ba86a76a259c7d96ab6fdad3f55171ac9314 /source/blender/editors
parente68a9ab95fb9cd3e94441c1ca8c664355533afbf (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')
-rw-r--r--source/blender/editors/animation/drivers.c2
-rw-r--r--source/blender/editors/interface/interface_templates.c4
2 files changed, 2 insertions, 4 deletions
diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c
index ec431d34995..902fa2f789f 100644
--- a/source/blender/editors/animation/drivers.c
+++ b/source/blender/editors/animation/drivers.c
@@ -212,7 +212,7 @@ short ANIM_add_driver (ReportList *reports, ID *id, const char rna_path[], int a
/* Main Driver Management API calls:
* Remove the driver for the specified property on the given ID block (if available)
*/
-short ANIM_remove_driver (ReportList *reports, ID *id, const char rna_path[], int array_index, short UNUSED(flag))
+short ANIM_remove_driver (ReportList *UNUSED(reports), ID *id, const char rna_path[], int array_index, short UNUSED(flag))
{
AnimData *adt;
FCurve *fcu;
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));