feat: display node in error in the repository view

This commit is contained in:
Swann 2020-10-02 17:22:14 +02:00
parent b368c985b8
commit edcbd7b02a
No known key found for this signature in database
GPG Key ID: E1D3641A7C43AACB

View File

@ -35,7 +35,8 @@ ICONS_PROP_STATES = ['TRIA_DOWN', # ADDED
'KEYTYPE_KEYFRAME_VEC', # PUSHED 'KEYTYPE_KEYFRAME_VEC', # PUSHED
'TRIA_DOWN', # FETCHED 'TRIA_DOWN', # FETCHED
'FILE_REFRESH', # UP 'FILE_REFRESH', # UP
'TRIA_UP'] # CHANGED 'TRIA_UP',
'ERROR'] # CHANGED
def printProgressBar(iteration, total, prefix='', suffix='', decimals=1, length=100, fill='', fill_empty=' '): def printProgressBar(iteration, total, prefix='', suffix='', decimals=1, length=100, fill='', fill_empty=' '):
@ -486,13 +487,13 @@ def draw_property(context, parent, property_uuid, level=0):
runtime_settings = context.window_manager.session runtime_settings = context.window_manager.session
item = session.get(uuid=property_uuid) item = session.get(uuid=property_uuid)
if item.state == ERROR:
return
area_msg = parent.row(align=True) area_msg = parent.row(align=True)
if level > 0:
for i in range(level): if item.state == ERROR:
area_msg.label(text="") area_msg.alert=True
else:
area_msg.alert=False
line = area_msg.box() line = area_msg.box()
name = item.data['name'] if item.data else item.uuid name = item.data['name'] if item.data else item.uuid
@ -505,8 +506,8 @@ def draw_property(context, parent, property_uuid, level=0):
# Operations # Operations
have_right_to_modify = item.owner == settings.username or \ have_right_to_modify = (item.owner == settings.username or \
item.owner == RP_COMMON item.owner == RP_COMMON) and item.state != ERROR
if have_right_to_modify: if have_right_to_modify:
detail_item_box.operator( detail_item_box.operator(
@ -542,7 +543,6 @@ def draw_property(context, parent, property_uuid, level=0):
else: else:
detail_item_box.label(text="", icon="DECORATE_LOCKED") detail_item_box.label(text="", icon="DECORATE_LOCKED")
class SESSION_PT_repository(bpy.types.Panel): class SESSION_PT_repository(bpy.types.Panel):
bl_idname = "MULTIUSER_PROPERTIES_PT_panel" bl_idname = "MULTIUSER_PROPERTIES_PT_panel"
bl_label = "Repository" bl_label = "Repository"