def __init__(self, cacheId): '''Instansiate header knob with *cacheId*. *cacheId* is used to retrieve a header that is already created. ''' if cacheId not in HEADER_WIDGET_CACHE: headerWidget = header.Header(getpass.getuser(), parent=None) applyTheme(headerWidget, 'integration') headerWidget.destroyed.connect( functools.partial(handleHeaderDestroyed, cacheId)) HEADER_WIDGET_CACHE[cacheId] = headerWidget self.headerWidget = HEADER_WIDGET_CACHE[cacheId]
def __init__(self, parent=None, connector=None): '''Instantiate info dialog class with *connector*.''' super(FtrackInfoDialog, self).__init__(parent=parent) self.connector = connector self.setMinimumWidth(400) self.setSizePolicy( QtWidgets.QSizePolicy( QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding ) ) self.centralwidget = QtWidgets.QWidget(self) self.verticalMainLayout = QtWidgets.QVBoxLayout(self) self.horizontalLayout = QtWidgets.QHBoxLayout() shotId = os.getenv('FTRACK_SHOTID') taskId = os.getenv('FTRACK_TASKID', shotId) self.headerWidget = header.Header(getpass.getuser(), self) self.verticalMainLayout.addWidget(self.headerWidget) self.infoWidget = WebViewWidget(self.centralwidget) self.horizontalLayout.addWidget(self.infoWidget) self.verticalMainLayout.addLayout(self.horizontalLayout) self.setObjectName('ftrackInfo') self.setWindowTitle('ftrackInfo') self.homeTaskId = taskId self.setObject(taskId) panelComInstance = PanelComInstance.instance() panelComInstance.addInfoListener(self.updateObj)
def __init__(self, parent=None, connector=None): '''Instantiate asset manager dialog with *connector*.''' super(FtrackAssetManagerDialog, self).__init__(parent=parent) applyTheme(self, 'integration') if not connector: raise ValueError( 'Please provide a connector object for {0}'.format( self.__class__.__name__)) self.connector = connector self.setMinimumWidth(400) self.setSizePolicy( QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)) self.centralwidget = QtWidgets.QWidget(self) self.verticalMainLayout = QtWidgets.QVBoxLayout(self) self.verticalMainLayout.setSpacing(6) self.horizontalLayout = QtWidgets.QHBoxLayout() self.headerWidget = header.Header(getpass.getuser(), self) self.verticalMainLayout.addWidget(self.headerWidget) self.assetManagerWidget = AssetManagerWidget(parent=self.centralwidget, connector=self.connector) self.horizontalLayout.addWidget(self.assetManagerWidget) self.verticalMainLayout.addLayout(self.horizontalLayout) self.setObjectName('ftrackAssetManager') self.setWindowTitle('ftrackAssetManager') panelComInstance = PanelComInstance.instance() panelComInstance.addRefreshListener( self.assetManagerWidget.refreshAssetManager)
def __init__(self, parent=None, connector=None, currentEntity=None): if not connector: raise ValueError( 'Please provide a connector object for {0}'.format( self.__class__.__name__ ) ) self.connector = connector if not parent: self.parent = self.connector.getMainWindow() self.currentEntity = currentEntity super(PublishAssetDialog, self).__init__(self.parent) self.setSizePolicy( QtWidgets.QSizePolicy( QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding ) ) applyTheme(self, 'integration') self.assetType = None self.assetName = None self.status = None self.mainLayout = QtWidgets.QVBoxLayout(self) self.mainLayout.setContentsMargins(0, 0, 0, 0) self.mainWidget = QtWidgets.QWidget(self) self.scrollLayout = QtWidgets.QVBoxLayout(self.mainWidget) self.scrollLayout.setSpacing(6) self.scrollArea = QtWidgets.QScrollArea(self) self.mainLayout.addWidget(self.scrollArea) self.scrollArea.setWidgetResizable(True) self.scrollArea.setObjectName("scrollArea") self.scrollArea.setLineWidth(0) self.scrollArea.setFrameShape(QtWidgets.QFrame.NoFrame) self.scrollArea.setHorizontalScrollBarPolicy( QtCore.Qt.ScrollBarAlwaysOff ) self.scrollArea.setWidget(self.mainWidget) self.headerWidget = header.Header(getpass.getuser(), self) self.scrollLayout.addWidget(self.headerWidget) if 'FTRACK_TASKID' in os.environ: self.browseMode = 'Task' else: self.browseMode = 'Shot' self.browseTasksWidget = ContextSelector( currentEntity=self.currentEntity, parent=self ) self.scrollLayout.addWidget(self.browseTasksWidget) self.exportAssetOptionsWidget = ExportAssetOptionsWidget( self, browseMode=self.browseMode ) self.scrollLayout.addWidget(self.exportAssetOptionsWidget) self.exportOptionsWidget = ExportOptionsWidget( self, connector=self.connector ) self.scrollLayout.addWidget(self.exportOptionsWidget) spacerItem = QtWidgets.QSpacerItem( 20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding ) self.scrollLayout.addItem(spacerItem) self.setObjectName('ftrackPublishAsset') self.setWindowTitle("ftrackPublishAsset") panelComInstance = ftrack_connector.panelcom.PanelComInstance.instance() panelComInstance.addSwitchedShotListener(self.reset_context_browser) panelComInstance.addSwitchedShotListener(self.resetOptions) self.exportAssetOptionsWidget.clickedAssetTypeSignal.connect( self.exportOptionsWidget.setStackedWidget ) self.browseTasksWidget.entityChanged.connect( self.exportAssetOptionsWidget.updateView ) self.exportOptionsWidget.ui.publishButton.clicked.connect( self.publishAsset ) panelComInstance.publishProgressSignal.connect( self.exportOptionsWidget.setProgress ) self.browseTasksWidget.reset()
def __init__(self, parent=None, connector=None): '''Instantiate widget with *connector*.''' if not connector: raise ValueError( 'Please provide a connector object for {0}'.format( self.__class__.__name__)) super(FtrackImportAssetDialog, self).__init__(parent=parent) applyTheme(self, 'integration') #---------------------------------------------------------------------------# # Add for proper hou colors try: import hou self.stylesheet = '%s; background-color: #3a3a3a; color: #FFFFFF;' % hou.qt.styleSheet( ) self.setStyleSheet(self.stylesheet) except: pass #---------------------------------------------------------------------------# self.connector = connector self.currentEntity = ftrack.Task( os.getenv('FTRACK_TASKID', os.getenv('FTRACK_SHOTID'))) self.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) self.setMinimumWidth(600) self.mainLayout = QtWidgets.QVBoxLayout(self) self.setLayout(self.mainLayout) self.mainLayout.setContentsMargins(0, 0, 0, 0) self.mainLayout.setSpacing(0) self.scrollArea = QtWidgets.QScrollArea(self) self.mainLayout.addWidget(self.scrollArea) self.scrollArea.setWidgetResizable(True) self.scrollArea.setObjectName("scrollArea") self.scrollArea.setLineWidth(0) self.scrollArea.setFrameShape(QtWidgets.QFrame.NoFrame) self.scrollArea.setHorizontalScrollBarPolicy( QtCore.Qt.ScrollBarAlwaysOff) self.mainWidget = QtWidgets.QWidget(self) self.scrollArea.setWidget(self.mainWidget) self.verticalLayout = QtWidgets.QVBoxLayout() self.mainWidget.setLayout(self.verticalLayout) self.headerWidget = header.Header(getpass.getuser(), self) self.verticalLayout.addWidget(self.headerWidget, stretch=0) self.browseTasksWidget = ContextSelector( currentEntity=self.currentEntity, parent=self) self.verticalLayout.addWidget(self.browseTasksWidget, stretch=0) self.listAssetsTableWidget = ListAssetsTableWidget(self) self.verticalLayout.addWidget(self.listAssetsTableWidget, stretch=4) # Horizontal line self.divider = QtWidgets.QFrame() self.divider.setFrameShape(QtWidgets.QFrame.HLine) self.divider.setFrameShadow(QtWidgets.QFrame.Sunken) self.divider.setLineWidth(2) self.verticalLayout.addWidget(self.divider) self.assetVersionDetailsWidget = AssetVersionDetailsWidget( self, connector=self.connector) self.verticalLayout.addWidget(self.assetVersionDetailsWidget, stretch=0) self.componentTableWidget = ComponentTableWidget( self, connector=self.connector) self.verticalLayout.addWidget(self.componentTableWidget, stretch=3) self.horizontalLayout = QtWidgets.QHBoxLayout() self.verticalLayout.addLayout(self.horizontalLayout) self.importAllButton = QtWidgets.QPushButton("Import All") self.importAllButton.setFixedWidth(120) self.importAllButton.setObjectName('ftrack-import-btn') self.importSelectedButton = QtWidgets.QPushButton("Import Selected") self.importSelectedButton.setFixedWidth(120) self.importAllButton.setObjectName('ftrack-import-btn') self.horizontalLayout.addWidget(self.importSelectedButton) self.horizontalLayout.addWidget(self.importAllButton) self.horizontalLayout.setAlignment(QtCore.Qt.AlignRight) self.importOptionsWidget = ImportOptionsWidget( parent=self, connector=self.connector) self.verticalLayout.addWidget(self.importOptionsWidget, stretch=0) self.messageLabel = QtWidgets.QLabel(self) self.messageLabel.setText(' \n ') self.verticalLayout.addWidget(self.messageLabel, stretch=0) self.setObjectName('ftrackImportAsset') self.setWindowTitle("ftrackImportAsset") panelComInstance = PanelComInstance.instance() panelComInstance.addSwitchedShotListener(self.reset_context_browser) self.browseTasksWidget.entityChanged.connect(self.clickedIdSignal) self.importAllButton.clicked.connect(self.importAllComponents) self.importSelectedButton.clicked.connect( self.importSelectedComponents) self.listAssetsTableWidget.assetVersionSelectedSignal[str].connect( self.clickedAssetVSignal) self.listAssetsTableWidget.assetTypeSelectedSignal[str].connect( self.importOptionsWidget.setStackedWidget) self.importSignal.connect(panelComInstance.refreshListeners) self.componentTableWidget.importComponentSignal.connect( self.onImportComponent) self.browseTasksWidget.reset()