Improve file checker
4.0.2 changed: File checker doest not fix directly when clicked: - List potential change and display an Apply fix changed: Enhanced visibility conflict list: - Also include viewlayer hide value - Allow to set all hide value from the state of one of the three
This commit is contained in:
@@ -1011,27 +1011,37 @@ def convert_attr(Attr):
|
||||
def show_message_box(_message = "", _title = "Message Box", _icon = 'INFO'):
|
||||
'''Show message box with element passed as string or list
|
||||
if _message if a list of lists:
|
||||
if first element is "OPERATOR":
|
||||
List format: ["OPERATOR", operator_id, text, icon, {prop_name: value, ...}]
|
||||
if sublist have 2 element:
|
||||
considered a label [text,icon]
|
||||
considered a label [text, icon]
|
||||
if sublist have 3 element:
|
||||
considered as an operator [ops_id_name, text, icon]
|
||||
if sublist have 4 element:
|
||||
considered as a property [object, propname, text, icon]
|
||||
'''
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
for l in _message:
|
||||
if isinstance(l, str):
|
||||
self.layout.label(text=l)
|
||||
else:
|
||||
if len(l) == 2: # label with icon
|
||||
self.layout.label(text=l[0], icon=l[1])
|
||||
elif len(l) == 3: # ops
|
||||
self.layout.operator_context = "INVOKE_DEFAULT"
|
||||
self.layout.operator(l[0], text=l[1], icon=l[2], emboss=False) # <- highligh the entry
|
||||
|
||||
## offset pnale when using row...
|
||||
# row = self.layout.row()
|
||||
# row.label(text=l[1])
|
||||
# row.operator(l[0], icon=l[2])
|
||||
layout.label(text=l)
|
||||
elif l[0] == "OPERATOR": # Special operator case with properties
|
||||
layout.operator_context = "INVOKE_DEFAULT"
|
||||
op = layout.operator(l[1], text=l[2], icon=l[3], emboss=False)
|
||||
if len(l) > 4 and isinstance(l[4], dict):
|
||||
for prop_name, value in l[4].items():
|
||||
setattr(op, prop_name, value)
|
||||
|
||||
elif len(l) == 2: # label with icon
|
||||
layout.label(text=l[0], icon=l[1])
|
||||
elif len(l) == 3: # ops
|
||||
layout.operator_context = "INVOKE_DEFAULT"
|
||||
layout.operator(l[0], text=l[1], icon=l[2], emboss=False) # <- highligh the entry
|
||||
elif len(l) == 4: # prop
|
||||
row = layout.row(align=True)
|
||||
row.label(text=l[2], icon=l[3])
|
||||
row.prop(l[0], l[1], text='')
|
||||
|
||||
if isinstance(_message, str):
|
||||
_message = [_message]
|
||||
|
||||
Reference in New Issue
Block a user