diff options
author | Gaia Clary <gaia.clary@machinimatrix.org> | 2012-10-13 14:33:09 +0400 |
---|---|---|
committer | Gaia Clary <gaia.clary@machinimatrix.org> | 2012-10-13 14:33:09 +0400 |
commit | 4941f8ac44bc1efc4ae52e527b70796f63e10871 (patch) | |
tree | 5335da4a97e2e767b18ec2d0e9fa3848c802feb1 /release | |
parent | 3fa24c7d5f647098fb6961664e8fbf75fe812e22 (diff) |
added filter for user installed addons
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/__init__.py | 9 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_userpref.py | 9 |
2 files changed, 13 insertions, 5 deletions
diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py index 09d866c2ae5..e4be84d5396 100644 --- a/release/scripts/startup/bl_ui/__init__.py +++ b/release/scripts/startup/bl_ui/__init__.py @@ -92,9 +92,10 @@ def register(): def addon_filter_items(self, context): import addon_utils - items = [('All', "All", ""), - ('Enabled', "Enabled", ""), - ('Disabled', "Disabled", ""), + items = [('All', "All", "All Addons"), + ('User', "User", "All Addons Installed by User"), + ('Enabled', "Enabled", "All Enabled Addons"), + ('Disabled', "Disabled", "All Disabled Addons"), ] items_unique = set() @@ -119,7 +120,7 @@ def register(): WindowManager.addon_support = EnumProperty( items=[('OFFICIAL', "Official", "Officially supported"), ('COMMUNITY', "Community", "Maintained by community developers"), - ('TESTING', "Testing", "Newly contributed scripts (excluded from release builds)"), + ('TESTING', "Testing", "Newly contributed scripts (excluded from release builds)") ], name="Support", description="Display support level", diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 39e2cf40569..87d8a13e856 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -1040,6 +1040,9 @@ class USERPREF_PT_addons(Panel): userpref = context.user_preferences used_ext = {ext.module for ext in userpref.addons} + userpref_addons_folder = os.path.join(bpy.context.user_preferences.filepaths.script_directory,"addons") + scripts_addons_folder = bpy.utils.user_resource('SCRIPTS', "addons") + # collect the categories that can be filtered on addons = [(mod, addon_utils.module_bl_info(mod)) for mod in addon_utils.modules(addon_utils.addons_fake_modules)] @@ -1088,7 +1091,11 @@ class USERPREF_PT_addons(Panel): if ((filter == "All") or (filter == info["category"]) or (filter == "Enabled" and is_enabled) or - (filter == "Disabled" and not is_enabled)): + (filter == "Disabled" and not is_enabled) or + (filter == "User" and + ( mod.__file__.startswith(userpref_addons_folder) or + mod.__file__.startswith(scripts_addons_folder))) + ): if search and search not in info["name"].lower(): if info["author"]: |