diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-06-02 21:52:06 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-06-02 21:52:06 +0400 |
commit | d8c2709414ec3b25c2bdaeea57eb26c2ff91f977 (patch) | |
tree | 590b4a6151a11ad2618a834aea2dfc4eafe49761 /source/blender/makesrna/intern/rna_text.c | |
parent | 5506ab080d1f03acd9e0e09a43b244b2ccece544 (diff) |
Better API design for making text datablocks after loading.
An optional 'internal' argument was added to the bpy.data.texts.load() operator.
The changes in revision 57153 were reverted, so that the is_in_memory and is_dirty
properties of text datablocks are not editable again.
In the C API layer, BKE_text_load_ex() was introduced to allow for optionally
making text datablocks internal after loading.
Diffstat (limited to 'source/blender/makesrna/intern/rna_text.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_text.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_text.c b/source/blender/makesrna/intern/rna_text.c index b1eb0bb2228..df6181af4b2 100644 --- a/source/blender/makesrna/intern/rna_text.c +++ b/source/blender/makesrna/intern/rna_text.c @@ -148,6 +148,7 @@ static void rna_def_text(BlenderRNA *brna) prop = RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", TXT_ISDIRTY); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Dirty", "Text file has been edited since last save"); prop = RNA_def_property(srna, "is_modified", PROP_BOOLEAN, PROP_NONE); @@ -157,6 +158,7 @@ static void rna_def_text(BlenderRNA *brna) prop = RNA_def_property(srna, "is_in_memory", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", TXT_ISMEM); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Memory", "Text file is in memory, without a corresponding file on disk"); prop = RNA_def_property(srna, "use_module", PROP_BOOLEAN, PROP_NONE); |