mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
catch subset changes and pass selection to attributes widget
This commit is contained in:
parent
14ceda2fac
commit
8886117d08
1 changed files with 19 additions and 0 deletions
|
|
@ -112,6 +112,10 @@ class PublisherWindow(QtWidgets.QWidget):
|
|||
validate_btn.clicked.connect(self._on_validate_clicked)
|
||||
publish_btn.clicked.connect(self._on_publish_clicked)
|
||||
|
||||
subset_view.selectionModel().selectionChanged.connect(
|
||||
self._on_subset_change
|
||||
)
|
||||
|
||||
self.main_frame = main_frame
|
||||
|
||||
self.context_label = context_label
|
||||
|
|
@ -196,6 +200,21 @@ class PublisherWindow(QtWidgets.QWidget):
|
|||
def _on_control_reset(self):
|
||||
self._refresh_instances()
|
||||
|
||||
def _on_subset_change(self, *_args):
|
||||
instances = []
|
||||
instances_by_id = {}
|
||||
for instance in self.controller.instances:
|
||||
instance_id = instance.data["uuid"]
|
||||
instances_by_id[instance_id] = instance
|
||||
|
||||
for index in self.subset_view.selectionModel().selectedIndexes():
|
||||
instance_id = index.data(QtCore.Qt.UserRole)
|
||||
instance = instances_by_id.get(instance_id)
|
||||
if instance:
|
||||
instances.append(instance)
|
||||
|
||||
self.subset_attributes_widget.set_current_instances(instances)
|
||||
|
||||
|
||||
def main():
|
||||
"""Main function for testing purposes."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue