[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33226] trunk/blender: User preference to hide Python references in Tooltips.
Elia Sarti
vekoon at gmail.com
Mon Nov 22 01:10:33 CET 2010
Revision: 33226
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33226
Author: vekoon
Date: 2010-11-22 01:10:32 +0100 (Mon, 22 Nov 2010)
Log Message:
-----------
User preference to hide Python references in Tooltips.
Modified Paths:
--------------
trunk/blender/release/scripts/ui/space_userpref.py
trunk/blender/source/blender/editors/interface/interface_regions.c
trunk/blender/source/blender/makesdna/DNA_userdef_types.h
trunk/blender/source/blender/makesrna/intern/rna_userdef.c
Modified: trunk/blender/release/scripts/ui/space_userpref.py
===================================================================
--- trunk/blender/release/scripts/ui/space_userpref.py 2010-11-21 23:40:14 UTC (rev 33225)
+++ trunk/blender/release/scripts/ui/space_userpref.py 2010-11-22 00:10:32 UTC (rev 33226)
@@ -156,6 +156,7 @@
col = row.column()
col.label(text="Display:")
col.prop(view, "show_tooltips")
+ col.prop(view, "hide_tooltips_python")
col.prop(view, "show_object_info", text="Object Info")
col.prop(view, "show_large_cursors")
col.prop(view, "show_view_name", text="View Name")
Modified: trunk/blender/source/blender/editors/interface/interface_regions.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_regions.c 2010-11-21 23:40:14 UTC (rev 33225)
+++ trunk/blender/source/blender/editors/interface/interface_regions.c 2010-11-22 00:10:32 UTC (rev 33226)
@@ -403,9 +403,11 @@
}
/* rna info */
- BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Python: %s.%s", RNA_struct_identifier(but->rnapoin.type), RNA_property_identifier(but->rnaprop));
- data->color[data->totline]= 0x888888;
- data->totline++;
+ if ((U.flag & USER_TOOLTIPS_PYTHON) == 0) {
+ BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Python: %s.%s", RNA_struct_identifier(but->rnapoin.type), RNA_property_identifier(but->rnaprop));
+ data->color[data->totline]= 0x888888;
+ data->totline++;
+ }
if(but->rnapoin.id.data) {
ID *id= but->rnapoin.id.data;
@@ -424,9 +426,11 @@
str= WM_operator_pystring(C, but->optype, opptr, 0);
/* operator info */
- BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Python: %s", str);
- data->color[data->totline]= 0x888888;
- data->totline++;
+ if ((U.flag & USER_TOOLTIPS_PYTHON) == 0) {
+ BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Python: %s", str);
+ data->color[data->totline]= 0x888888;
+ data->totline++;
+ }
MEM_freeN(str);
Modified: trunk/blender/source/blender/makesdna/DNA_userdef_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_userdef_types.h 2010-11-21 23:40:14 UTC (rev 33225)
+++ trunk/blender/source/blender/makesdna/DNA_userdef_types.h 2010-11-22 00:10:32 UTC (rev 33226)
@@ -425,6 +425,7 @@
#define USER_FILENOUI (1 << 23)
#define USER_NONEGFRAMES (1 << 24)
#define USER_TXT_TABSTOSPACES_DISABLE (1 << 25)
+#define USER_TOOLTIPS_PYTHON (1 << 26)
/* helper macro for checking frame clamping */
#define FRAMENUMBER_MIN_CLAMP(cfra) \
Modified: trunk/blender/source/blender/makesrna/intern/rna_userdef.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_userdef.c 2010-11-21 23:40:14 UTC (rev 33225)
+++ trunk/blender/source/blender/makesrna/intern/rna_userdef.c 2010-11-22 00:10:32 UTC (rev 33226)
@@ -1923,6 +1923,10 @@
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TOOLTIPS);
RNA_def_property_ui_text(prop, "Tooltips", "Display tooltips");
+ prop= RNA_def_property(srna, "hide_tooltips_python", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TOOLTIPS_PYTHON);
+ RNA_def_property_ui_text(prop, "Hide Python Tooltips", "Hide Python references in tooltips");
+
prop= RNA_def_property(srna, "show_object_info", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_DRAWVIEWINFO);
RNA_def_property_ui_text(prop, "Display Object Info", "Display objects name and frame number in 3D view");
More information about the Bf-blender-cvs
mailing list