mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
change "start_last_workfile" when triggered from group
This commit is contained in:
parent
42f575fca9
commit
98c065cb8b
1 changed files with 14 additions and 5 deletions
|
|
@ -312,11 +312,12 @@ class ActionBar(QtWidgets.QWidget):
|
||||||
|
|
||||||
is_group = index.data(GROUP_ROLE)
|
is_group = index.data(GROUP_ROLE)
|
||||||
is_variant_group = index.data(VARIANT_GROUP_ROLE)
|
is_variant_group = index.data(VARIANT_GROUP_ROLE)
|
||||||
|
force_not_open_workfile = index.data(FORCE_NOT_OPEN_WORKFILE_ROLE)
|
||||||
if not is_group and not is_variant_group:
|
if not is_group and not is_variant_group:
|
||||||
action = index.data(ACTION_ROLE)
|
action = index.data(ACTION_ROLE)
|
||||||
# Change data of application action
|
# Change data of application action
|
||||||
if issubclass(action, ApplicationAction):
|
if issubclass(action, ApplicationAction):
|
||||||
if index.data(FORCE_NOT_OPEN_WORKFILE_ROLE):
|
if force_not_open_workfile:
|
||||||
action.data["start_last_workfile"] = False
|
action.data["start_last_workfile"] = False
|
||||||
else:
|
else:
|
||||||
action.data.pop("start_last_workfile", None)
|
action.data.pop("start_last_workfile", None)
|
||||||
|
|
@ -385,10 +386,18 @@ class ActionBar(QtWidgets.QWidget):
|
||||||
menu.addMenu(sub_menu)
|
menu.addMenu(sub_menu)
|
||||||
|
|
||||||
result = menu.exec_(QtGui.QCursor.pos())
|
result = menu.exec_(QtGui.QCursor.pos())
|
||||||
if result:
|
if not result:
|
||||||
action = actions_mapping[result]
|
return
|
||||||
self._start_animation(index)
|
|
||||||
self.action_clicked.emit(action)
|
action = actions_mapping[result]
|
||||||
|
if issubclass(action, ApplicationAction):
|
||||||
|
if force_not_open_workfile:
|
||||||
|
action.data["start_last_workfile"] = False
|
||||||
|
else:
|
||||||
|
action.data.pop("start_last_workfile", None)
|
||||||
|
|
||||||
|
self._start_animation(index)
|
||||||
|
self.action_clicked.emit(action)
|
||||||
|
|
||||||
|
|
||||||
class ActionHistory(QtWidgets.QPushButton):
|
class ActionHistory(QtWidgets.QPushButton):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue