diff options
author | Miika Hamalainen <blender@miikah.org> | 2011-06-16 16:00:03 +0400 |
---|---|---|
committer | Miika Hamalainen <blender@miikah.org> | 2011-06-16 16:00:03 +0400 |
commit | b937a4f5b6adc6bc0dca62cb5c87db08c873cfba (patch) | |
tree | f489aca8e10e2a686fc1d1397397f99e1e1f2077 /release/scripts/startup/bl_ui/__init__.py | |
parent | 3de22dec26606c2c526f7193db038fa5125f9b03 (diff) | |
parent | f227c4a064d96909243b4a60a7f6c544f521817a (diff) |
Merge with trunk r37546
Diffstat (limited to 'release/scripts/startup/bl_ui/__init__.py')
-rw-r--r-- | release/scripts/startup/bl_ui/__init__.py | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py index 9d5221b4e92..49ff0c6925b 100644 --- a/release/scripts/startup/bl_ui/__init__.py +++ b/release/scripts/startup/bl_ui/__init__.py @@ -86,26 +86,26 @@ def register(): from bpy.props import StringProperty, EnumProperty WindowManager = bpy.types.WindowManager + def addon_filter_items(self, context): + import addon_utils + + items = [('All', "All", ""), + ('Enabled', "Enabled", ""), + ('Disabled', "Disabled", ""), + ] + + items_unique = set() + + for mod in addon_utils.modules(space_userpref.USERPREF_PT_addons._addons_fake_modules): + info = addon_utils.module_bl_info(mod) + items_unique.add(info["category"]) + + items.extend([(cat, cat, "") for cat in sorted(items_unique)]) + return items + WindowManager.addon_search = StringProperty(name="Search", description="Search within the selected filter") WindowManager.addon_filter = EnumProperty( - items=[('All', "All", ""), - ('Enabled', "Enabled", ""), - ('Disabled', "Disabled", ""), - ('3D View', "3D View", ""), - ('Add Curve', "Add Curve", ""), - ('Add Mesh', "Add Mesh", ""), - ('Animation', "Animation", ""), - ('Development', "Development", ""), - ('Game Engine', "Game Engine", ""), - ('Import-Export', "Import-Export", ""), - ('Mesh', "Mesh", ""), - ('Object', "Object", ""), - ('Render', "Render", ""), - ('Rigging', "Rigging", ""), - ('Text Editor', "Text Editor", ""), - ('System', "System", ""), - ('Other', "Other", ""), - ], + items=addon_filter_items, name="Category", description="Filter add-ons by category", ) |