示例#1
0
    def __init__(
        self, parent, message='Processing',
        icon=':ftrack/image/default/ftrackLogoColor'
    ):
        '''Initialise with *parent*.

         *message* is the message to display on the overlay.

         '''
        super(BlockingOverlay, self).__init__(parent)
        layout = QtWidgets.QVBoxLayout()
        layout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(layout)

        self.content = QtWidgets.QFrame()
        self.content.setObjectName('content')
        layout.addWidget(
            self.content, alignment=QtCore.Qt.AlignCenter
        )

        self.contentLayout = QtWidgets.QVBoxLayout()
        self.contentLayout.setContentsMargins(0, 0, 0, 0)
        self.content.setLayout(self.contentLayout)

        self.icon = QtWidgets.QLabel()
        pixmap = QtGui.QPixmap(icon)
        self.icon.setPixmap(
            pixmap.scaledToHeight(36, mode=QtCore.Qt.SmoothTransformation)
        )
        self.icon.setAlignment(QtCore.Qt.AlignCenter)
        self.contentLayout.addWidget(self.icon)

        self.messageLabel = QtWidgets.QLabel()
        self.messageLabel.setWordWrap(True)
        self.messageLabel.setAlignment(QtCore.Qt.AlignCenter)
        self.contentLayout.addWidget(self.messageLabel)

        self.setStyleSheet('''
            BlockingOverlay {
                background-color: rgba(250, 250, 250, 200);
                border: none;
            }

            BlockingOverlay QFrame#content {
                padding: 0px;
                border: 80px solid transparent;
                background-color: transparent;
                border-image: url(:ftrack/image/default/boxShadow) 140 stretch;
            }

            BlockingOverlay QLabel {
                background: transparent;
            }
        ''')

        self.setMessage(message)
示例#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)
    def __init__(self, *args, **kwargs):
        '''Initialise DataDropZone widget.'''
        super(DataDropZone, self).__init__(*args, **kwargs)

        self.log = logging.getLogger(__name__ + '.' + self.__class__.__name__)
        self.setAcceptDrops(True)
        self.setObjectName('ftrack-connect-publisher-browse-button')
        self.setProperty('ftrackDropZone', True)

        layout = QtWidgets.QVBoxLayout()
        self.setLayout(layout)

        bottomCenterAlignment = QtCore.Qt.AlignBottom | QtCore.Qt.AlignHCenter
        topCenterAlignment = QtCore.Qt.AlignTop | QtCore.Qt.AlignHCenter

        self._label = QtWidgets.QLabel('Drop files here or')
        layout.addWidget(self._label, alignment=bottomCenterAlignment)

        self._browseButton = QtWidgets.QPushButton('Browse')
        self._browseButton.setToolTip('Browse for file(s).')
        layout.addWidget(self._browseButton, alignment=topCenterAlignment)

        self._setupConnections()

        homeFolder = os.path.expanduser('~')
        if os.path.isdir(homeFolder):
            self._currentLocation = homeFolder
    def __init__(self, componentName=None, resourceIdentifier=None,
                 parent=None):
        '''Initialise widget with initial component *value* and *parent*.'''
        super(Component, self).__init__(parent=parent)
        self.setLayout(QtWidgets.QVBoxLayout())

        self.componentNameEdit = ftrack_connect.ui.widget.line_edit.LineEdit()
        self.componentNameEdit.setPlaceholderText('Enter component name')
        self.componentNameEdit.textChanged.connect(self.nameChanged)

        self.layout().addWidget(self.componentNameEdit)

        # TODO: Add theme support.
        removeIcon = QtGui.QIcon(
            QtGui.QPixmap(':/ftrack/image/light/trash')
        )

        self.removeAction = QtWidgets.QAction(
            QtGui.QIcon(removeIcon), 'Remove', self.componentNameEdit
        )
        self.removeAction.setStatusTip('Remove component.')
        self.componentNameEdit.addAction(
            self.removeAction
        )

        self.resourceInformation = ftrack_connect.ui.widget.label.Label()
        self.layout().addWidget(self.resourceInformation)

        # Set initial values.
        self.setId(str(uuid.uuid4()))
        self.setComponentName(componentName)
        self.setResourceIdentifier(resourceIdentifier)
示例#5
0
    def __init__(self, parent=None):
        '''Initiate chat widget with *chatHub*.'''
        super(Chat, self).__init__(parent)

        self.setLayout(QtWidgets.QVBoxLayout())
        self.layout().setContentsMargins(0, 0, 0, 0)
        self.layout().setSpacing(0)
        self.setObjectName('chat-widget')

        self._chatFeed = Feed(parent)
        self.layout().addWidget(self._chatFeed, stretch=1)

        self._messageArea = ChatTextEdit(self)
        self._messageArea.setMinimumHeight(30)
        self._messageArea.setMaximumHeight(75)
        self._messageArea.returnPressed.connect(self.onReturnPressed)
        self.layout().addWidget(self._messageArea, stretch=0)

        self._sendMessageButton = QtWidgets.QPushButton('Submit')
        self.layout().addWidget(self._sendMessageButton, stretch=0)

        self._sendMessageButton.clicked.connect(self.onReturnPressed)

        self.busyOverlay = ftrack_connect.ui.widget.overlay.BusyOverlay(
            self, message='Loading')
        self.hideOverlay()
示例#6
0
    def __init__(self, text, name, me=False, parent=None):
        '''Initialise widget with *text* and *name*.'''
        super(Message, self).__init__(parent)

        self.setLayout(QtWidgets.QVBoxLayout())
        self.layout().setContentsMargins(0, 0, 0, 0)
        self.layout().setSpacing(0)

        if me:
            name = 'You'

        self.sender = QtWidgets.QLabel(name)
        self.layout().addWidget(self.sender, stretch=0)

        self.text = QtWidgets.QLabel(text)
        self.text.setWordWrap(True)
        self.text.setObjectName('message-text')

        self.layout().addWidget(self.text, stretch=1)

        if me:
            self.sender.setStyleSheet('''
                    QLabel {
                        color: #1CBC90;
                    }
                ''')
            self.sender.setAlignment(QtCore.Qt.AlignRight)
            self.text.setAlignment(QtCore.Qt.AlignTop | QtCore.Qt.AlignRight)
        else:
            self.sender.setStyleSheet('''
                    QLabel {
                        color: rgba(52, 152, 219, 255);
                    }
                ''')
示例#7
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")
示例#8
0
    def __init__(self, *args, **kwargs):
        '''Instantiate the actions widget.'''
        super(Actions, self).__init__(*args, **kwargs)
        layout = QtWidgets.QVBoxLayout()
        self.setLayout(layout)

        self.actionsView = ftrack_connect.ui.widget.actions.Actions()
        layout.addWidget(self.actionsView)
示例#9
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()
示例#10
0
文件: actions.py 项目: hanbinren/wudi
    def __init__(self,
                 session,
                 all_section_text=None,
                 overlay=None,
                 parent=None):
        '''Initiate a actions view.'''
        super(Actions, self).__init__(parent)

        self.logger = logging.getLogger(__name__ + '.' +
                                        self.__class__.__name__)
        self._session = session

        self._action_label_text = all_section_text

        layout = QtWidgets.QVBoxLayout()
        self.setLayout(layout)
        self.layout().setContentsMargins(0, 0, 0, 0)

        self._currentUserId = None
        self._recentActions = []
        self._actions = []

        self._recentLabel = QtWidgets.QLabel('Recent')
        layout.addWidget(self._recentLabel)
        self._recentSection = ActionSection(self)
        # self._recentSection.setFixedHeight(100)
        self._recentSection.beforeActionLaunch.connect(
            self._onBeforeActionLaunched)
        self._recentSection.actionLaunched.connect(self._onActionLaunched)
        # layout.addWidget(self._recentSection)

        self._allLabel = QtWidgets.QLabel()
        self._allLabel.setAlignment(QtCore.Qt.AlignCenter)
        layout.addWidget(self._allLabel)
        self._allSection = ActionSection(self)
        self._allSection.beforeActionLaunch.connect(
            self._onBeforeActionLaunched)
        self._allSection.actionLaunched.connect(self._onActionLaunched)
        layout.addWidget(self._allSection)

        if overlay is None:
            self._overlay = overlay_.BusyOverlay(self, message='Launching...')
        else:
            self._overlay = overlay

        self._overlay.setStyleSheet(OVERLAY_DARK_STYLE)
        self._overlay.setVisible(False)

        self.recentActionsChanged.connect(self._updateRecentSection)

        self._loadActionsForContext([])
        self._updateRecentActions()
示例#11
0
    def __init__(self, ftrack_entity, hint=None):
        '''Instantiate asset selector with *ftrack_entity*.'''
        super(AssetSelector, self).__init__()

        self.assets = ftrack_entity.session.query(
            'select name, id, type_id from Asset where context_id '
            'is "{0}"'.format(
                ftrack_entity['id']
            )
        ).all()

        main_layout = QtWidgets.QVBoxLayout(self)
        self.setLayout(main_layout)
        main_layout.setContentsMargins(0, 0, 0, 0)

        self.asset_selector = QtWidgets.QComboBox(self)
        main_layout.addWidget(self.asset_selector)

        self.asset_selector.addItem('Create new asset')
        for asset in self.assets:
            self.asset_selector.addItem(asset['name'])

        self.asset_name = QtWidgets.QLineEdit(self)
        self.asset_name.setPlaceholderText('Asset name...')
        main_layout.addWidget(self.asset_name)

        self.asset_type_selector = QtWidgets.QComboBox(self)

        self.asset_types = ftrack_entity.session.query(
            'select name, short, id from AssetType'
        ).all()

        for asset_type in self.asset_types:
            self.asset_type_selector.addItem(asset_type['name'])

        # automatically set the correct asset type
        if hint:
            for index, asset_type in enumerate(self.asset_types):
                if asset_type['short'] == hint:
                    self.asset_type_selector.setCurrentIndex(index)
                    break

        main_layout.addWidget(self.asset_type_selector)

        self.asset_selector.currentIndexChanged.connect(
            self._on_asset_selection_changed
        )
        self.asset_type_selector.currentIndexChanged.connect(
            self.notify_changed
        )
        self.asset_name.textChanged.connect(self.notify_changed)
示例#12
0
 def __init__(self, current_entity):
     '''Initialize GlobalSwitchDialog with *current_entity*.'''
     super(GlobalSwitchDialog, self).__init__()
     self.setWindowTitle('Global Context Switch')
     layout = QtWidgets.QVBoxLayout()
     self._session = current_entity.session
     self.setLayout(layout)
     self._entity_browser = context_selector.EntityBrowser()
     layout.addWidget(self._entity_browser)
     current_location = [e['id'] for e in current_entity['link']]
     self._entity_browser.setLocation(current_location)
     self._entity_browser.accepted.connect(self.on_context_changed)
     self._entity_browser.rejected.connect(self.close)
     self.context_changed.connect(self.on_notify_user)
示例#13
0
    def __init__(self, title=None, description=None, data=None, parent=None):
        '''Initialise time log.

        *title* should be the title entry to display for the time log whilst
        *description* can provide an optional longer description.

        *data* is optional data that can be stored for future reference (for
        example a link to an ftrack task that the time log represents).

        *parent* should be the optional parent of this widget.

        '''
        super(TimeLog, self).__init__(parent=parent)
        self.setObjectName('time-log')
        self._data = None

        layout = QtWidgets.QHBoxLayout()
        self.setLayout(layout)

        self.labelLayout = QtWidgets.QVBoxLayout()
        layout.addLayout(self.labelLayout, stretch=1)

        self.titleLabel = ftrack_connect.ui.widget.label.Label()
        self.titleLabel.setProperty('title', True)
        self.labelLayout.addWidget(self.titleLabel)

        self.descriptionLabel = ftrack_connect.ui.widget.label.Label()
        self.labelLayout.addWidget(self.descriptionLabel)

        # TODO: Add theme support.
        playIcon = QtGui.QIcon(
            QtGui.QPixmap(':/ftrack/image/light/play')
        )

        self.playButton = QtWidgets.QPushButton(playIcon, '')
        self.playButton.setFlat(True)
        self.playButton.clicked.connect(self._onPlayButtonClicked)
        layout.addWidget(self.playButton)

        self.setSizePolicy(
            QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed
        )

        # Set initial values.
        self.setValue({
            'title': title,
            'description': description,
            'data': data
        })
示例#14
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)
示例#15
0
    def __init__(self, parent=None):
        '''Initiate a actions view.'''
        super(Actions, self).__init__(parent)

        self.logger = logging.getLogger(__name__ + '.' +
                                        self.__class__.__name__)
        self._session = ftrack_connect.session.get_session()

        layout = QtWidgets.QVBoxLayout()
        self.setLayout(layout)

        self._currentUserId = None
        self._recentActions = []
        self._actions = []

        self._entitySelector = entity_selector.EntitySelector()
        self._entitySelector.setFixedHeight(50)
        self._entitySelector.entityChanged.connect(self._onEntityChanged)
        layout.addWidget(QtWidgets.QLabel('Select action context'))
        layout.addWidget(self._entitySelector)

        self._recentLabel = QtWidgets.QLabel('Recent')
        layout.addWidget(self._recentLabel)
        self._recentSection = ActionSection(self)
        self._recentSection.setFixedHeight(100)
        self._recentSection.beforeActionLaunch.connect(
            self._onBeforeActionLaunched)
        self._recentSection.actionLaunched.connect(self._onActionLaunched)
        layout.addWidget(self._recentSection)

        self._allLabel = QtWidgets.QLabel('Discovering actions..')
        self._allLabel.setAlignment(QtCore.Qt.AlignCenter)
        layout.addWidget(self._allLabel)
        self._allSection = ActionSection(self)
        self._allSection.beforeActionLaunch.connect(
            self._onBeforeActionLaunched)
        self._allSection.actionLaunched.connect(self._onActionLaunched)
        layout.addWidget(self._allSection)

        self._overlay = overlay.BusyOverlay(self, message='Launching...')
        self._overlay.setVisible(False)

        self.recentActionsChanged.connect(self._updateRecentSection)

        self._loadActionsForContext([])
        self._updateRecentActions()
    def setupUi(self, ImportOptions):
        '''Setup UI for *ImportOptions*.'''
        ImportOptions.setObjectName("ImportOptions")
        ImportOptions.resize(451, 16)
        self.verticalLayout = QtWidgets.QVBoxLayout(ImportOptions)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout.setObjectName("verticalLayout")
        self.optionsPlaceHolderLayout = QtWidgets.QHBoxLayout()
        self.optionsPlaceHolderLayout.setSizeConstraint(
            QtWidgets.QLayout.SetMinimumSize
        )
        self.optionsPlaceHolderLayout.setObjectName("optionsPlaceHolderLayout")
        self.verticalLayout.addLayout(self.optionsPlaceHolderLayout)

        self.retranslateUi(ImportOptions)
        QtCore.QMetaObject.connectSlotsByName(ImportOptions)
示例#17
0
    def __init__(self, parent):
        '''Initialise.'''
        super(TimerOverlay, self).__init__(parent)
        layout = QtWidgets.QVBoxLayout()
        self.setLayout(layout)

        message = QtWidgets.QLabel('Select a task to activate timer.')
        message.setWordWrap(True)
        message.setAlignment(QtCore.Qt.AlignVCenter)
        layout.addWidget(message)

        # TODO: See if there is a way to stop Sass converting the rgba string
        # to the wrong value.
        self.setStyleSheet('''
            #ftrack-connect-window TimerOverlay {
                background-color: rgba(255, 255, 255, 200);
            }
        ''')
示例#18
0
    def __init__(self, *args, **kwargs):
        '''Instantiate the time tracker.'''
        super(TimeTracker, self).__init__(*args, **kwargs)
        self.setObjectName('timeTracker')

        self._activeEntity = None

        layout = QtWidgets.QVBoxLayout()
        self.setLayout(layout)

        self.activeLabel = QtWidgets.QLabel('Currently running')
        self.activeLabel.setProperty('title', True)
        layout.addWidget(self.activeLabel)

        self._timerEnabled = False
        self.timer = ftrack_connect.ui.widget.timer.Timer()
        layout.addWidget(self.timer)

        self.timerPlaceholder = TimerOverlay(self.timer)

        # TODO: Add theme support.
        reloadIcon = QtGui.QIcon(QtGui.QPixmap(':/ftrack/image/light/reload'))

        assignedTimeLogUpdateButton = QtWidgets.QPushButton(reloadIcon, '')
        assignedTimeLogUpdateButton.setFlat(True)
        assignedTimeLogUpdateButton.setToolTip('Refresh list')
        assignedTimeLogUpdateButton.clicked.connect(self._updateAssignedList)

        self.assignedTimeLogList = _TimeLogList(
            title='Assigned', headerWidgets=[assignedTimeLogUpdateButton])
        layout.addWidget(self.assignedTimeLogList, stretch=1)

        # Connect events.
        self.timer.stopped.connect(self._onCommitTime)
        self.timer.timeEdited.connect(self._onCommitTime)

        self.assignedTimeLogList.itemSelected.connect(self._onSelectTimeLog)

        self.blockingOverlay = TimeTrackerBlockingOverlay(
            self, 'Time tracker is currently disabled during beta.')
        self.blockingOverlay.show()

        self._updateAssignedList()
    def __init__(self, event=None, date=None, parent=None):
        '''Initialise widget with initial component *event* and *parent*.'''
        super(Notification, self).__init__(parent=parent)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        verticalLayout = QtWidgets.QVBoxLayout()

        self.setLayout(self.horizontalLayout)

        self.horizontalLayout.addLayout(verticalLayout, stretch=1)

        self.textLabel = QtWidgets.QLabel()
        verticalLayout.addWidget(self.textLabel)

        self.dateLabel = QtWidgets.QLabel()
        verticalLayout.addWidget(self.dateLabel)

        self.setDate(event['created_at'])

        self.setEvent(event)
示例#20
0
    def __init__(
        self, name, userId, applications, group=None, parent=None
    ):
        '''Initialise widget with initial component *value* and *parent*.'''
        super(UserExtended, self).__init__(parent=parent)

        self.applicationInfoWidget = QtWidgets.QLabel()

        self._userId = userId
        self._applications = applications

        self.setLayout(QtWidgets.QVBoxLayout())

        self.user = User(name, userId, group=None, applications=applications)
        self.layout().addWidget(self.user)

        self.layout().addWidget(self.applicationInfoWidget, stretch=0)

        self.updateInformation(name, userId, applications)
示例#21
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)
示例#22
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
示例#23
0
    def __init__(self, parent=None, url=None):
        '''Initialise WebView with *parent* and *url*'''
        super(WebView, self).__init__(parent)
        self.setMinimumHeight(400)
        self.setSizePolicy(
            QtWidgets.QSizePolicy(
                QtWidgets.QSizePolicy.Expanding,
                QtWidgets.QSizePolicy.Expanding
            )
        )

        layout = QtWidgets.QVBoxLayout()
        layout.setContentsMargins(0, 0, 0, 0)
        layout.setSpacing(0)
        self.setLayout(layout)

        self._webView = QtWebCompat.QWebView()
        layout.addWidget(self._webView)

        self.set_url(url)
示例#24
0
    def __init__(self, *args, **kwargs):
        '''Instantiate the publisher widget.'''
        super(Publisher, self).__init__(*args, **kwargs)
        layout = QtWidgets.QVBoxLayout()
        self.setLayout(layout)

        self.publishView = ftrack_connect.ui.widget.publisher.Publisher()
        layout.addWidget(self.publishView)

        self.blockingOverlay = PublisherBlockingOverlay(self)
        self.blockingOverlay.hide()

        self.busyOverlay = ftrack_connect.ui.widget.overlay.BusyOverlay(self)
        self.busyOverlay.hide()

        self.publishView.publishStarted.connect(self._onPublishStarted)

        self.publishView.publishFinished.connect(self._onPublishFinished)

        self.entityChanged.connect(self._onEntityChanged)
示例#25
0
    def __init__(
        self, parent,
        icon=':ftrack/image/default/ftrackLogoColor'
    ):
        super(AboutDialog, self).__init__(parent)

        layout = QtWidgets.QVBoxLayout()
        layout.setContentsMargins(20, 20, 20, 20)
        layout.setSizeConstraint(QtWidgets.QLayout.SetFixedSize)
        self.setLayout(layout)

        self.icon = QtWidgets.QLabel()
        pixmap = QtGui.QPixmap(icon)
        self.icon.setPixmap(
            pixmap.scaledToHeight(36, mode=QtCore.Qt.SmoothTransformation)
        )
        self.icon.setAlignment(QtCore.Qt.AlignCenter)
        layout.addWidget(self.icon)

        self.messageLabel = QtWidgets.QLabel()
        self.messageLabel.setWordWrap(True)
        self.messageLabel.setAlignment(QtCore.Qt.AlignLeft)
        layout.addWidget(self.messageLabel)

        layout.addSpacing(25)

        self.debugButton = QtWidgets.QPushButton('More info')
        self.debugButton.clicked.connect(self._onDebugButtonClicked)

        layout.addWidget(self.debugButton)

        self.loggingButton = QtWidgets.QPushButton('Open log directory')
        self.loggingButton.clicked.connect(self._onLoggingButtonClicked)

        layout.addWidget(self.loggingButton)

        self.debugTextEdit = QtWidgets.QTextEdit()
        self.debugTextEdit.setReadOnly(True)
        self.debugTextEdit.setFontPointSize(10)
        self.debugTextEdit.hide()
        layout.addWidget(self.debugTextEdit)
示例#26
0
    def __init__(self, results):
        '''Instantiate and show results.'''
        super(Dialog, self).__init__()
        self.setObjectName('ftrack-result-dialog')
        self.setMinimumSize(1080, 720)
        main_layout = QtWidgets.QVBoxLayout(self)
        self.setLayout(main_layout)

        filter_layout = QtWidgets.QHBoxLayout()
        filter_label = QtWidgets.QLabel('Filter log')
        self.filter_field = QtWidgets.QLineEdit()
        self.filter_field.setObjectName('ftrack-log-filter-field')
        self.filter_field.textChanged.connect(self.on_search)

        filter_layout.addWidget(filter_label)
        filter_layout.addWidget(self.filter_field)
        main_layout.addLayout(filter_layout)

        log_list = QtWidgets.QTableView()
        log_list.verticalHeader().hide()

        log_list.setObjectName('ftrack-log-view')
        log_list.setAlternatingRowColors(True)
        log_list.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
        log_list.horizontalHeader().setStretchLastSection(True)
        log_items = self._parse_results(results)

        log_model = ftrack_connect_pipeline.ui.model.log_table.LogTableModel(
            self, log_items)
        self.log_sort_model = ftrack_connect_pipeline.ui.model.log_table.FilterProxyModel(
        )
        self.log_sort_model.setDynamicSortFilter(True)
        self.log_sort_model.setSourceModel(log_model)
        log_list.setModel(self.log_sort_model)

        main_layout.addWidget(log_list)

        open_log_folder_button = QtWidgets.QPushButton('Open log directory')
        open_log_folder_button.clicked.connect(self._on_logging_button_clicked)
        main_layout.addWidget(open_log_folder_button)
    def build(self):
        '''Build widgets and layout.'''
        self.setLayout(QtWidgets.QVBoxLayout())
        self.layout().setContentsMargins(0, 0, 0, 0)

        self.optionsLayout = QtWidgets.QHBoxLayout()
        self.assetTypeSelector = QtWidgets.QComboBox()
        self.optionsLayout.addWidget(self.assetTypeSelector)

        self.refreshButton = QtWidgets.QPushButton(self.tr('Refresh'))
        self.optionsLayout.addWidget(self.refreshButton)
        self.optionsLayout.addStretch(1)

        self.layout().addLayout(self.optionsLayout)

        self.assetTable = QtWidgets.QTableWidget()
        self.assetTable.setEditTriggers(
            QtWidgets.QAbstractItemView.NoEditTriggers)
        self.assetTable.setSelectionMode(
            QtWidgets.QAbstractItemView.SingleSelection)
        self.assetTable.setSelectionBehavior(
            QtWidgets.QAbstractItemView.SelectRows)

        self.assetTable.setColumnCount(len(self.assetTableColumns))
        self.assetTable.setRowCount(0)
        self.assetTable.verticalHeader().hide()

        self.assetTable.setHorizontalHeaderLabels(self.assetTableColumns)

        horizontalHeader = self.assetTable.horizontalHeader()
        horizontalHeader.setResizeMode(QtWidgets.QHeaderView.Fixed)

        self.assetTable.horizontalHeader().setDefaultSectionSize(100)
        self.assetTable.setColumnWidth(1, 63)
        self.assetTable.horizontalHeader().setResizeMode(
            0, QtWidgets.QHeaderView.Stretch)

        self.layout().addWidget(self.assetTable)
示例#28
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)
示例#29
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)
示例#30
0
    def __init__(self, widgetFactory, widgetItem, parent=None):
        '''Initialise widget with *parent*.

        *widgetFactory* should be a callable that accepts an item and returns
        an appropriate widget.

        *widgetItem* should be a callable that accepts a widget and returns
        the appropriate item from the widget.

        '''
        self.widgetFactory = widgetFactory
        self.widgetItem = widgetItem

        super(ItemList, self).__init__(parent=parent)

        self.setLayout(QtWidgets.QVBoxLayout())
        self.setFrameStyle(QtWidgets.QFrame.StyledPanel
                           | QtWidgets.QFrame.NoFrame)

        # List
        self.list = ftrack_connect.ui.widget.list.List()
        self.layout().addWidget(self.list, stretch=1)

        self.layout().setContentsMargins(5, 5, 5, 5)