mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge pull request #4230 from pypeclub/bugfix/publisher_python_2_signal_type_issues
Publisher: Signal type issues in Python 2 DCCs
This commit is contained in:
commit
4f8d03b2bb
2 changed files with 12 additions and 19 deletions
|
|
@ -35,5 +35,8 @@ __all__ = (
|
|||
"SORT_VALUE_ROLE",
|
||||
"IS_GROUP_ROLE",
|
||||
"CREATOR_IDENTIFIER_ROLE",
|
||||
"FAMILY_ROLE"
|
||||
"CREATOR_THUMBNAIL_ENABLED_ROLE",
|
||||
"FAMILY_ROLE",
|
||||
"GROUP_ROLE",
|
||||
"CONVERTER_IDENTIFIER_ROLE",
|
||||
)
|
||||
|
|
|
|||
|
|
@ -43,24 +43,14 @@ from ..constants import (
|
|||
)
|
||||
|
||||
|
||||
class SelectionType:
|
||||
def __init__(self, name):
|
||||
self.name = name
|
||||
|
||||
def __eq__(self, other):
|
||||
if isinstance(other, SelectionType):
|
||||
other = other.name
|
||||
return self.name == other
|
||||
|
||||
|
||||
class SelectionTypes:
|
||||
clear = SelectionType("clear")
|
||||
extend = SelectionType("extend")
|
||||
extend_to = SelectionType("extend_to")
|
||||
clear = "clear"
|
||||
extend = "extend"
|
||||
extend_to = "extend_to"
|
||||
|
||||
|
||||
class BaseGroupWidget(QtWidgets.QWidget):
|
||||
selected = QtCore.Signal(str, str, SelectionType)
|
||||
selected = QtCore.Signal(str, str, str)
|
||||
removed_selected = QtCore.Signal()
|
||||
|
||||
def __init__(self, group_name, parent):
|
||||
|
|
@ -269,7 +259,7 @@ class InstanceGroupWidget(BaseGroupWidget):
|
|||
class CardWidget(BaseClickableFrame):
|
||||
"""Clickable card used as bigger button."""
|
||||
|
||||
selected = QtCore.Signal(str, str, SelectionType)
|
||||
selected = QtCore.Signal(str, str, str)
|
||||
# Group identifier of card
|
||||
# - this must be set because if send when mouse is released with card id
|
||||
_group_identifier = None
|
||||
|
|
@ -755,11 +745,11 @@ class InstanceCardView(AbstractInstanceView):
|
|||
group_widget = self._widgets_by_group[group_name]
|
||||
new_widget = group_widget.get_widget_by_item_id(instance_id)
|
||||
|
||||
if selection_type is SelectionTypes.clear:
|
||||
if selection_type == SelectionTypes.clear:
|
||||
self._select_item_clear(instance_id, group_name, new_widget)
|
||||
elif selection_type is SelectionTypes.extend:
|
||||
elif selection_type == SelectionTypes.extend:
|
||||
self._select_item_extend(instance_id, group_name, new_widget)
|
||||
elif selection_type is SelectionTypes.extend_to:
|
||||
elif selection_type == SelectionTypes.extend_to:
|
||||
self._select_item_extend_to(instance_id, group_name, new_widget)
|
||||
|
||||
self.selection_changed.emit()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue