Adding support for download and install of .zip addons
Minor UI alteration, and some small changes based on Sybren's feedback
This commit is contained in:
@@ -56,8 +56,8 @@ class PackageManagerAddon(bpy.types.PropertyGroup):
|
||||
blender = StringProperty()
|
||||
warning = StringProperty()
|
||||
support = StringProperty()
|
||||
filename = StringProperty()
|
||||
module_name = StringProperty()
|
||||
download_url = StringProperty()
|
||||
|
||||
class PackageManagerPreferences(AddonPreferences):
|
||||
# this must match the addon name, use '__package__'
|
||||
@@ -81,18 +81,17 @@ class PackageManagerPreferences(AddonPreferences):
|
||||
# Display selected add-on
|
||||
addon = self.pm_addons[self.pm_addons_index]
|
||||
|
||||
installed = False
|
||||
for module in addon_utils.modules():
|
||||
if module.__name__ == addon.module_name:
|
||||
installed = True
|
||||
break
|
||||
installed = any(module.__name__ == addon.module_name for module in addon_utils.modules())
|
||||
|
||||
col_box = layout.column()
|
||||
box = col_box.box()
|
||||
colsub = box.column()
|
||||
|
||||
split = colsub.row().split(percentage=0.25)
|
||||
split.label(text="Installed: %s" % ("Yes" if installed else "No"))
|
||||
if installed and addon.version is not None:
|
||||
split.label(text="Installed: Yes, v%s" % addon.version)
|
||||
else:
|
||||
split.label(text="Installed: No")
|
||||
split.separator()
|
||||
split.separator()
|
||||
split.operator("wm.addon_download_install",
|
||||
|
Reference in New Issue
Block a user