Skip to content

Commit

Permalink
Merge pull request #1 from mottosso/actioncolor
Browse files Browse the repository at this point in the history
Add some flare to action icon
  • Loading branch information
tokejepsen committed Mar 30, 2016
2 parents 9e210ff + dc6fd1b commit d68f6db
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
9 changes: 4 additions & 5 deletions pyblish_qml/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,18 +384,17 @@ def run():
"action": action["id"]
})

if result["success"]:
print "turn green"
else:
print "turn red"

return result

def on_finished(result):
util.echo("Finished, finishing up..")
self.is_running = False
self.acted.emit()

# Inform GUI of success or failure
plugin = self.item_model.plugins[result["plugin"]["id"]]
plugin.actionHasError = not result["success"]

# Allow running action upon action, without resetting
self.result_model.update_with_result(result)
self.info.emit("Success" if result["success"] else "Failed")
Expand Down
1 change: 1 addition & 0 deletions pyblish_qml/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"isToggled": True,
"optional": True,
"hasError": False,
"actionHasError": False,
"succeeded": False,
"processed": False,
"currentProgress": 0,
Expand Down
2 changes: 1 addition & 1 deletion pyblish_qml/qml/List.qml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ ListView {
iconSize: 12
tooltip: "This plug-in has actions"
enabled: object.actionsIcon ? true : false
color: "green"
color: object.actionHasError ? "red" : "green"
},

Action {
Expand Down

0 comments on commit d68f6db

Please sign in to comment.