UI: preference for developer extras

Currently only used for "Edit Source" feature.
This commit is contained in:
Campbell Barton 2018-06-21 14:54:21 +02:00
parent 52aa963f0e
commit a4f08297ed
6 changed files with 14 additions and 5 deletions

View File

@ -223,6 +223,7 @@ class USERPREF_PT_interface(Panel):
col.prop(view, "ui_line_width", text="Line Width")
col.prop(view, "show_tooltips")
col.prop(view, "show_tooltips_python")
col.prop(view, "show_developer_ui")
col.prop(view, "show_object_info", text="Object Info")
col.prop(view, "show_large_cursors")
col.prop(view, "show_view_name", text="View Name")

View File

@ -3728,7 +3728,7 @@ class VIEW3D_PT_view3d_meshdisplay(Panel):
col.label(text="Face Info:")
col.prop(mesh, "show_extra_face_area", text="Area")
col.prop(mesh, "show_extra_face_angle", text="Angle")
if bpy.app.debug:
if context.user_preferences.view.show_developer_ui:
layout.prop(mesh, "show_extra_indices")

View File

@ -7138,8 +7138,10 @@ static bool ui_but_menu(bContext *C, uiBut *but)
}
/* perhaps we should move this into (G.debug & G_DEBUG) - campbell */
if (ui_block_is_menu(but->block) == false) {
uiItemFullO(layout, "UI_OT_editsource", NULL, ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, 0, NULL);
if (U.flag & USER_DEVELOPER_UI) {
if (ui_block_is_menu(but->block) == false) {
uiItemFullO(layout, "UI_OT_editsource", NULL, ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, 0, NULL);
}
}
if (BKE_addon_find(&U.addons, "ui_translate")) {

View File

@ -2758,7 +2758,7 @@ void init_userdef_do_versions(Main *bmain)
U.flag &= ~(
USER_FLAG_DEPRECATED_1 | USER_FLAG_DEPRECATED_2 | USER_FLAG_DEPRECATED_3 |
USER_FLAG_DEPRECATED_6 | USER_FLAG_DEPRECATED_7 |
USER_FLAG_DEPRECATED_9 | USER_FLAG_DEPRECATED_10);
USER_FLAG_DEPRECATED_9 | USER_DEVELOPER_UI);
U.uiflag &= ~(
USER_UIFLAG_DEPRECATED_7);
U.transopts &= ~(

View File

@ -613,7 +613,7 @@ typedef enum eUserPref_Flag {
USER_FLAG_DEPRECATED_7 = (1 << 7), /* cleared */
USER_MAT_ON_OB = (1 << 8),
USER_FLAG_DEPRECATED_9 = (1 << 9), /* cleared */
USER_FLAG_DEPRECATED_10 = (1 << 10), /* cleared */
USER_DEVELOPER_UI = (1 << 10),
USER_TOOLTIPS = (1 << 11),
USER_TWOBUTTONMOUSE = (1 << 12),
USER_NONUMPAD = (1 << 13),

View File

@ -3374,6 +3374,12 @@ static void rna_def_userdef_view(BlenderRNA *brna)
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_TOOLTIPS_PYTHON);
RNA_def_property_ui_text(prop, "Python Tooltips", "Show Python references in tooltips");
prop = RNA_def_property(srna, "show_developer_ui", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_DEVELOPER_UI);
RNA_def_property_ui_text(
prop, "Developer Extras",
"Show options for developers (edit source in context menu, geometry indices)");
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");