diff --git a/build_resources.yml b/build_resources.yml new file mode 100644 index 0000000..260f533 --- /dev/null +++ b/build_resources.yml @@ -0,0 +1,14 @@ +# YAML Configuration File for Qt Resource Building +# +# For more information: +# https://github.com/shotgunsoftware/tk-toolchain?tab=readme-ov-file#tk-build-qt-resources + +- ui_src: resources + ui_files: + - submit_dialog + - batch_render_dialog + - submission_complete_dialog + - submission_failed_dialog + res_files: + - resources + py_dest: python/dialogs/ui diff --git a/python/dialogs/ui/batch_render_dialog.py b/python/dialogs/ui/batch_render_dialog.py index 05d4166..28982f6 100644 --- a/python/dialogs/ui/batch_render_dialog.py +++ b/python/dialogs/ui/batch_render_dialog.py @@ -8,66 +8,64 @@ ## WARNING! All changes made in this file will be lost when recompiling UI file! ################################################################################ -from sgtk.platform.qt import QtCore +from tank.platform.qt import QtCore for name, cls in QtCore.__dict__.items(): if isinstance(cls, type): globals()[name] = cls -from sgtk.platform.qt import QtGui +from tank.platform.qt import QtGui for name, cls in QtGui.__dict__.items(): if isinstance(cls, type): globals()[name] = cls -from . import resources_rc + +from . import resources_rc class Ui_BatchRenderDialog(object): def setupUi(self, BatchRenderDialog): if not BatchRenderDialog.objectName(): - BatchRenderDialog.setObjectName("BatchRenderDialog") + BatchRenderDialog.setObjectName(u"BatchRenderDialog") BatchRenderDialog.resize(352, 398) self.verticalLayout = QVBoxLayout(BatchRenderDialog) - self.verticalLayout.setObjectName("verticalLayout") + self.verticalLayout.setObjectName(u"verticalLayout") self.verticalLayout.setContentsMargins(20, 20, 20, -1) self.label_2 = QLabel(BatchRenderDialog) - self.label_2.setObjectName("label_2") - self.label_2.setPixmap(QPixmap(":/tk-flame-export/batch_render_splash.png")) + self.label_2.setObjectName(u"label_2") + self.label_2.setPixmap(QPixmap(u":/tk-flame-export/batch_render_splash.png")) self.verticalLayout.addWidget(self.label_2) self.comments = QPlainTextEdit(BatchRenderDialog) - self.comments.setObjectName("comments") + self.comments.setObjectName(u"comments") self.comments.setMinimumSize(QSize(300, 100)) self.verticalLayout.addWidget(self.comments) self.horizontalLayout = QHBoxLayout() self.horizontalLayout.setSpacing(4) - self.horizontalLayout.setObjectName("horizontalLayout") + self.horizontalLayout.setObjectName(u"horizontalLayout") self.horizontalSpacer = QSpacerItem(368, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.horizontalLayout.addItem(self.horizontalSpacer) self.cancel = QPushButton(BatchRenderDialog) - self.cancel.setObjectName("cancel") + self.cancel.setObjectName(u"cancel") self.horizontalLayout.addWidget(self.cancel) self.submit = QPushButton(BatchRenderDialog) - self.submit.setObjectName("submit") + self.submit.setObjectName(u"submit") self.horizontalLayout.addWidget(self.submit) - self.verticalLayout.addLayout(self.horizontalLayout) - self.retranslateUi(BatchRenderDialog) QMetaObject.connectSlotsByName(BatchRenderDialog) # setupUi def retranslateUi(self, BatchRenderDialog): - BatchRenderDialog.setWindowTitle(QCoreApplication.translate("BatchRenderDialog", "Submit to Flow Production Tracking", None)) + BatchRenderDialog.setWindowTitle(QCoreApplication.translate("BatchRenderDialog", u"Submit to Flow Production Tracking", None)) self.label_2.setText("") - self.cancel.setText(QCoreApplication.translate("BatchRenderDialog", "Skip", None)) - self.submit.setText(QCoreApplication.translate("BatchRenderDialog", "Send to Flow Production Tracking Review", None)) + self.cancel.setText(QCoreApplication.translate("BatchRenderDialog", u"Skip", None)) + self.submit.setText(QCoreApplication.translate("BatchRenderDialog", u"Send to Flow Production Tracking Review", None)) # retranslateUi - diff --git a/python/dialogs/ui/resources_rc.py b/python/dialogs/ui/resources_rc.py index 5335176..beadaba 100644 --- a/python/dialogs/ui/resources_rc.py +++ b/python/dialogs/ui/resources_rc.py @@ -1,9 +1,9 @@ # Resource object code (Python 3) # Created by: object code -# Created by: The Resource Compiler for Qt version 5.15.16 +# Created by: The Resource Compiler for Qt version 5.15.2 # WARNING! All changes made in this file will be lost! -from sgtk.platform.qt import QtCore +from tank.platform.qt import QtCore qt_resource_data = b"\ \x00\x00y\x87\ @@ -3467,13 +3467,13 @@ \x00\x00\x00\x00\x00\x02\x00\x00\x00\x04\x00\x00\x00\x02\ \x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00D\x00\x00\x00\x00\x00\x01\x00\x00y\x8b\ -\x00\x00\x01\x8e\x80\xedc\xc6\ +\x00\x00\x01\x92\xe3\xd2-D\ \x00\x00\x00\x94\x00\x00\x00\x00\x00\x01\x00\x00\xc8b\ -\x00\x00\x01\x8e\x80\xec!\xd5\ +\x00\x00\x01\x92\xe3\xd2-a\ \x00\x00\x00x\x00\x00\x00\x00\x00\x01\x00\x00\xba\x1f\ -\x00\x00\x01\x8e\x80\xec!\xd0\ +\x00\x00\x01\x92\xe3\xd2-G\ \x00\x00\x00$\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ -\x00\x00\x01\x8e\x80\xec!\xd5\ +\x00\x00\x01\x92\xe3\xd2-b\ " def qInitResources(): diff --git a/python/dialogs/ui/submission_complete_dialog.py b/python/dialogs/ui/submission_complete_dialog.py index 6152950..de5800b 100644 --- a/python/dialogs/ui/submission_complete_dialog.py +++ b/python/dialogs/ui/submission_complete_dialog.py @@ -8,49 +8,50 @@ ## WARNING! All changes made in this file will be lost when recompiling UI file! ################################################################################ -from sgtk.platform.qt import QtCore +from tank.platform.qt import QtCore for name, cls in QtCore.__dict__.items(): if isinstance(cls, type): globals()[name] = cls -from sgtk.platform.qt import QtGui +from tank.platform.qt import QtGui for name, cls in QtGui.__dict__.items(): if isinstance(cls, type): globals()[name] = cls -from . import resources_rc + +from . import resources_rc class Ui_SubmissionCompleteDialog(object): def setupUi(self, SubmissionCompleteDialog): if not SubmissionCompleteDialog.objectName(): - SubmissionCompleteDialog.setObjectName("SubmissionCompleteDialog") + SubmissionCompleteDialog.setObjectName(u"SubmissionCompleteDialog") SubmissionCompleteDialog.resize(569, 237) self.verticalLayout = QVBoxLayout(SubmissionCompleteDialog) - self.verticalLayout.setObjectName("verticalLayout") + self.verticalLayout.setObjectName(u"verticalLayout") self.verticalLayout.setContentsMargins(20, -1, 20, -1) self.horizontalLayout_3 = QHBoxLayout() - self.horizontalLayout_3.setObjectName("horizontalLayout_3") + self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") self.label = QLabel(SubmissionCompleteDialog) - self.label.setObjectName("label") + self.label.setObjectName(u"label") sizePolicy = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth()) self.label.setSizePolicy(sizePolicy) - self.label.setPixmap(QPixmap(":/tk-flame-export/success.png")) + self.label.setPixmap(QPixmap(u":/tk-flame-export/success.png")) self.label.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignTop) self.horizontalLayout_3.addWidget(self.label) self.verticalLayout_2 = QVBoxLayout() - self.verticalLayout_2.setObjectName("verticalLayout_2") + self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.label_3 = QLabel(SubmissionCompleteDialog) - self.label_3.setObjectName("label_3") - self.label_3.setStyleSheet("QLabel { font-size: 18px; }") + self.label_3.setObjectName(u"label_3") + self.label_3.setStyleSheet(u"QLabel { font-size: 18px; }") self.label_3.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignTop) self.verticalLayout_2.addWidget(self.label_3) self.status = QLabel(SubmissionCompleteDialog) - self.status.setObjectName("status") + self.status.setObjectName(u"status") sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.MinimumExpanding) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) @@ -61,37 +62,32 @@ def setupUi(self, SubmissionCompleteDialog): self.verticalLayout_2.addWidget(self.status) - self.horizontalLayout_3.addLayout(self.verticalLayout_2) - self.verticalLayout.addLayout(self.horizontalLayout_3) self.horizontalLayout = QHBoxLayout() - self.horizontalLayout.setObjectName("horizontalLayout") + self.horizontalLayout.setObjectName(u"horizontalLayout") self.horizontalSpacer = QSpacerItem(368, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.horizontalLayout.addItem(self.horizontalSpacer) self.submit = QPushButton(SubmissionCompleteDialog) - self.submit.setObjectName("submit") + self.submit.setObjectName(u"submit") self.horizontalLayout.addWidget(self.submit) - self.verticalLayout.addLayout(self.horizontalLayout) - self.retranslateUi(SubmissionCompleteDialog) QMetaObject.connectSlotsByName(SubmissionCompleteDialog) # setupUi def retranslateUi(self, SubmissionCompleteDialog): - SubmissionCompleteDialog.setWindowTitle(QCoreApplication.translate("SubmissionCompleteDialog", "Flow Production Tracking Submission Complete", None)) + SubmissionCompleteDialog.setWindowTitle(QCoreApplication.translate("SubmissionCompleteDialog", u"Flow Production Tracking Submission Complete", None)) self.label.setText("") - self.label_3.setText(QCoreApplication.translate("SubmissionCompleteDialog", "Submission Complete!", None)) - self.status.setText(QCoreApplication.translate("SubmissionCompleteDialog", "TextLabel", None)) - self.submit.setText(QCoreApplication.translate("SubmissionCompleteDialog", "Ok", None)) + self.label_3.setText(QCoreApplication.translate("SubmissionCompleteDialog", u"Submission Complete!", None)) + self.status.setText(QCoreApplication.translate("SubmissionCompleteDialog", u"TextLabel", None)) + self.submit.setText(QCoreApplication.translate("SubmissionCompleteDialog", u"Ok", None)) # retranslateUi - diff --git a/python/dialogs/ui/submission_failed_dialog.py b/python/dialogs/ui/submission_failed_dialog.py index 33431cc..970690f 100644 --- a/python/dialogs/ui/submission_failed_dialog.py +++ b/python/dialogs/ui/submission_failed_dialog.py @@ -8,48 +8,49 @@ ## WARNING! All changes made in this file will be lost when recompiling UI file! ################################################################################ -from sgtk.platform.qt import QtCore +from tank.platform.qt import QtCore for name, cls in QtCore.__dict__.items(): if isinstance(cls, type): globals()[name] = cls -from sgtk.platform.qt import QtGui +from tank.platform.qt import QtGui for name, cls in QtGui.__dict__.items(): if isinstance(cls, type): globals()[name] = cls -from . import resources_rc + +from . import resources_rc class Ui_SubmissionFailedDialog(object): def setupUi(self, SubmissionFailedDialog): if not SubmissionFailedDialog.objectName(): - SubmissionFailedDialog.setObjectName("SubmissionFailedDialog") + SubmissionFailedDialog.setObjectName(u"SubmissionFailedDialog") SubmissionFailedDialog.resize(491, 204) self.verticalLayout = QVBoxLayout(SubmissionFailedDialog) - self.verticalLayout.setObjectName("verticalLayout") + self.verticalLayout.setObjectName(u"verticalLayout") self.verticalLayout.setContentsMargins(20, -1, 20, -1) self.horizontalLayout_3 = QHBoxLayout() - self.horizontalLayout_3.setObjectName("horizontalLayout_3") + self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") self.label_2 = QLabel(SubmissionFailedDialog) - self.label_2.setObjectName("label_2") + self.label_2.setObjectName(u"label_2") sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth()) self.label_2.setSizePolicy(sizePolicy) - self.label_2.setPixmap(QPixmap(":/tk-flame-export/failure.png")) + self.label_2.setPixmap(QPixmap(u":/tk-flame-export/failure.png")) self.horizontalLayout_3.addWidget(self.label_2) self.verticalLayout_3 = QVBoxLayout() - self.verticalLayout_3.setObjectName("verticalLayout_3") + self.verticalLayout_3.setObjectName(u"verticalLayout_3") self.label_3 = QLabel(SubmissionFailedDialog) - self.label_3.setObjectName("label_3") - self.label_3.setStyleSheet("QLabel { font-size: 18px; }") + self.label_3.setObjectName(u"label_3") + self.label_3.setStyleSheet(u"QLabel { font-size: 18px; }") self.label_3.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignTop) self.verticalLayout_3.addWidget(self.label_3) self.status = QLabel(SubmissionFailedDialog) - self.status.setObjectName("status") + self.status.setObjectName(u"status") sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.MinimumExpanding) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) @@ -61,37 +62,32 @@ def setupUi(self, SubmissionFailedDialog): self.verticalLayout_3.addWidget(self.status) - self.horizontalLayout_3.addLayout(self.verticalLayout_3) - self.verticalLayout.addLayout(self.horizontalLayout_3) self.horizontalLayout = QHBoxLayout() - self.horizontalLayout.setObjectName("horizontalLayout") + self.horizontalLayout.setObjectName(u"horizontalLayout") self.horizontalSpacer = QSpacerItem(368, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.horizontalLayout.addItem(self.horizontalSpacer) self.submit = QPushButton(SubmissionFailedDialog) - self.submit.setObjectName("submit") + self.submit.setObjectName(u"submit") self.horizontalLayout.addWidget(self.submit) - self.verticalLayout.addLayout(self.horizontalLayout) - self.retranslateUi(SubmissionFailedDialog) QMetaObject.connectSlotsByName(SubmissionFailedDialog) # setupUi def retranslateUi(self, SubmissionFailedDialog): - SubmissionFailedDialog.setWindowTitle(QCoreApplication.translate("SubmissionFailedDialog", "Flow Production Tracking Submission Failed", None)) + SubmissionFailedDialog.setWindowTitle(QCoreApplication.translate("SubmissionFailedDialog", u"Flow Production Tracking Submission Failed", None)) self.label_2.setText("") - self.label_3.setText(QCoreApplication.translate("SubmissionFailedDialog", "Something went wrong!", None)) + self.label_3.setText(QCoreApplication.translate("SubmissionFailedDialog", u"Something went wrong!", None)) self.status.setText("") - self.submit.setText(QCoreApplication.translate("SubmissionFailedDialog", "Ok", None)) + self.submit.setText(QCoreApplication.translate("SubmissionFailedDialog", u"Ok", None)) # retranslateUi - diff --git a/python/dialogs/ui/submit_dialog.py b/python/dialogs/ui/submit_dialog.py index 702458d..e96ba29 100644 --- a/python/dialogs/ui/submit_dialog.py +++ b/python/dialogs/ui/submit_dialog.py @@ -8,44 +8,45 @@ ## WARNING! All changes made in this file will be lost when recompiling UI file! ################################################################################ -from sgtk.platform.qt import QtCore +from tank.platform.qt import QtCore for name, cls in QtCore.__dict__.items(): if isinstance(cls, type): globals()[name] = cls -from sgtk.platform.qt import QtGui +from tank.platform.qt import QtGui for name, cls in QtGui.__dict__.items(): if isinstance(cls, type): globals()[name] = cls -from . import resources_rc + +from . import resources_rc class Ui_SubmitDialog(object): def setupUi(self, SubmitDialog): if not SubmitDialog.objectName(): - SubmitDialog.setObjectName("SubmitDialog") + SubmitDialog.setObjectName(u"SubmitDialog") SubmitDialog.resize(487, 577) self.verticalLayout = QVBoxLayout(SubmitDialog) - self.verticalLayout.setObjectName("verticalLayout") + self.verticalLayout.setObjectName(u"verticalLayout") self.label_2 = QLabel(SubmitDialog) - self.label_2.setObjectName("label_2") - self.label_2.setPixmap(QPixmap(":/tk-flame-export/ui_splash.png")) + self.label_2.setObjectName(u"label_2") + self.label_2.setPixmap(QPixmap(u":/tk-flame-export/ui_splash.png")) self.verticalLayout.addWidget(self.label_2) self.comments = QPlainTextEdit(SubmitDialog) - self.comments.setObjectName("comments") + self.comments.setObjectName(u"comments") self.comments.setMinimumSize(QSize(300, 100)) self.verticalLayout.addWidget(self.comments) self.horizontalLayout_2 = QHBoxLayout() - self.horizontalLayout_2.setObjectName("horizontalLayout_2") + self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") self.label = QLabel(SubmitDialog) - self.label.setObjectName("label") + self.label.setObjectName(u"label") self.horizontalLayout_2.addWidget(self.label) self.export_presets = QComboBox(SubmitDialog) - self.export_presets.setObjectName("export_presets") + self.export_presets.setObjectName(u"export_presets") sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) @@ -54,39 +55,35 @@ def setupUi(self, SubmitDialog): self.horizontalLayout_2.addWidget(self.export_presets) - self.verticalLayout.addLayout(self.horizontalLayout_2) self.horizontalLayout = QHBoxLayout() - self.horizontalLayout.setObjectName("horizontalLayout") + self.horizontalLayout.setObjectName(u"horizontalLayout") self.horizontalSpacer = QSpacerItem(368, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.horizontalLayout.addItem(self.horizontalSpacer) self.cancel = QPushButton(SubmitDialog) - self.cancel.setObjectName("cancel") + self.cancel.setObjectName(u"cancel") self.horizontalLayout.addWidget(self.cancel) self.submit = QPushButton(SubmitDialog) - self.submit.setObjectName("submit") + self.submit.setObjectName(u"submit") self.horizontalLayout.addWidget(self.submit) - self.verticalLayout.addLayout(self.horizontalLayout) - self.retranslateUi(SubmitDialog) QMetaObject.connectSlotsByName(SubmitDialog) # setupUi def retranslateUi(self, SubmitDialog): - SubmitDialog.setWindowTitle(QCoreApplication.translate("SubmitDialog", "Submit to Flow Production Tracking", None)) + SubmitDialog.setWindowTitle(QCoreApplication.translate("SubmitDialog", u"Submit to Flow Production Tracking", None)) self.label_2.setText("") - self.label.setText(QCoreApplication.translate("SubmitDialog", "Use Export Preset", None)) - self.cancel.setText(QCoreApplication.translate("SubmitDialog", "Cancel", None)) - self.submit.setText(QCoreApplication.translate("SubmitDialog", "Submit to Flow Production Tracking", None)) + self.label.setText(QCoreApplication.translate("SubmitDialog", u"Use Export Preset", None)) + self.cancel.setText(QCoreApplication.translate("SubmitDialog", u"Cancel", None)) + self.submit.setText(QCoreApplication.translate("SubmitDialog", u"Submit to Flow Production Tracking", None)) # retranslateUi - diff --git a/resources/build_resources.sh b/resources/build_resources.sh deleted file mode 100755 index e454790..0000000 --- a/resources/build_resources.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright (c) 2021 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. - -# The path to output all built .py files to: -UI_PYTHON_PATH=../python/dialogs/ui - - -# Helper functions to build UI files -function build_qt { - echo " > Building " $2 - - # compile ui to python - echo "$1 $2 > $UI_PYTHON_PATH/$3.py" - $1 $2 > $UI_PYTHON_PATH/$3.py - - # replace PySide imports with sgtk.platform.qt and remove line containing Created by date - sed -i"" -E "s/^(from PySide.\.QtWidgets)(.*)$//g" $UI_PYTHON_PATH/$3.py - sed -i"" -E "s/^(from PySide.\.)(\w*)(.*)$/from sgtk.platform.qt import \2\nfor name, cls in \2.__dict__.items():\n if isinstance(cls, type): globals()[name] = cls\n/g" $UI_PYTHON_PATH/$3.py - sed -i"" -E "s/^(from PySide. import)(.*)$/from sgtk.platform.qt import\2/g" $UI_PYTHON_PATH/$3.py - - sed -i"" -E 's/u\"/\"/g' $UI_PYTHON_PATH/$3.py -} - -function build_ui { - ver=$($1 --version | cut -d' ' -f2 | cut -d. -f1) - gt6=$(echo "$ver >= 6" | /usr/bin/bc) - if [ "1" -eq "$gt6" ] ; then - # running > Qt6 - build_qt "$1 -g python --from-imports --star-imports" "$2.ui" "$2" - else - # running < Qt6 - build_qt "$1 -g python --from-imports" "$2.ui" "$2" - fi -} - -function build_res { - build_qt "$1 -g python" "$2.qrc" "$2_rc" -} - - -while getopts u:r: flag -do - case "${flag}" in - u) uic=${OPTARG};; - r) rcc=${OPTARG};; - esac -done - -if [ -z "$uic" ]; then - echo "the PySide uic compiler must be specified with the -u parameter" - exit 1 -fi - -if [ -z "$rcc" ]; then - echo "the PySide rcc compiler must be specified with the -r parameter" - exit 1 -fi - -uicversion=$(${uic} --version) -rccversion=$(${rcc} --version) - - -if [ -z "$uicversion" ]; then - echo "the PySide uic compiler version cannot be determined" - exit 1 -fi - -if [ -z "$rccversion" ]; then - echo "the PySide rcc compiler version cannot be determined" - exit 1 -fi - -echo "Using PySide uic compiler version: ${uicversion}" -echo "Using PySide rcc compiler version: ${rccversion}" - -# build UI's: -echo "building user interfaces..." -build_ui $uic submit_dialog -build_ui $uic batch_render_dialog -build_ui $uic submission_complete_dialog -build_ui $uic submission_failed_dialog - -# build resources -echo "building resources..." -build_res $rcc resources