From 437bcbe6290ff53c9d13cb628295aabfcafd147d Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 4 Feb 2022 19:05:29 +0100 Subject: [PATCH] Change data only on ApplicationAction classes --- openpype/tools/launcher/models.py | 2 +- openpype/tools/launcher/widgets.py | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/openpype/tools/launcher/models.py b/openpype/tools/launcher/models.py index 6ade9d33ed..1bdaf392e1 100644 --- a/openpype/tools/launcher/models.py +++ b/openpype/tools/launcher/models.py @@ -15,7 +15,7 @@ from .constants import ( from .actions import ApplicationAction from Qt import QtCore, QtGui from avalon.vendor import qtawesome -from avalon import style, api +from avalon import api from openpype.lib import ApplicationManager, JSONSettingRegistry log = logging.getLogger(__name__) diff --git a/openpype/tools/launcher/widgets.py b/openpype/tools/launcher/widgets.py index ba0d9dd6b5..5dad41c349 100644 --- a/openpype/tools/launcher/widgets.py +++ b/openpype/tools/launcher/widgets.py @@ -6,6 +6,7 @@ from avalon.vendor import qtawesome from .delegates import ActionDelegate from . import lib +from .actions import ApplicationAction from .models import ActionModel from openpype.tools.flickcharm import FlickCharm from .constants import ( @@ -239,10 +240,12 @@ class ActionBar(QtWidgets.QWidget): is_variant_group = index.data(VARIANT_GROUP_ROLE) if not is_group and not is_variant_group: action = index.data(ACTION_ROLE) - if index.data(FORCE_NOT_OPEN_WORKFILE_ROLE): - action.data["start_last_workfile"] = False - else: - action.data.pop("start_last_workfile", None) + # Change data of application action + if issubclass(action, ApplicationAction): + if index.data(FORCE_NOT_OPEN_WORKFILE_ROLE): + action.data["start_last_workfile"] = False + else: + action.data.pop("start_last_workfile", None) self._start_animation(index) self.action_clicked.emit(action) return