Cleanup: assign variables for re-used context members
This commit is contained in:
parent
fa0ceb4959
commit
507e7bcbdb
|
@ -1759,6 +1759,7 @@ class USERPREF_PT_addons(AddOnPanel, Panel):
|
|||
|
||||
layout = self.layout
|
||||
|
||||
wm = context.window_manager
|
||||
prefs = context.preferences
|
||||
used_ext = {ext.module for ext in prefs.addons}
|
||||
|
||||
|
@ -1784,16 +1785,16 @@ class USERPREF_PT_addons(AddOnPanel, Panel):
|
|||
split = layout.split(factor=0.6)
|
||||
|
||||
row = split.row()
|
||||
row.prop(context.window_manager, "addon_support", expand=True)
|
||||
row.prop(wm, "addon_support", expand=True)
|
||||
|
||||
row = split.row(align=True)
|
||||
row.operator("preferences.addon_install", icon='IMPORT', text="Install...")
|
||||
row.operator("preferences.addon_refresh", icon='FILE_REFRESH', text="Refresh")
|
||||
|
||||
row = layout.row()
|
||||
row.prop(context.preferences.view, "show_addons_enabled_only")
|
||||
row.prop(context.window_manager, "addon_filter", text="")
|
||||
row.prop(context.window_manager, "addon_search", text="", icon='VIEWZOOM')
|
||||
row.prop(prefs.view, "show_addons_enabled_only")
|
||||
row.prop(wm, "addon_filter", text="")
|
||||
row.prop(wm, "addon_search", text="", icon='VIEWZOOM')
|
||||
|
||||
col = layout.column()
|
||||
|
||||
|
@ -1818,10 +1819,10 @@ class USERPREF_PT_addons(AddOnPanel, Panel):
|
|||
"(see console for details)",
|
||||
)
|
||||
|
||||
show_enabled_only = context.preferences.view.show_addons_enabled_only
|
||||
filter = context.window_manager.addon_filter
|
||||
search = context.window_manager.addon_search.lower()
|
||||
support = context.window_manager.addon_support
|
||||
show_enabled_only = prefs.view.show_addons_enabled_only
|
||||
filter = wm.addon_filter
|
||||
search = wm.addon_search.lower()
|
||||
support = wm.addon_support
|
||||
|
||||
# initialized on demand
|
||||
user_addon_paths = []
|
||||
|
|
Loading…
Reference in New Issue