Skip to content

Commit

Permalink
Merge pull request pyblish#42 from pypeclub/bugfix/toggleable_instanc…
Browse files Browse the repository at this point in the history
…es_on_collect

bugfix/toggleable_instances_on_collect
  • Loading branch information
mkolar authored Jan 28, 2020
2 parents 009032d + bd112ec commit e93b96e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pyblish_lite/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,11 @@ def update_instances(self):
for idx in reversed(remove_indexes):
self.items.pop(idx)

for item in self.items:
item.data["_is_idle"] = True
item.data["_has_succeeded"] = False
item.data["_has_processed"] = False

def data(self, index, role):
# This is because of bug without known cause
# - on "reset" are called data for already removed indexes
Expand Down
6 changes: 6 additions & 0 deletions pyblish_lite/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,12 @@ def on_was_validated(self):
failed = True

for index in instance_model:
if (
not index.data(model.HasFailed) and
not index.data(model.HasSucceeded)
):
index.model().setData(index, True, model.HasSucceeded)

index.model().setData(index, False, model.IsIdle)

buttons = self.data["buttons"]
Expand Down

0 comments on commit e93b96e

Please sign in to comment.