Example #1
0
    def __init__(self, parent=None, connector=None):
        ''''Initialize dialog with *parent* and *connector* instance.'''
        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()
        super(FtrackTasksDialog, self).__init__(self.parent)
        applyTheme(self, 'integration')
        self.setSizePolicy(
            QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                  QtWidgets.QSizePolicy.Expanding))
        self.setMinimumWidth(500)
        self.centralwidget = QtWidgets.QWidget(self)
        self.verticalMainLayout = QtWidgets.QVBoxLayout(self)
        self.horizontalLayout = QtWidgets.QHBoxLayout()

        self.headerWidget = Header(getpass.getuser(), self)
        self.headerWidget.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                        QtWidgets.QSizePolicy.Fixed)
        self.verticalMainLayout.addWidget(self.headerWidget)

        self.tasksWidget = WebViewWidget(self)

        url = ftrack.getWebWidgetUrl('tasks', theme='tf')

        self.tasksWidget.setUrl(url)
        self.horizontalLayout.addWidget(self.tasksWidget)
        self.verticalMainLayout.addLayout(self.horizontalLayout)

        self.setObjectName('ftrackTasks')
        self.setWindowTitle("ftrackTasks")
Example #2
0
    def __init__(self, parent=None):
        '''Initialise widget with *parent*'''
        super(Notification, self).__init__(parent=parent)

        self._context = defaultdict(list)

        layout = QtWidgets.QVBoxLayout()

        toolbar = QtWidgets.QHBoxLayout()

        self.setLayout(layout)

        reloadIcon = QtGui.QIcon(QtGui.QPixmap(':/ftrack/image/dark/reload'))

        self.reloadButton = QtWidgets.QPushButton(reloadIcon, '')
        self.reloadButton.clicked.connect(self.reload)

        toolbar.addWidget(QtWidgets.QWidget(), stretch=1)
        toolbar.addWidget(self.reloadButton, stretch=0)

        layout.addLayout(toolbar)

        self._list = NotificationList(self)
        self._list.setObjectName('notification-list')
        layout.addWidget(self._list, stretch=1)

        self.overlay = ftrack_connect.ui.widget.overlay.BusyOverlay(
            self, message='Loading')

        self.overlay.hide()

        self.loadStarted.connect(self._onLoadStarted)
        self.loadEnded.connect(self._onLoadEnded)
Example #3
0
 def createVersionWidget(self):
     ''' Override to disable version widget.
     Return an empty QWidget.
     '''
     widget = QtWidgets.QWidget()
     layout = QtWidgets.QHBoxLayout()
     layout.setContentsMargins(0, 0, 0, 0)
     widget.setLayout(layout)
     return widget
Example #4
0
 def __init__(self, parent=None):
     super(ScrollingFlowWidget, self).__init__(parent)
     grid = QtWidgets.QGridLayout(self)
     scroll = ResizeScrollArea(parent)
     self._wrapper = QtWidgets.QWidget(scroll)
     self.flowLayout = FlowLayout(self._wrapper)
     self._wrapper.setLayout(self.flowLayout)
     scroll.setWidget(self._wrapper)
     scroll.setWidgetResizable(True)
     grid.addWidget(scroll)
Example #5
0
    def __init__(self, username, parent=None):
        '''Instantiate the header widget for a user with *username*.'''

        super(Header, self).__init__(parent=parent)
        self.setObjectName('ftrack-header-widget')
        self.main_layout = QtWidgets.QVBoxLayout()
        self.main_layout.setContentsMargins(0, 0, 0, 0)
        self.main_layout.setAlignment(QtCore.Qt.AlignTop)
        self.setLayout(self.main_layout)

        # Logo & User ID
        self.id_container = QtWidgets.QWidget(self)
        self.id_container_layout = QtWidgets.QHBoxLayout()
        self.id_container_layout.setContentsMargins(0, 0, 0, 0)
        self.id_container_layout.setSpacing(0)
        self.id_container_layout.setAlignment(QtCore.Qt.AlignTop)
        self.id_container.setLayout(self.id_container_layout)

        spacer = QtWidgets.QSpacerItem(0, 0, QtWidgets.QSizePolicy.Expanding,
                                       QtWidgets.QSizePolicy.Minimum)

        self.logo = Logo(self)
        self.user = User(username, self)

        self.id_container_layout.addWidget(self.logo)
        self.id_container_layout.addItem(spacer)
        self.id_container_layout.addWidget(self.user)

        # Message
        self.message_container = QtWidgets.QWidget(self)
        self.message_container.hide()
        self.message_container_layout = QtWidgets.QHBoxLayout()
        self.message_container_layout.setContentsMargins(0, 0, 0, 0)
        self.message_container_layout.setSpacing(0)
        self.message_container.setLayout(self.message_container_layout)

        self.message_box = MessageBox(self)
        self.message_container_layout.addWidget(self.message_box)

        # Add (Logo & User ID) & Message
        self.main_layout.addWidget(self.id_container)
        self.main_layout.addWidget(self.message_container)
Example #6
0
    def __init__(
        self, name, userId, group=None, applications=None, parent=None
    ):
        '''Initialise widget with initial component *value* and *parent*.'''
        super(User, self).__init__(parent)
        if applications is None:
            applications = {}

        self._userId = userId
        self._applications = applications
        self._group = group

        self.setObjectName('user')

        self.setLayout(QtWidgets.QHBoxLayout())

        self.thumbnail = ftrack_connect.ui.widget.thumbnail.User()
        self.thumbnail.setFixedWidth(30)
        self.thumbnail.setFixedHeight(30)
        self.thumbnail.load(userId)
        self.layout().addWidget(self.thumbnail)

        self.layout().setContentsMargins(0, 0, 0, 0)

        nameAndActivity = QtWidgets.QWidget()
        nameAndActivity.setLayout(QtWidgets.QVBoxLayout())
        nameAndActivity.layout().setContentsMargins(0, 0, 0, 0)

        self.countLabel = QtWidgets.QLabel()
        self.countLabel.setObjectName('user-conversation-count')
        self.countLabel.hide()

        self.nameLabel = ftrack_connect.ui.widget.label.Label()
        self.nameLabel.setText(name)
        self.nameLabel.setObjectName('name')
        nameAndActivity.layout().addWidget(self.nameLabel)

        self.activityLabel = ftrack_connect.ui.widget.label.Label()
        self.activityLabel.setObjectName('user-activity')

        self.nameAndCountLayout = QtWidgets.QHBoxLayout()
        self.nameAndCountLayout.addWidget(self.nameLabel, stretch=1)
        self.nameAndCountLayout.addWidget(self.countLabel, stretch=0)
        self.nameAndCountLayout.addSpacing(5)

        nameAndActivity.layout().addLayout(self.nameAndCountLayout)
        nameAndActivity.layout().addWidget(self.activityLabel)

        self.layout().addWidget(nameAndActivity)

        self._refreshStyles()
        self._updateActivity()
Example #7
0
    def create_overlay_widgets(self, congrat_text, success_text):
        '''Create overlay widgets to report publish result.'''

        self.activeWidget = QtWidgets.QWidget()
        self.activeWidget.setLayout(QtWidgets.QVBoxLayout())
        self.layout().addWidget(self.activeWidget)
        main_layout = self.activeWidget.layout()

        icon = QtGui.QPixmap(':ftrack/image/default/ftrackLogoLabelNew')
        icon = icon.scaled(QtCore.QSize(85, 85), QtCore.Qt.KeepAspectRatio,
                           QtCore.Qt.SmoothTransformation)

        self.ftrack_icon = QtWidgets.QLabel()
        self.ftrack_icon.setPixmap(icon)

        main_layout.addStretch(1)
        main_layout.insertWidget(1,
                                 self.ftrack_icon,
                                 alignment=QtCore.Qt.AlignCenter)

        congrat_label = QtWidgets.QLabel(congrat_text)
        congrat_label.setAlignment(QtCore.Qt.AlignCenter)

        success_label = QtWidgets.QLabel(success_text)
        success_label.setAlignment(QtCore.Qt.AlignCenter)

        main_layout.addWidget(congrat_label)
        main_layout.addWidget(success_label)
        main_layout.addStretch(1)

        buttons_layout = QtWidgets.QHBoxLayout()

        main_layout.addLayout(buttons_layout)

        self.details_button = QtWidgets.QPushButton('Details')
        buttons_layout.addWidget(self.details_button)
        self.details_button.clicked.connect(self.on_show_details)

        if self.details_window_callback is None:
            self.details_button.setDisabled(True)

        self.open_in_ftrack = QtWidgets.QPushButton('Open in ftrack')
        buttons_layout.addWidget(self.open_in_ftrack)
        self.open_in_ftrack.clicked.connect(self.on_open_in_ftrack)

        if self.asset_version is None:
            self.open_in_ftrack.setDisabled(True)
Example #8
0
    def __call__(self, label, options, store):
        '''Return a qt widget from *item*.'''
        tooltip = None

        if label is not None:
            settings_widget = QtWidgets.QGroupBox(label)
        else:
            settings_widget = QtWidgets.QWidget()

        settings_widget.setLayout(QtWidgets.QVBoxLayout())
        if tooltip:
            settings_widget.setToolTip(tooltip)

        if isinstance(options, QtWidgets.QWidget):
            settings_widget.layout().addWidget(options)
        else:
            settings_widget.layout().addWidget(
                ActionSettingsWidget(store, options))

        return settings_widget
Example #9
0
    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)
Example #10
0
    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()
Example #12
0
    def create_validate_failed_overlay_widgets(self, label, failed_validators):
        '''Create overlay widgets to report validation failures.'''
        congrat_text = '<h2>Validation Failed!</h2>'
        success_text = 'Your <b>{0}</b> failed to validate.'.format(label)

        self.activeWidget = QtWidgets.QWidget()
        self.activeWidget.setLayout(QtWidgets.QVBoxLayout())
        self.layout().addWidget(self.activeWidget)
        main_layout = self.activeWidget.layout()

        main_layout.addStretch(1)

        congrat_label = QtWidgets.QLabel(congrat_text)
        congrat_label.setAlignment(QtCore.Qt.AlignCenter)

        success_label = QtWidgets.QLabel(success_text)
        success_label.setAlignment(QtCore.Qt.AlignCenter)

        main_layout.addWidget(congrat_label)
        main_layout.addWidget(success_label)

        validators_table_container = QtWidgets.QWidget()
        table_layout = QtWidgets.QVBoxLayout()
        table_layout.setContentsMargins(15, 10, 15, 10)
        validators_table_container.setLayout(table_layout)

        validators_table = QtWidgets.QTableWidget()
        validators_table.setSelectionBehavior(
            QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows)
        validators_table.setSelectionMode(QtWidgets.QTableWidget.NoSelection)

        validators_table.setColumnCount(2)
        validators_table.setHorizontalHeaderLabels(['Validation', 'Error'])
        validators_table.horizontalHeader().setResizeMode(
            0, QtWidgets.QHeaderView.ResizeToContents)
        validators_table.horizontalHeader().setSectionResizeMode(
            QtWidgets.QHeaderView.Stretch)
        validators_table.horizontalHeader().setVisible(True)

        validators_table.setRowCount(len(failed_validators))
        validators_table.verticalHeader().setVisible(False)

        icon = QtGui.QIcon(':ftrack/image/dark/remove')
        font = QtGui.QFont()
        font.setBold(True)

        for row, validator in enumerate(failed_validators):
            item = QtWidgets.QTableWidgetItem(icon, validator[0])
            item.setFont(font)
            validators_table.setItem(row, 0, item)

            error_msg = validator[1]

            # Remove quotes from error message, if present.
            if ((error_msg[0] == error_msg[-1]) and error_msg.startswith(
                ("'", '"'))):
                error_msg = error_msg[1:-1]

            item = QtWidgets.QTableWidgetItem(error_msg)
            validators_table.setItem(row, 1, item)

        table_layout.addWidget(validators_table)
        main_layout.addWidget(validators_table_container)

        main_layout.addStretch(1)
        label = QtWidgets.QLabel('See details for more information.')
        label.setAlignment(QtCore.Qt.AlignCenter)
        main_layout.addWidget(label)

        buttons_layout = QtWidgets.QHBoxLayout()
        main_layout.addLayout(buttons_layout)

        self.details_button = QtWidgets.QPushButton('Details')
        buttons_layout.addWidget(self.details_button)
        self.details_button.clicked.connect(self.on_show_details)

        self.close_button = QtWidgets.QPushButton('Close')
        buttons_layout.addWidget(self.close_button)
        self.close_button.clicked.connect(self.close_window_callback)

        if self.details_window_callback is None:
            self.details_button.setDisabled(True)
Example #13
0
    def initStackedOptions(self, xmlstring, fromFile=False):
        '''Initiate stacked options widget with *xmlstring*.'''
        self.stackedIndex = dict()
        self.stackedOptions = dict()
        doc = QtXml.QDomDocument('optionsDocument')
        if fromFile:
            pass
        else:
            doc.setContent(xmlstring)
        assetTypeElements = doc.elementsByTagName('assettype')

        assetTypePages = dict()
        connectorName = self.connector.getConnectorName()
        maxRowCount = 0
        for i in range(assetTypeElements.length()):
            assetTypePages[i] = QtWidgets.QWidget()
            assetTypePages[i].setObjectName('page' + str(i))
            assetTypeElement = assetTypeElements.item(i).toElement()

            mainLayout = QtWidgets.QVBoxLayout()
            mainLayout.setContentsMargins(0, 0, 0, 0)
            mainLayout.setSpacing(0)
            assetTypePages[i].setLayout(mainLayout)

            assetTypeName = assetTypeElement.attribute('name')
            self.stackedIndex[assetTypeName] = i
            self.stackedOptions[assetTypeName] = []

            tabElements = assetTypeElement.elementsByTagName('tab')
            if tabElements.length() > 0:
                tabWidget = QtWidgets.QTabWidget()
                mainLayout.addWidget(tabWidget)

                for j in range(tabElements.length()):
                    tab = QtWidgets.QWidget()
                    tabLayout = QtWidgets.QVBoxLayout()
                    tabLayout.setSpacing(2)
                    tab.setLayout(tabLayout)
                    tabElement = tabElements.item(j).toElement()
                    tabName = tabElement.attribute('name')
                    tabEnabled = tabElement.attribute('enabled')

                    if tabEnabled == 'False':
                        tab.setEnabled(False)

                    accepts = tabElement.attribute('accepts')
                    acceptsSplit = accepts.split(',')
                    if accepts == '' or connectorName in acceptsSplit:
                        rowElements = tabElement.elementsByTagName('row')
                        rowCount = 0
                        for k in range(rowElements.length()):
                            rowElement = rowElements.item(k).toElement()
                            rowLayout, optionsCount = self.parseRow(
                                rowElement, connectorName, mainLayout,
                                assetTypeName)
                            if rowLayout:
                                rowCount += optionsCount
                                tabLayout.addLayout(rowLayout)
                        maxRowCount = max(rowCount, maxRowCount)
                        tabWidget.addTab(tab, tabName)

                    spacerItem3 = QtWidgets.QSpacerItem(
                        1, 1, QtWidgets.QSizePolicy.Minimum,
                        QtWidgets.QSizePolicy.Expanding)
                    tabLayout.addItem(spacerItem3)

            self.addWidget(assetTypePages[i])
Example #14
0
    def parseOptions(self, rowLayout, optionElements, assetTypeName, enabled):
        '''Parse options.'''
        optionsCount = 0
        for k in range(optionElements.length()):
            optionElement = optionElements.item(k).toElement()
            optionType = optionElement.attribute('type')
            optionValue = optionElement.attribute('value')
            if optionValue == 'True':
                optionValue = True
            elif optionValue == 'False':
                optionValue = False
            optionName = optionElement.attribute('name')
            self.stackedOptions[assetTypeName].append(optionName)

            if optionType == 'float':
                floatBox = QtWidgets.QDoubleSpinBox()
                floatBox.setEnabled(enabled)
                floatBox.setObjectName(optionName)
                floatBox.setSingleStep(0.1)
                floatBox.setMaximum(sys.maxint)
                floatBox.setMinimum(-sys.maxint)
                floatBox.setValue(float(optionValue))
                rowLayout.addWidget(floatBox)
                optionsCount = 1

            if optionType == 'checkbox':
                checkBox = QtWidgets.QCheckBox()
                checkBox.setEnabled(enabled)
                checkBox.setChecked(bool(optionValue))
                checkBox.setObjectName(optionName)
                rowLayout.addWidget(checkBox)
                optionsCount = 1

            if optionType == 'string':
                textBox = QtWidgets.QLineEdit()
                textBox.setEnabled(enabled)
                textBox.setText(optionValue)
                textBox.setObjectName(optionName)
                rowLayout.addWidget(textBox)
                optionsCount = 1

            if optionType == 'combo':
                comboBox = QtWidgets.QComboBox()
                comboBox.setEnabled(enabled)
                optionitemElements = optionElement.elementsByTagName(
                    'optionitem')
                for t in range(optionitemElements.length()):
                    optionitemElement = optionitemElements.item(t).toElement()
                    optionitemValue = optionitemElement.attribute('name')
                    comboBox.addItem(optionitemValue)

                comboBox.setObjectName(optionName)
                rowLayout.addWidget(comboBox)
                optionsCount = optionitemElements.length()

            if optionType == 'radio':
                radioWidget = QtWidgets.QWidget()
                radioLayout = QtWidgets.QVBoxLayout()
                radioLayout.setSpacing(1)
                radioWidget.setLayout(radioLayout)
                optionitemElements = optionElement.elementsByTagName(
                    'optionitem')
                for t in range(optionitemElements.length()):
                    optionitemElement = optionitemElements.item(t).toElement()
                    optionitemValue = optionitemElement.attribute('value')
                    optionitemName = optionitemElement.attribute('name')
                    radioButton = QtWidgets.QRadioButton(optionitemName)
                    if bool(optionitemValue):
                        radioButton.setChecked(True)
                    radioLayout.addWidget(radioButton)
                    radioButton.setEnabled(enabled)

                    radioButton.setObjectName(optionName)
                rowLayout.addWidget(radioWidget)
                optionsCount = optionitemElements.length()
        return optionsCount
    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()