mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
store projects on project change to settings
This commit is contained in:
parent
e8bdd1616c
commit
45a6fa1ea5
1 changed files with 10 additions and 0 deletions
|
|
@ -255,6 +255,16 @@ class AssetWidget(QtWidgets.QWidget):
|
|||
project_name = self.combo_projects.currentText()
|
||||
if project_name in projects:
|
||||
self.dbcon.Session["AVALON_PROJECT"] = project_name
|
||||
last_projects = [
|
||||
value
|
||||
for value in self._settings.value("projects", "").split("|")
|
||||
]
|
||||
if project_name in last_projects:
|
||||
last_projects.remove(project_name)
|
||||
last_projects.insert(0, project_name)
|
||||
while len(last_projects) > 5:
|
||||
last_projects.pop(-1)
|
||||
self._settings.setValue("projects", "|".join(last_projects))
|
||||
|
||||
self.project_changed.emit(project_name)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue