forked from shotgunsoftware/tk-multi-loader2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
59 lines (44 loc) · 1.86 KB
/
Copy path__init__.py
File metadata and controls
59 lines (44 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Copyright (c) 2015 Shotgun Software Inc.
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
# Source Code License included in this distribution package. See LICENSE.
# By accessing, using, copying or modifying this work you indicate your
# agreement to the Shotgun Pipeline Toolkit Source Code License. All rights
# not expressly granted therein are reserved by Shotgun Software Inc.
from .api import LoaderManager
from .open_publish_form import open_publish_browser
import sgtk
from sgtk.platform.qt import QtCore, QtGui
from .ui import resources_rc
help_screen = sgtk.platform.import_framework("tk-framework-qtwidgets", "help_screen")
def show_dialog(app):
"""
Show the main loader dialog
:param app: The parent App
"""
# defer imports so that the app works gracefully in batch modes
from .dialog import AppDialog
# Create and display the splash screen
splash_pix = QtGui.QPixmap(":/res/splash.png")
splash = QtGui.QSplashScreen(splash_pix, QtCore.Qt.WindowStaysOnTopHint)
splash.setMask(splash_pix.mask())
splash.show()
QtCore.QCoreApplication.processEvents()
# create the action manager for the Loader UI:
from .loader_action_manager import LoaderActionManager
action_manager = LoaderActionManager()
# start ui
ui_title = app.get_setting("title_name")
w = app.engine.show_dialog(ui_title, app, AppDialog, action_manager)
# Keep pointer to dialog so as to be able to hide/show it in actions
engine_name = app.engine.instance_name
# attach splash screen to the main window to help GC
w.__splash_screen = splash
# hide splash screen after loader UI show
splash.finish(w.window())
# pop up help screen
if w.is_first_launch():
# wait a bit before show window
QtCore.QTimer.singleShot(1400, w.show_help_popup)