3
10
Fork 17

Make checkbox for not installed extensions disabled with tooltip #25

Closed
Dalai Felinto wants to merge 1 commits from dfelinto/blender-addons-contrib:disabled-checkboxes into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
1 changed files with 18 additions and 1 deletions

View File

@ -17,6 +17,7 @@ import bpy
from bpy.types import (
Menu,
Operator,
Panel,
)
@ -415,7 +416,7 @@ def extensions_panel_draw_impl(
)
else:
# Not installed, always placeholder.
row.label(text="", icon='CHECKBOX_DEHLT')
row.operator("preferences.extensions_enable_not_installed", text="", icon='CHECKBOX_DEHLT', emboss=False)
if show_development:
if mark:
@ -661,10 +662,26 @@ def extensions_panel_draw(panel, context):
)
class USERPREF_OT_extensions_enable_not_installed(Operator):
"""Extension needs to be installed before it can be enabled"""
bl_idname = "preferences.extensions_enable_not_installed"
bl_label = "Enable Extension"
@classmethod
def poll(cls, context):
return False
def execute(self, context):
# This operator only exists to be able to show disabled checkboxes for extensions
# while giving users a reasonable explanation on why is that.
return {'CANCELLED'}
classes = (
# Pop-overs.
USERPREF_PT_extensions_bl_pkg_filter,
USERPREF_MT_extensions_bl_pkg_settings,
USERPREF_OT_extensions_enable_not_installed,
)