disable adding cost schedule columns with an empty name

example - https://i.imgur.com/5lGdI2X.png
This commit is contained in:
Andrej730
2024-05-24 18:53:22 +05:00
parent 6a8b59f2cf
commit 59a19a1a70
@@ -533,6 +533,13 @@ class AddCostColumn(bpy.types.Operator):
bl_options = {"REGISTER", "UNDO"}
name: bpy.props.StringProperty()
@classmethod
def poll(cls, context):
if not context.scene.BIMCostProperties.cost_column:
cls.poll_message_set("Cost column name is empty")
return False
return True
def execute(self, context):
core.add_cost_column(tool.Cost, self.name)
return {"FINISHED"}