From 9e9e49f18c9e554286c206234355f4c3ab4ac25a Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 18 Nov 2021 14:38:33 +0100 Subject: [PATCH] use get_main_window to fill parent for tools --- openpype/hosts/hiero/api/menu.py | 18 ++++++++++++++---- openpype/hosts/hiero/api/pipeline.py | 4 +++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/openpype/hosts/hiero/api/menu.py b/openpype/hosts/hiero/api/menu.py index e3de220777..61b515d719 100644 --- a/openpype/hosts/hiero/api/menu.py +++ b/openpype/hosts/hiero/api/menu.py @@ -37,12 +37,16 @@ def menu_install(): Installing menu into Hiero """ + from Qt import QtGui from . import ( publish, launch_workfiles_app, reload_config, apply_colorspace_project, apply_colorspace_clips ) + from .lib import get_main_window + + main_window = get_main_window() + # here is the best place to add menu - from avalon.vendor.Qt import QtGui menu_name = os.environ['AVALON_LABEL'] @@ -86,15 +90,21 @@ def menu_install(): creator_action = menu.addAction("Create ...") creator_action.setIcon(QtGui.QIcon("icons:CopyRectangle.png")) - creator_action.triggered.connect(host_tools.show_creator) + creator_action.triggered.connect( + lambda: host_tools.show_creator(parent=main_window) + ) loader_action = menu.addAction("Load ...") loader_action.setIcon(QtGui.QIcon("icons:CopyRectangle.png")) - loader_action.triggered.connect(host_tools.show_loader) + loader_action.triggered.connect( + lambda: host_tools.show_loader(parent=main_window) + ) sceneinventory_action = menu.addAction("Manage ...") sceneinventory_action.setIcon(QtGui.QIcon("icons:CopyRectangle.png")) - sceneinventory_action.triggered.connect(host_tools.show_scene_inventory) + sceneinventory_action.triggered.connect( + lambda: host_tools.show_scene_inventory(parent=main_window) + ) menu.addSeparator() if os.getenv("OPENPYPE_DEVELOP"): diff --git a/openpype/hosts/hiero/api/pipeline.py b/openpype/hosts/hiero/api/pipeline.py index 6f6588e1be..d52cb68ba7 100644 --- a/openpype/hosts/hiero/api/pipeline.py +++ b/openpype/hosts/hiero/api/pipeline.py @@ -209,9 +209,11 @@ def update_container(track_item, data=None): def launch_workfiles_app(*args): ''' Wrapping function for workfiles launcher ''' + from .lib import get_main_window + main_window = get_main_window() # show workfile gui - host_tools.show_workfiles() + host_tools.show_workfiles(parent=main_window) def publish(parent):