mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 08:54:53 +01:00
added base of item validations
This commit is contained in:
parent
964f7b2b29
commit
ad50d5b38d
1 changed files with 13 additions and 0 deletions
|
|
@ -843,6 +843,15 @@ class HierarchyModel(QtCore.QAbstractItemModel):
|
|||
self.endResetModel()
|
||||
|
||||
def save(self):
|
||||
all_valid = True
|
||||
for item in self._items_by_id.values():
|
||||
if not item.is_valid:
|
||||
all_valid = False
|
||||
break
|
||||
|
||||
if not all_valid:
|
||||
return
|
||||
|
||||
project_item = None
|
||||
for _project_item in self._root_item.children():
|
||||
project_item = _project_item
|
||||
|
|
@ -919,6 +928,10 @@ class BaseItem:
|
|||
def name_icon(cls):
|
||||
return cls._name_icon
|
||||
|
||||
@property
|
||||
def is_valid(self):
|
||||
return not self._is_duplicated
|
||||
|
||||
def model(self):
|
||||
return self._parent.model
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue