Quick hack to show 'update' instead of 'install' when appropriate

This commit is contained in:
Ellwood Zwovic
2017-07-26 02:28:00 -07:00
parent 64bc1630df
commit 8386d6ecb9

View File

@@ -791,7 +791,8 @@ class USERPREF_PT_packages(bpy.types.Panel):
if pkg.installed: if pkg.installed:
if pkg.url and pkg.user: if pkg.url and pkg.user:
right.operator(PACKAGE_OT_uninstall.bl_idname, right.operator(PACKAGE_OT_uninstall.bl_idname,
text="Uninstall").package_name=pkg.name text="Uninstall"
).package_name=pkg.name
elif pkg.user: elif pkg.user:
right.label("Installed, but not in repo") right.label("Installed, but not in repo")
right.scale_y = 2 right.scale_y = 2
@@ -802,8 +803,15 @@ class USERPREF_PT_packages(bpy.types.Panel):
right.enabled = False right.enabled = False
else: else:
if pkg.url: if pkg.url:
if metapkg.get_latest_installed_version():
if metapkg.get_latest_installed_version().version < metapkg.get_latest_version().version:
right.operator(PACKAGE_OT_install.bl_idname, right.operator(PACKAGE_OT_install.bl_idname,
text="Install").package_name=pkg.name text="Update"
).package_name=pkg.name
else:
right.operator(PACKAGE_OT_install.bl_idname,
text="Install"
).package_name=pkg.name
else: else:
right.label("Not installed, but no URL?") right.label("Not installed, but no URL?")