mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 21:32:15 +01:00
fixed add asset actions
This commit is contained in:
parent
33bbbf84e7
commit
9767381761
1 changed files with 8 additions and 2 deletions
|
|
@ -412,6 +412,9 @@ class HierarchyView(QtWidgets.QTreeView):
|
|||
|
||||
return self._source_model.add_new_task(parent_index)
|
||||
|
||||
def _add_asset_action(self):
|
||||
self._add_asset_and_edit()
|
||||
|
||||
def _add_asset_and_edit(self, parent_index=None):
|
||||
new_index = self.add_asset(parent_index)
|
||||
if new_index is None:
|
||||
|
|
@ -426,6 +429,9 @@ class HierarchyView(QtWidgets.QTreeView):
|
|||
# Start editing
|
||||
self.edit(new_index)
|
||||
|
||||
def _add_task_action(self):
|
||||
self._add_task_and_edit()
|
||||
|
||||
def _add_task_and_edit(self):
|
||||
new_index = self.add_task()
|
||||
if new_index is None:
|
||||
|
|
@ -577,14 +583,14 @@ class HierarchyView(QtWidgets.QTreeView):
|
|||
if item_type in ("asset", "project"):
|
||||
add_asset_action = QtWidgets.QAction("Add Asset", context_menu)
|
||||
add_asset_action.triggered.connect(
|
||||
self._add_asset_and_edit
|
||||
self._add_asset_action
|
||||
)
|
||||
actions.append(add_asset_action)
|
||||
|
||||
if item_type in ("asset", "task"):
|
||||
add_task_action = QtWidgets.QAction("Add Task", context_menu)
|
||||
add_task_action.triggered.connect(
|
||||
self._add_task_and_edit
|
||||
self._add_task_action
|
||||
)
|
||||
actions.append(add_task_action)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue