getavalon / core

The safe post-production pipeline - https://getavalon.github.io/2.0
MIT License
214 stars 48 forks source link

Fix context manager allowing to switch to 'No Task' #451

Closed BigRoy closed 4 years ago

BigRoy commented 4 years ago

Issue

It's possible to have the Context Manager switch the AVALON_TASK to "No Task" whereas it should disallow that entry to be active task.

Reported here

What's changed?

Previously the selected task was retrieved from the view as the view.currentIndex() however that also allows non-selectable items to be active and returned. Now this is updated to solely using the actually selected rows from the view to ensure the Task is selected and not just the current.

This way you cannot switch to the Task, because the "No Task" item is unselectable in the model.

BigRoy commented 4 years ago

This could also be adapted to disabling the "set context" button altogether when there's no selected asset or task. Will adapt this PR.

BigRoy commented 4 years ago

Added the enable/disabled state toggle for the Apply button with https://github.com/getavalon/core/pull/451/commits/2620c2909a4943381e0a3f1c9aa99dc7f96be16b

Example:

contextmanager_enable_disable_apply_btn

mottosso commented 4 years ago

Great work. Nice and concise. Merge when happy. 👍