mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 15:08:51 +00:00
Recent files - dim button for filepaths that do not exist
Example - https://i.imgur.com/dwEBtG6.png
This commit is contained in:
@@ -54,16 +54,19 @@ class BIM_MT_recent_projects(Menu):
|
|||||||
bl_label = "Open Recent IFC Project"
|
bl_label = "Open Recent IFC Project"
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
|
layout = self.layout
|
||||||
paths = tool.Project.get_recent_ifc_projects()
|
paths = tool.Project.get_recent_ifc_projects()
|
||||||
if not paths:
|
if not paths:
|
||||||
self.layout.label(text="No Recent IFC Projects")
|
self.layout.label(text="No Recent IFC Projects")
|
||||||
return
|
return
|
||||||
|
|
||||||
for path in paths:
|
for path in paths:
|
||||||
op = self.layout.operator("bim.load_project", text=path.name, icon_value=bonsai.bim.icons["IFC"].icon_id)
|
row = layout.row()
|
||||||
|
op = row.operator("bim.load_project", text=path.name, icon_value=bonsai.bim.icons["IFC"].icon_id)
|
||||||
op.filepath = str(path)
|
op.filepath = str(path)
|
||||||
op.should_start_fresh_session = True
|
op.should_start_fresh_session = True
|
||||||
op.use_detailed_tooltip = True
|
op.use_detailed_tooltip = True
|
||||||
|
row.enabled = path.is_file()
|
||||||
|
|
||||||
self.layout.separator()
|
self.layout.separator()
|
||||||
self.layout.operator("bim.clear_recent_ifc_projects", icon="TRASH")
|
self.layout.operator("bim.clear_recent_ifc_projects", icon="TRASH")
|
||||||
|
|||||||
Reference in New Issue
Block a user