Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_workspace.py
| Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| owner_ids = {owner_id.name for owner_id in workspace.owner_ids} | owner_ids = {owner_id.name for owner_id in workspace.owner_ids} | ||||
| for addon in prefs.addons: | for addon in prefs.addons: | ||||
| module_name = addon.module | module_name = addon.module | ||||
| module = addon_map.get(module_name) | module = addon_map.get(module_name) | ||||
| if module is None: | if module is None: | ||||
| continue | continue | ||||
| info = addon_utils.module_bl_info(module) | info = addon_utils.module_bl_info(module) | ||||
| if not info["use_owner"]: | # Remove "Import-Export" addons from the filtering list to reduce noise? | ||||
| continue | # (their entries in the "Import-Export" menus show in any case) | ||||
| #if info["category"] == "Import-Export": | |||||
| # continue | |||||
| is_enabled = module_name in owner_ids | is_enabled = module_name in owner_ids | ||||
| row = col.row() | row = col.row() | ||||
| row.alignment = 'LEFT' | row.alignment = 'LEFT' | ||||
| row.operator( | row.operator( | ||||
| "wm.owner_disable" if is_enabled else "wm.owner_enable", | "wm.owner_disable" if is_enabled else "wm.owner_enable", | ||||
| icon='CHECKBOX_HLT' if is_enabled else 'CHECKBOX_DEHLT', | icon='CHECKBOX_HLT' if is_enabled else 'CHECKBOX_DEHLT', | ||||
| text="%s: %s" % (info["category"], info["name"]), | text="%s: %s" % (info["category"], info["name"]), | ||||
| emboss=False, | emboss=False, | ||||
| Show All 36 Lines | |||||