User Preferences: Added "Enabled add-ons only" preference

This checkbox replaces the "Disabled" and "Enabled" entries in the
filter drop-down. As a result, it now takes a single click to limit the
shown entries to enabled add-ons only. This is also an actual flag in
the preferences, and thus its state is saved between runs on Blender (in
contrast to the filter, which is always reset to "All").

Reviewed by: brecht, billreynish
This commit is contained in:
Sybren A. Stüvel
2019-08-15 10:21:04 +02:00
parent ecc3b033a7
commit 078d02f557
5 changed files with 20 additions and 9 deletions

View File

@@ -667,6 +667,7 @@ class PREFERENCES_OT_addon_install(Operator):
info = addon_utils.module_bl_info(mod)
# show the newly installed addon.
context.preferences.view.show_addons_enabled_only = False
context.window_manager.addon_filter = 'All'
context.window_manager.addon_search = info["name"]
break
@@ -796,6 +797,7 @@ class PREFERENCES_OT_addon_show(Operator):
info["show_expanded"] = True
context.preferences.active_section = 'ADDONS'
context.preferences.view.show_addons_enabled_only = False
context.window_manager.addon_filter = 'All'
context.window_manager.addon_search = info["name"]
bpy.ops.screen.userpref_show('INVOKE_DEFAULT')