Extensions: split add-ons & extensions into separate preferences
Add back the "Add-ons" preferences, removing add-on logic from extensions. - Add support for filtering add-ons by tags (separate from extension tags). - Tags now respect the "Only Enabled" option. - Remove the ability to enable/disable add-ons from extensions. - Remove add-on preferences from extensions. - Remove "Legacy" & "Core" prefix from add-on names. - Remove "Show Legacy Add-ons" filtering option. Implements design task #122735. Details: - Add-on names and descriptions are no longer translated, since it's impractical to translate text which is mostly maintained outside of Blender. - Extensions names have a `[disabled]` suffix when disabled so it's possible to identify installed but disabled extensions. - The add-on "type" is shown in the details, so it's possible to tell the difference between an extension, a core add-on & a legacy user add-on. - Icons are also used to differentiate the add-on type. - User add-on's must be uninstalled from the add-ons section (matching 4.1 behavior). - Simplify logic for filtering tags, move into a function.
This commit is contained in:
@@ -552,6 +552,10 @@ def register():
|
||||
bl_extension_ops.register()
|
||||
bl_extension_ui.register()
|
||||
|
||||
WindowManager.addon_tags = PointerProperty(
|
||||
name="Addon Tags",
|
||||
type=BlExtDummyGroup,
|
||||
)
|
||||
WindowManager.extension_tags = PointerProperty(
|
||||
name="Extension Tags",
|
||||
type=BlExtDummyGroup,
|
||||
@@ -583,11 +587,6 @@ def register():
|
||||
name="Show Installed Extensions",
|
||||
description="Only show installed extensions",
|
||||
)
|
||||
WindowManager.extension_show_legacy_addons = BoolProperty(
|
||||
name="Show Legacy Add-ons",
|
||||
description="Show add-ons which are not packaged as extensions",
|
||||
default=True,
|
||||
)
|
||||
|
||||
from bl_ui.space_userpref import USERPREF_MT_interface_theme_presets
|
||||
USERPREF_MT_interface_theme_presets.append(theme_preset_draw)
|
||||
@@ -623,7 +622,6 @@ def unregister():
|
||||
del WindowManager.extension_type
|
||||
del WindowManager.extension_enabled_only
|
||||
del WindowManager.extension_installed_only
|
||||
del WindowManager.extension_show_legacy_addons
|
||||
|
||||
for cls in classes:
|
||||
bpy.utils.unregister_class(cls)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -888,7 +888,7 @@ class PREFERENCES_OT_addon_show(Operator):
|
||||
bl_info = addon_utils.module_bl_info(mod)
|
||||
bl_info["show_expanded"] = True
|
||||
|
||||
context.preferences.active_section = 'EXTENSIONS'
|
||||
context.preferences.active_section = 'ADDONS'
|
||||
context.preferences.view.show_addons_enabled_only = False
|
||||
context.window_manager.addon_filter = 'All'
|
||||
context.window_manager.addon_search = bl_info["name"]
|
||||
|
||||
@@ -2261,6 +2261,23 @@ class USERPREF_PT_extensions_repos(Panel):
|
||||
layout_panel.prop(active_repo, "module")
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Extensions Panels
|
||||
|
||||
class ExtensionsPanel:
|
||||
bl_space_type = 'PREFERENCES'
|
||||
bl_region_type = 'WINDOW'
|
||||
bl_context = "extensions"
|
||||
|
||||
|
||||
class USERPREF_PT_extensions(ExtensionsPanel, Panel):
|
||||
bl_label = "Extensions"
|
||||
bl_options = {'HIDE_HEADER'}
|
||||
|
||||
def draw(self, context):
|
||||
pass
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Add-on Panels
|
||||
|
||||
@@ -2279,7 +2296,7 @@ class USERPREF_PT_addons_filter(Panel):
|
||||
class AddOnPanel:
|
||||
bl_space_type = 'PREFERENCES'
|
||||
bl_region_type = 'WINDOW'
|
||||
bl_context = "extensions"
|
||||
bl_context = "addons"
|
||||
|
||||
|
||||
class USERPREF_PT_addons(AddOnPanel, Panel):
|
||||
@@ -2950,6 +2967,7 @@ classes = (
|
||||
|
||||
USERPREF_PT_keymap,
|
||||
|
||||
USERPREF_PT_extensions,
|
||||
USERPREF_PT_addons,
|
||||
|
||||
USERPREF_MT_extensions_active_repo,
|
||||
|
||||
@@ -1142,7 +1142,7 @@ typedef enum eUserPref_Section {
|
||||
USER_SECTION_SYSTEM = 3,
|
||||
USER_SECTION_THEME = 4,
|
||||
USER_SECTION_INPUT = 5,
|
||||
USER_SECTION_EXTENSIONS = 6,
|
||||
USER_SECTION_ADDONS = 6,
|
||||
USER_SECTION_LIGHT = 7,
|
||||
USER_SECTION_KEYMAP = 8,
|
||||
#ifdef WITH_USERDEF_WORKSPACES
|
||||
@@ -1155,6 +1155,7 @@ typedef enum eUserPref_Section {
|
||||
USER_SECTION_NAVIGATION = 14,
|
||||
USER_SECTION_FILE_PATHS = 15,
|
||||
USER_SECTION_EXPERIMENTAL = 16,
|
||||
USER_SECTION_EXTENSIONS = 17,
|
||||
} eUserPref_Section;
|
||||
|
||||
/** #UserDef_SpaceData.flag (State of the user preferences UI). */
|
||||
|
||||
@@ -60,6 +60,7 @@ const EnumPropertyItem rna_enum_preference_section_items[] = {
|
||||
{USER_SECTION_ANIMATION, "ANIMATION", 0, "Animation", ""},
|
||||
RNA_ENUM_ITEM_SEPR,
|
||||
{USER_SECTION_EXTENSIONS, "EXTENSIONS", 0, "Extensions", ""},
|
||||
{USER_SECTION_ADDONS, "ADDONS", 0, "Add-ons", ""},
|
||||
{USER_SECTION_THEME, "THEMES", 0, "Themes", ""},
|
||||
#if 0 /* def WITH_USERDEF_WORKSPACES */
|
||||
RNA_ENUM_ITEM_SEPR,
|
||||
|
||||
Reference in New Issue
Block a user