Selecting a git revision updates info box

This commit is contained in:
Bruno Postle
2023-05-09 22:15:57 +01:00
parent 2e746242ce
commit 169709ed04
3 changed files with 21 additions and 6 deletions
@@ -45,6 +45,18 @@ class IfcGitListItem(PropertyGroup):
description="does this commit reference our ifc file",
default=False,
)
author_name: StringProperty(
name="Author Name",
default="",
)
author_email: StringProperty(
name="Author Email",
default="",
)
message: StringProperty(
name="Commit Message",
default="",
)
class IfcGitProperties(PropertyGroup):
@@ -119,7 +119,6 @@ class IFCGIT_PT_panel(bpy.types.Panel):
return
item = props.ifcgit_commits[props.commit_index]
commit = IfcGitData.data["commit"]
if not item.relevant:
row = layout.row()
row.label(text="Revision unrelated to current IFC project", icon="ERROR")
@@ -127,11 +126,11 @@ class IFCGIT_PT_panel(bpy.types.Panel):
box = layout.box()
column = box.column(align=True)
row = column.row()
row.label(text=commit.hexsha)
row.label(text=item.hexsha)
row = column.row()
row.label(text=commit.author.name + " <" + commit.author.email + ">")
row.label(text=item.author_name + " <" + item.author_email + ">")
row = column.row()
row.label(text=commit.message)
row.label(text=item.message)
class COMMIT_UL_List(bpy.types.UIList):
+6 -2
View File
@@ -108,9 +108,13 @@ class IfcGit:
continue
props.ifcgit_commits.add()
props.ifcgit_commits[-1].hexsha = commit.hexsha
list_item = props.ifcgit_commits[-1]
list_item.hexsha = commit.hexsha
list_item.message = commit.message
list_item.author_name = commit.author.name
list_item.author_email = commit.author.email
if commit in commits_relevant:
props.ifcgit_commits[-1].relevant = True
list_item.relevant = True
@classmethod
def is_valid_ref_format(cls, string):