Added a configuration warning to PaintNodes if they are not a child of a PaintProject.

This commit is contained in:
Relintai 2022-11-15 23:57:44 +01:00
parent 7fa6ff6433
commit bf15088dc7
2 changed files with 18 additions and 0 deletions

View File

@ -25,6 +25,22 @@ PaintProject *PaintNode::get_paint_project() {
return NULL;
}
String PaintNode::get_configuration_warning() const {
const PaintNode *p = this;
while (p) {
const PaintProject *pp = Object::cast_to<PaintProject>(p);
if (pp) {
return "";
}
p = Object::cast_to<PaintNode>(p->get_parent());
}
return "This Node should be a child of a PaintProject!";
}
PaintNode::PaintNode() {
}

View File

@ -16,6 +16,8 @@ public:
PaintProject *get_paint_project();
String get_configuration_warning() const;
PaintNode();
~PaintNode();