Merge pull request #2040 from pypeclub/bugfix/workfile_toole_task_selection

Workfiles tool: Task selection
This commit is contained in:
Jakub Trllo 2021-09-17 15:17:03 +02:00 committed by GitHub
commit a457faa2a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View file

@ -64,7 +64,7 @@ def is_running_staging():
Returns:
bool: True if openpype version containt 'staging'.
"""
if "staging" in get_pype_version():
if "staging" in get_openpype_version():
return True
return False

View file

@ -376,6 +376,9 @@ class TasksWidget(QtWidgets.QWidget):
task (str): Name of the task to select.
"""
task_view_model = self._tasks_view.model()
if not task_view_model:
return
# Clear selection
selection_model = self._tasks_view.selectionModel()
@ -383,8 +386,8 @@ class TasksWidget(QtWidgets.QWidget):
# Select the task
mode = selection_model.Select | selection_model.Rows
for row in range(self._tasks_model.rowCount()):
index = self._tasks_model.index(row, 0)
for row in range(task_view_model.rowCount()):
index = task_view_model.index(row, 0)
name = index.data(TASK_NAME_ROLE)
if name == task_name:
selection_model.select(index, mode)