Don't add "Report a Bug" button for official tracker to non-official add-ons

If no custom URL was set, add-ons would get a "Report a Bug" button opening
the default developer.blender.org bug tracker. Now we only add this default
button if the add-on is bundled and not installed by the user.
This commit is contained in:
Julian Eisel 2018-03-09 21:17:43 +01:00
parent 14e7ba0c8a
commit 41b38c5f75

@ -1513,12 +1513,15 @@ class USERPREF_PT_addons(Panel):
split.operator( split.operator(
"wm.url_open", text="Documentation", icon='HELP', "wm.url_open", text="Documentation", icon='HELP',
).url = info["wiki_url"] ).url = info["wiki_url"]
split.operator( # Only add "Report a Bug" button if tracker_url is set
"wm.url_open", text="Report a Bug", icon='URL', # or the add-on is bundled (use official tracker then).
).url = info.get( if info.get("tracker_url") or not user_addon:
"tracker_url", split.operator(
"https://developer.blender.org/maniphest/task/edit/form/2", "wm.url_open", text="Report a Bug", icon='URL',
) ).url = info.get(
"tracker_url",
"https://developer.blender.org/maniphest/task/edit/form/2",
)
if user_addon: if user_addon:
split.operator( split.operator(
"wm.addon_remove", text="Remove", icon='CANCEL', "wm.addon_remove", text="Remove", icon='CANCEL',