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:
2016-06-24 13:54:27 -05:00
parent 8c87eeee85
commit b2c34a1a7e
2 changed files with 47 additions and 37 deletions

View File

@@ -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",