[#22554] Register option on Texts doesn't work anymore

there were no hints that '.py' extension is needed, added tooltip.
This commit is contained in:
Campbell Barton 2010-06-11 14:10:02 +00:00
parent e0bada19f9
commit a0a99e4a4d
2 changed files with 5 additions and 5 deletions

@ -54,6 +54,9 @@ class TEXT_HT_header(bpy.types.Header):
if text:
row = layout.row()
row.operator("text.run_script")
row = layout.row()
row.active = text.name.endswith(".py")
row.prop(text, "use_module")
row = layout.row()
@ -63,10 +66,7 @@ class TEXT_HT_header(bpy.types.Header):
else:
row.label(text="File: %s" % text.filepath)
else:
if text.library:
row.label(text="Text: External")
else:
row.label(text="Text: Internal")
row.label(text="Text: External" if text.library else "Text: Internal")
class TEXT_PT_properties(bpy.types.Panel):

@ -195,7 +195,7 @@ static void rna_def_text(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_module", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", TXT_ISSCRIPT);
RNA_def_property_ui_text(prop, "Register", "Register this text as a module on loading");
RNA_def_property_ui_text(prop, "Register", "Register this text as a module on loading, Text name must end with \".py\"");
prop= RNA_def_property(srna, "tabs_as_spaces", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", TXT_TABSTOSPACES);