Extensions: Move Extensions Repositories panel to Extensions tab

Move "Extensions Repositories" panel from FilePaths to Extensions.

Temporary change until a design is agreed on, to make it easier to test
repos while developing without going back and forth between sections.
This commit is contained in:
Pablo Vazquez
2023-10-19 15:26:48 +02:00
committed by Campbell Barton
parent 6f197f6df3
commit 385ef2c298
2 changed files with 49 additions and 48 deletions
+48 -47
View File
@@ -1579,51 +1579,6 @@ class USERPREF_UL_asset_libraries(bpy.types.UIList):
layout.prop(asset_library, "name", text="", emboss=False)
class USERPREF_PT_file_paths_extension_repos(FilePathsPanel, Panel):
bl_label = "Extension Repositories"
@classmethod
def poll(cls, context):
return context.preferences.experimental.use_extension_repos
def draw(self, context):
layout = self.layout
layout.use_property_split = False
layout.use_property_decorate = False
paths = context.preferences.filepaths
active_library_index = paths.active_extension_repo
row = layout.row()
row.template_list(
"USERPREF_UL_extension_repos", "user_extension_repos",
paths, "extension_repos",
paths, "active_extension_repo"
)
col = row.column(align=True)
col.operator("preferences.extension_repo_add", text="", icon='ADD')
props = col.operator("preferences.extension_repo_remove", text="", icon='REMOVE')
props.index = active_library_index
try:
active_repo = None if active_library_index < 0 else paths.extension_repos[active_library_index]
except IndexError:
active_repo = None
if active_repo is None:
return
layout.separator()
layout.prop(active_repo, "directory")
layout.prop(active_repo, "remote_path")
row = layout.row()
row.prop(active_repo, "use_cache")
row.prop(active_repo, "module")
class USERPREF_UL_extension_repos(bpy.types.UIList):
def draw_item(self, _context, layout, _data, item, icon, _active_data, _active_propname, _index):
repo = item
@@ -2056,6 +2011,51 @@ class USERPREF_PT_extensions(ExtensionsPanel, Panel):
).url = "https://projects.blender.org/ideasman42/bl_ext"
class USERPREF_PT_extensions_repos(ExtensionsPanel, Panel):
bl_label = "Extension Repositories"
@classmethod
def poll(cls, context):
return context.preferences.experimental.use_extension_repos
def draw(self, context):
layout = self.layout
layout.use_property_split = False
layout.use_property_decorate = False
paths = context.preferences.filepaths
active_library_index = paths.active_extension_repo
row = layout.row()
row.template_list(
"USERPREF_UL_extension_repos", "user_extension_repos",
paths, "extension_repos",
paths, "active_extension_repo"
)
col = row.column(align=True)
col.operator("preferences.extension_repo_add", text="", icon='ADD')
props = col.operator("preferences.extension_repo_remove", text="", icon='REMOVE')
props.index = active_library_index
try:
active_repo = None if active_library_index < 0 else paths.extension_repos[active_library_index]
except IndexError:
active_repo = None
if active_repo is None:
return
layout.separator()
layout.prop(active_repo, "directory")
layout.prop(active_repo, "remote_path")
row = layout.row()
row.prop(active_repo, "use_cache")
row.prop(active_repo, "module")
# -----------------------------------------------------------------------------
# Add-On Panels
@@ -2669,7 +2669,6 @@ classes = (
USERPREF_PT_file_paths_render,
USERPREF_PT_file_paths_asset_libraries,
USERPREF_PT_file_paths_script_directories,
USERPREF_PT_file_paths_extension_repos,
USERPREF_PT_file_paths_applications,
USERPREF_PT_text_editor,
USERPREF_PT_text_editor_presets,
@@ -2694,9 +2693,11 @@ classes = (
USERPREF_PT_keymap,
USERPREF_PT_extensions,
USERPREF_PT_addons,
USERPREF_PT_extensions,
USERPREF_PT_extensions_repos,
USERPREF_PT_studiolight_lights,
USERPREF_PT_studiolight_light_editor,
USERPREF_PT_studiolight_matcaps,
@@ -56,7 +56,6 @@ const EnumPropertyItem rna_enum_preference_section_items[] = {
{USER_SECTION_EDITING, "EDITING", 0, "Editing", ""},
{USER_SECTION_ANIMATION, "ANIMATION", 0, "Animation", ""},
RNA_ENUM_ITEM_SEPR,
{USER_SECTION_EXTENSIONS, "EXTENSIONS", 0, "Extensions", ""},
{USER_SECTION_ADDONS, "ADDONS", 0, "Add-ons", ""},
#if 0 /* def WITH_USERDEF_WORKSPACES */
RNA_ENUM_ITEM_SEPR,
@@ -72,6 +71,7 @@ const EnumPropertyItem rna_enum_preference_section_items[] = {
{USER_SECTION_SYSTEM, "SYSTEM", 0, "System", ""},
{USER_SECTION_SAVE_LOAD, "SAVE_LOAD", 0, "Save & Load", ""},
{USER_SECTION_FILE_PATHS, "FILE_PATHS", 0, "File Paths", ""},
{USER_SECTION_EXTENSIONS, "EXTENSIONS", 0, "Extensions", ""},
RNA_ENUM_ITEM_SEPR,
{USER_SECTION_EXPERIMENTAL, "EXPERIMENTAL", 0, "Experimental", ""},
{0, nullptr, 0, nullptr, nullptr},