mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
Merge pull request #798 from pypeclub/bugfix/launcher_actions_update
Launcher actions update
This commit is contained in:
commit
8aa5b1362d
2 changed files with 6 additions and 7 deletions
|
|
@ -129,10 +129,6 @@ class ActionModel(QtGui.QStandardItemModel):
|
|||
|
||||
def discover(self):
|
||||
"""Set up Actions cache. Run this for each new project."""
|
||||
if not self.dbcon.Session.get("AVALON_PROJECT"):
|
||||
self._registered_actions = list()
|
||||
return
|
||||
|
||||
# Discover all registered actions
|
||||
actions = api.discover(api.Action)
|
||||
|
||||
|
|
@ -144,6 +140,9 @@ class ActionModel(QtGui.QStandardItemModel):
|
|||
|
||||
def get_application_actions(self):
|
||||
actions = []
|
||||
if not self.dbcon.Session.get("AVALON_PROJECT"):
|
||||
return actions
|
||||
|
||||
project_doc = self.dbcon.find_one({"type": "project"})
|
||||
if not project_doc:
|
||||
return actions
|
||||
|
|
@ -185,6 +184,8 @@ class ActionModel(QtGui.QStandardItemModel):
|
|||
|
||||
self._groups.clear()
|
||||
|
||||
self.discover()
|
||||
|
||||
actions = self.filter_compatible_actions(self._registered_actions)
|
||||
|
||||
self.beginResetModel()
|
||||
|
|
|
|||
|
|
@ -186,6 +186,7 @@ class AssetsPanel(QtWidgets.QWidget):
|
|||
# signals
|
||||
project_bar.project_changed.connect(self.on_project_changed)
|
||||
assets_widget.selection_changed.connect(self.on_asset_changed)
|
||||
assets_widget.refreshed.connect(self.on_asset_changed)
|
||||
btn_back.clicked.connect(self.back_clicked)
|
||||
|
||||
# Force initial refresh for the assets since we might not be
|
||||
|
|
@ -206,9 +207,6 @@ class AssetsPanel(QtWidgets.QWidget):
|
|||
self.dbcon.Session["AVALON_PROJECT"] = project_name
|
||||
self.assets_widget.refresh()
|
||||
|
||||
# Force asset change callback to ensure tasks are correctly reset
|
||||
self.assets_widget.refreshed.connect(self.on_asset_changed)
|
||||
|
||||
def on_asset_changed(self):
|
||||
"""Callback on asset selection changed
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue