mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
implemented _add_intent_to_context for adding intent to context data
This commit is contained in:
parent
aef9d44f1d
commit
997b11399e
1 changed files with 14 additions and 0 deletions
|
|
@ -563,6 +563,20 @@ class Window(QtWidgets.QDialog):
|
|||
):
|
||||
instance_item.setData(enable_value, Roles.IsEnabledRole)
|
||||
|
||||
def _add_intent_to_context(self):
|
||||
if (
|
||||
self.intent_model.has_items
|
||||
and "intent" not in self.controller.context.data
|
||||
):
|
||||
idx = self.intent_model.index(self.intent_box.currentIndex(), 0)
|
||||
intent_value = self.intent_model.data(idx, Roles.IntentItemValue)
|
||||
intent_label = self.intent_model.data(idx, QtCore.Qt.DisplayRole)
|
||||
|
||||
self.controller.context.data["intent"] = {
|
||||
"value": intent_value,
|
||||
"label": intent_label
|
||||
}
|
||||
|
||||
def on_instance_toggle(self, index, state=None):
|
||||
"""An item is requesting to be toggled"""
|
||||
if not index.data(Roles.IsOptionalRole):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue