diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-01-14 19:49:43 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-01-14 19:49:43 +0300 |
commit | 9d8d25cc34b0ff4d393519095fda4dedd1f7f746 (patch) | |
tree | 07547235e9294cc01ca67e5b91135a53efe26030 /release | |
parent | dc1e1baabf001058a3439c8e0153ce5bf6f494ca (diff) |
add icons to show community vs official scripts as well as buttons to filter by support level (currently all scripts default to community)
note: we need better icons for this.
also formatting edit for ply import.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/op/io_mesh_ply/import_ply.py | 13 | ||||
-rw-r--r-- | release/scripts/templates/addon_add_object.py | 2 | ||||
-rw-r--r-- | release/scripts/ui/space_userpref.py | 31 |
3 files changed, 36 insertions, 10 deletions
diff --git a/release/scripts/op/io_mesh_ply/import_ply.py b/release/scripts/op/io_mesh_ply/import_ply.py index 41d13b310a1..6de90b1e86e 100644 --- a/release/scripts/op/io_mesh_ply/import_ply.py +++ b/release/scripts/op/io_mesh_ply/import_ply.py @@ -23,7 +23,10 @@ import struct class element_spec(object): - __slots__ = 'name', 'count', 'properties' + __slots__ = ("name", + "count", + "properties", + ) def __init__(self, name, count): self.name = name @@ -43,7 +46,10 @@ class element_spec(object): class property_spec(object): - __slots__ = 'name', 'list_type', 'numeric_type' + __slots__ = ("name", + "list_type", + "numeric_type", + ) def __init__(self, name, list_type, numeric_type): self.name = name @@ -96,7 +102,8 @@ class property_spec(object): class object_spec(object): - __slots__ = 'specs' + __slots__ = ("specs", + ) 'A list of element_specs' def __init__(self): self.specs = [] diff --git a/release/scripts/templates/addon_add_object.py b/release/scripts/templates/addon_add_object.py index 070bf2a9a3a..44073f998ab 100644 --- a/release/scripts/templates/addon_add_object.py +++ b/release/scripts/templates/addon_add_object.py @@ -1,4 +1,4 @@ -bl_addon_info = { +bl_info = { "name": "New Object", "author": "YourNameHere", "version": (1, 0), diff --git a/release/scripts/ui/space_userpref.py b/release/scripts/ui/space_userpref.py index 3ab3943519f..20c5b1c93f4 100644 --- a/release/scripts/ui/space_userpref.py +++ b/release/scripts/ui/space_userpref.py @@ -92,6 +92,7 @@ class USERPREF_HT_header(bpy.types.Header): layout.operator("wm.keyconfig_import") elif userpref.active_section == 'ADDONS': layout.operator("wm.addon_install") + layout.menu("USERPREF_MT_addons_dev_guides", text=" Addons Developer Guides", icon='INFO') elif userpref.active_section == 'THEMES': layout.operator("ui.reset_default_theme") @@ -831,6 +832,7 @@ class USERPREF_PT_addons(bpy.types.Panel): bl_options = {'HIDE_HEADER'} _addons_cats = None + _addons_sups = None _addons_fake_modules = {} @classmethod @@ -960,26 +962,35 @@ class USERPREF_PT_addons(bpy.types.Panel): bpy.types.WindowManager.addon_search = bpy.props.StringProperty(name="Search", description="Search within the selected filter") USERPREF_PT_addons._addons_cats = cats + sups = {info["support"] for mod, info in addons} + sups.discard("") + + if USERPREF_PT_addons._addons_sups != sups: + bpy.types.WindowManager.addon_support = bpy.props.EnumProperty(items=[(sup, sup.title(), "") for sup in reversed(sorted(sups))], name="Support", description="Display support level", default={'OFFICIAL', 'COMMUNITY'}, options={'ENUM_FLAG'}) + USERPREF_PT_addons._addons_sups = sups + split = layout.split(percentage=0.2) col = split.column() col.prop(context.window_manager, "addon_search", text="", icon='VIEWZOOM') - col.prop(context.window_manager, "addon_filter", text="Filter", expand=True) + col.prop(context.window_manager, "addon_filter", expand=True) - # menu to open webpages with addons development guides - col.separator() - col.label(text=" Online Documentation", icon='INFO') - col.menu("USERPREF_MT_addons_dev_guides", text="Addons Developer Guides") + col.label(text="Supported Level") + col.prop(context.window_manager, "addon_support", expand=True) col = split.column() filter = context.window_manager.addon_filter search = context.window_manager.addon_search.lower() + support = context.window_manager.addon_support for mod, info in addons: module_name = mod.__name__ is_enabled = module_name in used_ext + if info["support"] not in support: + continue + # check if add-on should be visible with current filters if (filter == "All") or \ (filter == info["category"]) or \ @@ -1006,6 +1017,14 @@ class USERPREF_PT_addons(bpy.types.Panel): if info["warning"]: rowsub.label(icon='ERROR') + # icon showing support level. + if info["support"] == 'OFFICIAL': + rowsub.label(icon='FILE_BLEND') + elif info["support"] == 'COMMUNITY': + rowsub.label(icon='POSE_DATA') + else: + rowsub.label(icon='QUESTION') + if is_enabled: row.operator("wm.addon_disable", icon='CHECKBOX_HLT', text="", emboss=False).module = module_name else: @@ -1073,7 +1092,7 @@ class USERPREF_PT_addons(bpy.types.Panel): from bpy.props import * -def addon_info_get(mod, info_basis={"name": "", "author": "", "version": (), "blender": (), "api": 0, "location": "", "description": "", "wiki_url": "", "tracker_url": "", "category": "", "warning": "", "show_expanded": False}): +def addon_info_get(mod, info_basis={"name": "", "author": "", "version": (), "blender": (), "api": 0, "location": "", "description": "", "wiki_url": "", "tracker_url": "", "support": 'COMMUNITY', "category": "", "warning": "", "show_expanded": False}): addon_info = getattr(mod, "bl_info", {}) # avoid re-initializing |