def fill_stype_pipeline(self, stype=None, parent_tree_item=None):
        if not parent_tree_item:
            parent_tree_item_add = self.tree_widget.addTopLevelItem
        else:
            parent_tree_item_add = parent_tree_item.addChild

        if stype.pipeline:
            for stype_pipeline in stype.pipeline.values():
                top_item = QtGui.QTreeWidgetItem()
                title = stype_pipeline.info.get('name')
                if not title:
                    title = stype_pipeline.info.get('code')
                top_item.setText(0, title)
                top_item.setData(1, 0, '{0}:{1}'.format(stype_pipeline.info.get('code'), '{pp}'))
                parent_tree_item_add(top_item)

                for key, val in stype_pipeline.pipeline.items():
                    child_item = QtGui.QTreeWidgetItem()
                    child_item.setText(0, key.capitalize())
                    child_item.setCheckState(0, QtCore.Qt.Unchecked)
                    child_item.setData(1, 0, '{0}:{1}'.format(key, '{pr}'))

                    item_color = Qt4Gui.QColor(200, 200, 200)
                    process = stype_pipeline.get_pipeline_process(key)
                    if process:
                        hex_color = process.get('color')
                        color = None
                        if hex_color:
                            color = gf.hex_to_rgb(hex_color, tuple=True)
                        if color:
                            item_color = Qt4Gui.QColor(*color)
                    child_item.setIcon(0, gf.get_icon('circle', color=item_color, scale_factor=0.55))

                    top_item.addChild(child_item)
                    top_item.setExpanded(True)
Ejemplo n.º 2
0
 def paintEvent(self, event):
     # Don't know why on maya there goes different events
     if event.type() == QtCore.QEvent.Paint:
         super(Ui_topBarWidget, self).paintEvent(event)
         painter = Qt4Gui.QPainter()
         painter.begin(self)
         rect = self.rect()
         painter.fillRect(rect.x(), rect.y(), rect.width(), rect.height(), Qt4Gui.QColor(48, 48, 48))
Ejemplo n.º 3
0
def setPaletteFromDct(dct):
    palette = Qt4Gui.QPalette()
    for role in roles:
        for group in groups:
            color = Qt4Gui.QColor(dct['%s:%s' % (role, group)])
            qGrp = getattr(Qt4Gui.QPalette, group)
            qRl = getattr(Qt4Gui.QPalette, role)
            palette.setColor(qGrp, qRl, color)

    QtGui.QApplication.setPalette(palette)
Ejemplo n.º 4
0
 def fill_status(self):
     status_combo_box = self.statusComboBox.model()
     for value, color in zip(self.task_process['process'], self.task_process['color']):
         item = Qt4Gui.QStandardItem(u'{0}'.format(value))
         sc = gf.hex_to_rgb(color, tuple=True)
         sc_item = Qt4Gui.QColor(sc[0], sc[1], sc[2], 128)
         item.setBackground(sc_item)
         item.setData(sc_item, 1)
         item.setData(value, 2)
         status_combo_box.appendRow(item)
Ejemplo n.º 5
0
def get_char_format(color, style=""):

    _color = Qt4Gui.QColor()
    _color.setNamedColor(color)
    _format = Qt4Gui.QTextCharFormat()
    _format.setForeground(_color)
    if "bold" in style:
        _format.setFontWeight(Qt4Gui.QFont.Bold)

    if "italic" in style:
        _format.setFontItalic(True)

    return _format
Ejemplo n.º 6
0
    def create_controls(self):

        self.none_button = QtGui.QPushButton('Toggle All')
        self.none_button.setIcon(gf.get_icon('checkbox-multiple-marked-outline', icons_set='mdi', scale_factor=1))
        self.none_button.setFlat(True)

        self.all_process_button = QtGui.QPushButton('Toggle Process')
        self.all_process_button.setIcon(gf.get_icon('checkbox-blank-circle', icons_set='mdi', scale_factor=0.6))
        self.all_process_button.setFlat(True)

        self.all_with_builtins_button = QtGui.QPushButton('Toggle Builtin Processes')
        self.all_with_builtins_button.setIcon(gf.get_icon('checkbox-blank-circle', icons_set='mdi', scale_factor=0.6))
        self.all_with_builtins_button.setFlat(True)

        self.all_children_button = QtGui.QPushButton('Toggle Children')
        self.all_children_button.setIcon(gf.get_icon('view-sequential', icons_set='mdi', scale_factor=1))
        self.all_children_button.setFlat(True)

        self.togglers_widget = QtGui.QWidget()
        self.togglers_layout = QtGui.QGridLayout()
        self.togglers_layout.setContentsMargins(0, 0, 0, 0)
        self.togglers_layout.setSpacing(6)
        self.togglers_widget.setLayout(self.togglers_layout)

        self.togglers_layout.addWidget(self.none_button, 0, 0, 1, 1)
        self.togglers_layout.addWidget(self.all_process_button, 0, 1, 1, 1)
        self.togglers_layout.addWidget(self.all_with_builtins_button, 1, 0, 1, 1)
        self.togglers_layout.addWidget(self.all_children_button, 1, 1, 1, 1)

        # Creating collapsable
        self.controls_collapsable = Ui_collapsableWidget(state=True)
        layout_colapsable = QtGui.QVBoxLayout()
        self.controls_collapsable.setLayout(layout_colapsable)
        self.controls_collapsable.setText('Hide Togglers')
        self.controls_collapsable.setCollapsedText('Show Togglers')
        layout_colapsable.addWidget(self.togglers_widget)

        self.controls_collapsable.collapsed.connect(self.toggle_presets_edit_buttons)

        self.start_sync_button = QtGui.QPushButton('Begin Repo Sync')

        start_sync_color = Qt4Gui.QColor(16, 160, 16)
        start_sync_color_active = Qt4Gui.QColor(16, 220, 16)

        self.start_sync_button.setIcon(gf.get_icon('sync', color=start_sync_color, color_active=start_sync_color_active, icons_set='mdi', scale_factor=1))

        self.progress_bar = QtGui.QProgressBar()

        self.grid.addWidget(self.controls_collapsable, 2, 0, 1, 2)
        self.grid.addWidget(self.start_sync_button, 3, 0, 1, 2)
        self.grid.addWidget(self.progress_bar, 4, 0, 1, 4)
Ejemplo n.º 7
0
    def lineNumberAreaPaintEvent(self, event):
        """
        Line number area paint event.
        """

        if EditorWindow.DRAW_LINE_NUMBER:
            painter = Qt4Gui.QPainter(self._line_area)
            painter.setRenderHint(Qt4Gui.QPainter.Antialiasing)
            painter.fillRect(event.rect(),
                             EditorWindow.GetColor("line_number_background"))
            painter.setPen(EditorWindow.GetColor("line_number"))

            block = self.firstVisibleBlock()
            block_number = block.blockNumber()
            top = self.blockBoundingGeometry(block).translated(
                self.contentOffset()).top()
            bottom = top + self.blockBoundingRect(block).height()

            while block.isValid() and top <= event.rect().bottom():
                if block.isVisible() and bottom >= event.rect().top():
                    number = str(block_number + 1)
                    painter.drawText(0, top, self._line_area.width(),
                                     self.fontMetrics().height(),
                                     QtCore.Qt.AlignRight, number)

                block = block.next()
                top = bottom
                bottom = top + self.blockBoundingRect(block).height()
                block_number += 1
Ejemplo n.º 8
0
    def resizeEvent(self, event):
        event.accept()

        self.text_area.setLineWrapColumnOrWidth(self.width() - 80)
        text_document = self.text_area.document()
        metrics = Qt4Gui.QFontMetrics(self.text_area.font())

        document_size = text_document.size()

        doc_height = document_size.height() + 48

        doc_width = document_size.width()
        text_rect = metrics.boundingRect(QtCore.QRect(), 0,
                                         self.text_area.toPlainText())
        login_rect = metrics.boundingRect(QtCore.QRect(), 0,
                                          self.user_label.text())
        text_width = text_rect.width() + login_rect.width() + 20

        if self.attachment_size == 0:
            if text_width < doc_width:
                self.message_frame.setFixedWidth(text_width)
            else:
                self.message_frame.setFixedWidth(doc_width + 20)

            if self.message_type == 'out':
                x_pos = self.width() - (self.message_frame.width() + 60)
                self.message_frame.move(x_pos, 0)
            else:
                self.message_frame.move(60, 0)

        if self.attachment_size > 0:
            self.text_area.setFixedHeight(doc_height - 18)
            self.setFixedHeight(doc_height + self.attachment_size)
        else:
            self.setFixedHeight(doc_height)

        text_area_size = self.message_frame.size()

        self.overlay_widget.resize(text_area_size)

        overlay_reg = Qt4Gui.QRegion(self.overlay_widget.frameGeometry())
        text_area_reg = Qt4Gui.QRegion(
            QtCore.QRect(0, 36, text_area_size.width(),
                         text_area_size.height() - 60))

        self.overlay_widget.setMask(overlay_reg.subtracted(text_area_reg))
Ejemplo n.º 9
0
    def GetColor(key):
        """
        Get color by given key.
        """

        if key in EditorWindow.COLOR_MAP:
            return EditorWindow.COLOR_MAP[key]
        else:
            return Qt4Gui.QColor("#black")
Ejemplo n.º 10
0
    def create_ui(self):

        self.customize_ui()

        self.controls_actions()

        # limiting available search characters
        self.setValidator(Qt4Gui.QRegExpValidator(QtCore.QRegExp('\w+'), self))
        self.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.setFrame(False)
    def copy_to_clipboard_from_graphics_view(self):
        if self.file_list:
            clipboard = QtGui.QApplication.instance().clipboard()
            file_object = self.file_list[self.current_pix]

            image = Qt4Gui.QImage(0, 0, Qt4Gui.QImage.Format_ARGB32)
            image.load(file_object.get_full_abs_path())

            if not image.isNull():
                clipboard.setImage(image)
    def getting_pixmaps(self):
        for snapshot in self.snapshots:
            preview_files_objects = snapshot.get_previewable_files_objects()
            for preview_file_obj in preview_files_objects:
                web_file_obj = preview_file_obj.get_web_preview()
                if not web_file_obj:
                    web_file_obj = preview_file_obj

                if web_file_obj.is_meta_file_obj():
                    meta_file_object = web_file_obj.get_meta_file_object()
                    pixmap = Qt4Gui.QPixmap(meta_file_object.get_all_files_list(first=True))
                else:
                    pixmap = Qt4Gui.QPixmap(web_file_obj.get_full_abs_path())

                if not pixmap.isNull():
                    self.pix_list.append(pixmap.scaledToWidth(640, QtCore.Qt.SmoothTransformation))
                    self.file_list.append(preview_file_obj)

        self.create_scene()
    def copy_to_clipboard_from_tree(self):
        item = self.filesTreeWidget.currentItem()
        file_object = item.data(0, QtCore.Qt.UserRole)

        clipboard = QtGui.QApplication.instance().clipboard()

        image = Qt4Gui.QImage(0, 0, Qt4Gui.QImage.Format_ARGB32)
        image.load(file_object.get_full_abs_path())

        if not image.isNull():
            clipboard.setImage(image)
Ejemplo n.º 14
0
    def add_item(self,
                 item_text,
                 item_color=None,
                 hex_color=None,
                 item_data=None):
        if hex_color:
            c = gf.hex_to_rgb(hex_color, tuple=True)
            item_color = Qt4Gui.QColor(c[0], c[1], c[2], 128)

        if not item_color:
            self.addItem(item_text)
        else:
            model = self.model()
            item = Qt4Gui.QStandardItem(u'{0}'.format(item_text))
            item.setBackground(item_color)
            item.setData(item_color, 1)
            item.setData(item_text, 2)
            if item_data:
                item.setData(item_data, 3)
            model.appendRow(item)
Ejemplo n.º 15
0
    def create_float_buttons(self):
        self.clear_button_layout = QtGui.QGridLayout(self.plain_text_editor)
        self.clear_button_layout.setContentsMargins(0, 0, 0, 0)
        self.clear_button_layout.setSpacing(0)

        self.clear_button = QtGui.QToolButton()
        self.clear_button.setAutoRaise(True)
        self.clear_button.setFixedSize(24, 24)
        self.clear_button.setIcon(gf.get_icon('lock-open', icons_set='mdi'))

        self.clear_button_layout.addWidget(self.clear_button, 1, 3, 1, 1)
        self.clear_button_layout.addItem(
            QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                              QtGui.QSizePolicy.Minimum), 1, 4, 1, 1)

        self.clear_button.clicked.connect(self.unfreeze_text_edit)

        self.lock_button = QtGui.QToolButton()
        self.lock_button.setAutoRaise(True)
        self.lock_button.setFixedSize(24, 24)
        self.lock_button.setIcon(gf.get_icon('lock', icons_set='mdi'))

        self.clear_button_layout.addWidget(self.lock_button, 1, 2, 1, 1)
        # self.clear_button_layout.addItem(QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum), 1, 3, 1, 1)

        self.lock_button.clicked.connect(self.freeze_text_edit)

        self.edit_button = QtGui.QToolButton()
        self.edit_button.setAutoRaise(True)
        self.edit_button.setFixedSize(24, 24)
        self.edit_button.setIcon(gf.get_icon('pencil', icons_set='mdi'))

        self.clear_button_layout.addWidget(self.edit_button, 1, 0, 1, 1)
        self.clear_button_layout.addItem(
            QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
                              QtGui.QSizePolicy.Expanding), 0, 0, 1, 3)

        self.edit_button.clicked.connect(self.set_edit_mode)

        self.save_button = QtGui.QToolButton()
        self.save_button.setAutoRaise(True)
        self.save_button.setFixedSize(24, 24)
        self.save_button.setIcon(
            gf.get_icon('content-save',
                        icons_set='mdi',
                        color=Qt4Gui.QColor(0, 255, 128, 192)))
        self.clear_button_layout.addWidget(self.save_button, 1, 1, 1, 1)

        self.save_button.clicked.connect(self.save_current_column)

        self.clear_button.setHidden(True)
        self.save_button.setHidden(True)
        self.lock_button.setHidden(True)
Ejemplo n.º 16
0
 def fill_priority(self):
     # priority combo box with colors
     priority_combo_box = self.priorityComboBox.model()
     step = len(self.priority) - 1
     int_range = 255 / step * step
     r = range(0, int_range, 255 / step)
     g = range(0, int_range, 255 / step)
     b = 0
     a = 64
     r.reverse()
     pc = []
     for i in range(step):
         color = r[i], g[i], b, a
         pc.append(color)
     for i, (label, value) in enumerate(self.priority):
         item = Qt4Gui.QStandardItem(u'{0}, {1}'.format(label, value))
         color = Qt4Gui.QColor(pc[i - 1][0], pc[i - 1][1], pc[i - 1][2], pc[i - 1][3])
         if i > 0:
             item.setBackground(color)
             item.setData(color, 1)
         priority_combo_box.appendRow(item)
    def fill_children_pipelines_and_processes(self,
                                              stype=None,
                                              parent_tree_item=None,
                                              added_stypes=None):
        if not parent_tree_item:
            parent_tree_item_add = self.tree_widget.addTopLevelItem
        else:
            parent_tree_item_add = parent_tree_item.addChild

        if not added_stypes:
            added_stypes = []

        # Children process
        if stype.schema:
            for child in stype.schema.children:
                child_stype = stype.get_project().stypes.get(child['from'])
                relationship_type = child.get('type')
                if child_stype and relationship_type not in ['many_to_many']:

                    top_item = QtGui.QTreeWidgetItem()
                    top_item.setText(
                        0,
                        child_stype.get_pretty_name() + ' (child)')
                    top_item.setCheckState(0, QtCore.Qt.Checked)
                    top_item.setData(
                        1, 0, '{0}:{1}'.format(child_stype.get_code(), '{s}'))

                    clr = child_stype.get_stype_color(tuple=True)
                    stype_color = None
                    if clr:
                        stype_color = Qt4Gui.QColor(clr[0], clr[1], clr[2],
                                                    255)
                    top_item.setIcon(
                        0,
                        gf.get_icon('view-sequential',
                                    color=stype_color,
                                    icons_set='mdi',
                                    scale_factor=1.1))

                    parent_tree_item_add(top_item)

                    self.fill_builtin_processes(top_item)

                    # breaking recursion
                    if child_stype not in added_stypes:
                        added_stypes.append(child_stype)

                        self.fill_stype_pipeline(child_stype, top_item)

                        self.fill_children_pipelines_and_processes(
                            child_stype, top_item, added_stypes)
Ejemplo n.º 18
0
    def create_ui(self):

        self.setWindowTitle('Making Screenshot')

        self.setWindowFlags(QtCore.Qt.FramelessWindowHint
                            | QtCore.Qt.WindowStaysOnTopHint)

        # if do not work on linux, try "apt install xcompmgr" and run it, or compiz
        self.setAttribute(QtCore.Qt.WA_TranslucentBackground)

        self.setWindowModality(QtCore.Qt.ApplicationModal)

        self.setGeometry(Qt4Gui.QCursor.pos().x() - 12,
                         Qt4Gui.QCursor.pos().y() - 12, 24, 24)

        self.label_lay = QtGui.QVBoxLayout()
        self.setLayout(self.label_lay)
        self.screenshot_pixmap = None

        self.label_lay.setContentsMargins(0, 0, 0, 0)
        self.label_lay.setSpacing(0)

        self.bg_wd = QtGui.QLabel()
        self.bg_wd.setAlignment(QtCore.Qt.AlignHCenter
                                | QtCore.Qt.AlignVCenter)
        self.bg_wd.setPixmap(
            gf.get_icon('crosshairs', color=Qt4Gui.QColor(255, 255,
                                                          255)).pixmap(24, 24))
        self.bg_wd.setStyleSheet(
            'QLabel {padding: 0px;border: 0px dashed rgb(255,255,255); background-color: rgba(0,0,0,1);}'
        )
        self.label_lay.addWidget(self.bg_wd)

        self.bg_wd.setMouseTracking(True)

        self.button_lay = QtGui.QHBoxLayout(self.bg_wd)
        self.button_lay.setContentsMargins(0, 0, 0, 0)
        self.button_lay.setSpacing(0)

        self.move_under_mouse_timer = QtCore.QTimer()
        self.move_under_mouse_timer.setInterval(50)
        self.move_under_mouse_timer.timeout.connect(self.move_under_mouse)
        self.move_under_mouse_timer.start()

        self.create_take_screenshot_button()

        self.setIcon()
        self.setMouseTracking(True)

        self.controls_actions()
    def rotate_pixmaps(self, index=None):

        if self.pix_list and self.pm_list:

            idx = index % len(self.pix_list)
            pm_idx = index % len(self.pm_list)

            pixmap = Qt4Gui.QPixmap(self.pix_list[idx])

            if not pixmap.isNull():
                self.pm_list[pm_idx].add_pixmap(pixmap.scaledToWidth(640, QtCore.Qt.SmoothTransformation))

            self.previewGraphicsView.setSceneRect(self.pm_list[pm_idx].pixmap_item.boundingRect())
            self.previewGraphicsView.fitInView(self.pm_list[pm_idx].pixmap_item.boundingRect(), QtCore.Qt.KeepAspectRatio)
Ejemplo n.º 20
0
    def create_float_buttons(self):
        self.descriptionTextEdit.setViewportMargins(0, 20, 0, 24)
        self.clear_button_layout = QtGui.QGridLayout(self.descriptionTextEdit)
        self.clear_button_layout.setContentsMargins(0, 0, 0, 0)
        self.clear_button_layout.setSpacing(0)

        self.clear_button = QtGui.QToolButton()
        self.clear_button.setAutoRaise(True)
        self.clear_button.setFixedSize(24, 24)
        self.clear_button.setIcon(gf.get_icon('lock-open', icons_set='mdi'))

        self.clear_button_layout.addWidget(self.clear_button, 1, 3, 1, 1)
        self.clear_button_layout.addItem(
            QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                              QtGui.QSizePolicy.Minimum), 1, 4, 1, 1)

        self.lock_button = QtGui.QToolButton()
        self.lock_button.setAutoRaise(True)
        self.lock_button.setFixedSize(24, 24)
        self.lock_button.setIcon(gf.get_icon('lock', icons_set='mdi'))

        self.clear_button_layout.addWidget(self.lock_button, 1, 2, 1, 1)
        # self.clear_button_layout.addItem(QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum), 1, 3, 1, 1)

        self.edit_button = QtGui.QToolButton()
        self.edit_button.setAutoRaise(True)
        self.edit_button.setFixedSize(24, 24)
        self.edit_button.setIcon(gf.get_icon('pencil', icons_set='mdi'))

        self.clear_button_layout.addWidget(self.edit_button, 1, 0, 1, 1)
        self.clear_button_layout.addItem(
            QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
                              QtGui.QSizePolicy.Expanding), 0, 0, 1, 3)

        self.save_button = QtGui.QToolButton()
        self.save_button.setAutoRaise(True)
        self.save_button.setFixedSize(24, 24)
        self.save_button.setIcon(
            gf.get_icon('content-save',
                        icons_set='mdi',
                        color=Qt4Gui.QColor(0, 255, 128, 192)))
        self.clear_button_layout.addWidget(self.save_button, 1, 1, 1, 1)

        self.clear_button.setHidden(True)
        self.save_button.setHidden(True)
        self.lock_button.setHidden(True)
Ejemplo n.º 21
0
    def create_tray(self):
        self.tray_icon = QtGui.QSystemTrayIcon(self)
        self.tray_icon.activated.connect(self.tray_activated)

        icon = Qt4Gui.QIcon(':/ui_main/gliph/tactic_favicon.ico')
        self.tray_icon.setIcon(icon)

        self.tray_menu = QtGui.QMenu(self)

        self.show_main_window = QtGui.QAction('Show Main Window', self, triggered=self.show)
        self.tray_menu.addAction(self.show_main_window)
        self.tray_menu.addSeparator()

        self.close_app_action = QtGui.QAction('Exit', self, triggered=self.close_app)
        self.tray_menu.addAction(self.close_app_action)

        self.tray_icon.setContextMenu(self.tray_menu)

        self.tray_icon.show()
    def create_explicit_filename_edit(self):
        self.explicitFilenameLineEdit_freezed = False
        self.explicitFilenameLineEdit.clear()

        self.explicitFilenameLineEdit_clear_button_layout = QtGui.QHBoxLayout(
            self.explicitFilenameLineEdit)
        self.explicitFilenameLineEdit_clear_button_layout.setContentsMargins(
            0, 0, 3, 0)
        self.explicitFilenameLineEdit_clear_button_layout.setSpacing(0)
        self.explicitFilenameLineEdit_clear_button = QtGui.QToolButton()
        self.explicitFilenameLineEdit_clear_button.setFixedSize(16, 16)
        self.explicitFilenameLineEdit_clear_button.setIcon(
            gf.get_icon('remove',
                        icons_set='ei',
                        color=Qt4Gui.QColor(255, 196, 0, 192),
                        scale_factor=0.8))
        self.explicitFilenameLineEdit_clear_button_layout.insertStretch(0)
        self.explicitFilenameLineEdit_clear_button_layout.addWidget(
            self.explicitFilenameLineEdit_clear_button)
        self.explicitFilenameLineEdit_clear_button.setHidden(True)
    def create_context_combo_box(self):
        self.contextComboBox_freezed = False
        self.contextComboBox.clear()

        self.contextComboBox_clear_button_layout = QtGui.QHBoxLayout(
            self.contextComboBox)
        self.contextComboBox_clear_button_layout.setContentsMargins(
            0, 0, 20, 0)
        self.contextComboBox_clear_button_layout.setSpacing(0)
        self.contextComboBox_clear_button = QtGui.QToolButton()
        self.contextComboBox_clear_button.setFixedSize(16, 16)
        self.contextComboBox_clear_button.setIcon(
            gf.get_icon('unlock',
                        icons_set='ei',
                        color=Qt4Gui.QColor(0, 196, 255, 192),
                        scale_factor=0.8))
        self.contextComboBox_clear_button_layout.insertStretch(0)
        self.contextComboBox_clear_button_layout.addWidget(
            self.contextComboBox_clear_button)
        self.contextComboBox_clear_button.setHidden(True)
Ejemplo n.º 24
0
    def setupUi(self, previewItem):
        previewItem.setObjectName("previewItem")
        previewItem.resize(382, 64)
        self.gridLayout = QtGui.QGridLayout(previewItem)
        self.gridLayout.setContentsMargins(0, 0, 0, 0)
        self.gridLayout.setSpacing(0)
        self.gridLayout.setObjectName("gridLayout")
        self.previewLabel = QtGui.QLabel(previewItem)
        self.previewLabel.setMinimumSize(QtCore.QSize(64, 64))
        self.previewLabel.setMaximumSize(QtCore.QSize(64, 64))
        self.previewLabel.setStyleSheet(
            "QLabel {\n"
            "    background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 rgba(175, 175, 175, 16), stop: 1 rgba(0, 0, 0, 0));\n"
            "    border: 0px;\n"
            "    border-radius: 4px;\n"
            "    padding: 0px 0px;\n"
            "}")
        self.previewLabel.setTextFormat(QtCore.Qt.RichText)
        self.previewLabel.setAlignment(QtCore.Qt.AlignCenter)
        self.previewLabel.setObjectName("previewLabel")
        self.gridLayout.addWidget(self.previewLabel, 0, 0, 1, 1)
        self.fileNameLabel = QtGui.QLabel(previewItem)
        self.fileNameLabel.setMinimumSize(QtCore.QSize(0, 20))
        self.fileNameLabel.setMaximumSize(QtCore.QSize(16777215, 24))
        font = Qt4Gui.QFont()
        font.setWeight(75)
        font.setBold(True)
        self.fileNameLabel.setFont(font)
        self.fileNameLabel.setStyleSheet(
            "QLabel {\n"
            "    background-color: transparent;\n"
            "    border-bottom: 2px solid qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(128, 128, 128, 64), stop:1 rgba(128, 128,128, 0));\n"
            "}")
        self.fileNameLabel.setTextFormat(QtCore.Qt.PlainText)
        self.fileNameLabel.setObjectName("fileNameLabel")
        self.gridLayout.addWidget(self.fileNameLabel, 0, 1, 1, 1)

        self.retranslateUi(previewItem)
        QtCore.QMetaObject.connectSlotsByName(previewItem)
    def update_scene(self):
        if self.pix_list:

            self.clear_scene()

            self.pm_list = [self.pm1, self.pm2, self.pm3]

            for i, pm in enumerate(self.pm_list):
                pixmap = Qt4Gui.QPixmap(self.pix_list[i % len(self.pix_list)])
                if pixmap.isNull():
                    pm.set_op(0.0)
                else:
                    pm.add_pixmap(pixmap.scaledToWidth(640, QtCore.Qt.SmoothTransformation))


            self.previewGraphicsView.setSceneRect(self.pm1.pixmap_item.boundingRect())
            self.previewGraphicsView.fitInView(self.pm1.pixmap_item.boundingRect(), QtCore.Qt.KeepAspectRatio)

        self.imagesSlider.setValue(0)

        if not self.machine.isRunning():
            self.machine.start()
Ejemplo n.º 26
0
    def create_projects_chooser(self):

        self.projects_chooser_widget_bg = QtGui.QFrame(self)
        self.projects_chooser_widget_bg.setStyleSheet("QFrame { border: 0px; background-color: black;}")
        self.projects_chooser_widget_bg.setHidden(True)
        effect = QtGui.QGraphicsDropShadowEffect(self)
        effect.setOffset(0, 0)
        effect.setColor(Qt4Gui.QColor(0, 0, 0, 128))
        effect.setBlurRadius(64)
        self.projects_chooser_widget_bg.setGraphicsEffect(effect)

        self.projects_chooser_widget = Ui_projectsChooserWidget(self)
        self.projects_chooser_widget.set_bg_widget(self.projects_chooser_widget_bg)

        self.projects_chooser_widget.setMinimumWidth(800)
        self.projects_chooser_widget.setMaximumWidth(800)
        self.projects_chooser_widget.setMinimumHeight(400)
        self.projects_chooser_widget.setMaximumHeight(1600)

        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
        self.projects_chooser_widget.setSizePolicy(sizePolicy)

        grid_layout = QtGui.QGridLayout()
        grid_layout.setContentsMargins(0, 0, 0, 0)

        grid_layout.addWidget(self.projects_chooser_widget, 1, 1, 1, 1)

        spacerItem = QtGui.QSpacerItem(0, 0, QtGui.QSizePolicy.Ignored, QtGui.QSizePolicy.Minimum)
        grid_layout.addItem(spacerItem, 1, 0, 1, 1)
        spacerItem1 = QtGui.QSpacerItem(0, 0, QtGui.QSizePolicy.Ignored, QtGui.QSizePolicy.Minimum)
        grid_layout.addItem(spacerItem1, 1, 2, 1, 1)
        spacerItem2 = QtGui.QSpacerItem(0, 0, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Ignored)
        grid_layout.addItem(spacerItem2, 0, 0, 1, 3)
        spacerItem3 = QtGui.QSpacerItem(0, 0, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Ignored)
        grid_layout.addItem(spacerItem3, 2, 0, 1, 3)

        self.main_layout.addLayout(grid_layout)
    def setupUi(self, checkinOptionsPageWidget):
        checkinOptionsPageWidget.setObjectName("checkinOptionsPageWidget")
        self.checkinPageWidgetLayout = QtGui.QVBoxLayout(checkinOptionsPageWidget)
        self.checkinPageWidgetLayout.setContentsMargins(0, 0, 0, 0)
        self.checkinPageWidgetLayout.setObjectName("checkinPageWidgetLayout")
        self.checkinMiscOptionsGroupBox = QtGui.QGroupBox(checkinOptionsPageWidget)
        font = Qt4Gui.QFont()
        font.setWeight(75)
        font.setBold(True)
        self.checkinMiscOptionsGroupBox.setFont(font)
        self.checkinMiscOptionsGroupBox.setFlat(True)
        self.checkinMiscOptionsGroupBox.setObjectName("checkinMiscOptionsGroupBox")
        self.checkinMiscOptionsLayout = QtGui.QGridLayout(self.checkinMiscOptionsGroupBox)
        self.checkinMiscOptionsLayout.setContentsMargins(10, 24, -1, 0)
        self.checkinMiscOptionsLayout.setObjectName("checkinMiscOptionsLayout")
        self.versionsSeparateCheckinCheckBox = QtGui.QCheckBox(self.checkinMiscOptionsGroupBox)
        self.versionsSeparateCheckinCheckBox.setObjectName("versionsSeparateCheckinCheckBox")
        self.checkinMiscOptionsLayout.addWidget(self.versionsSeparateCheckinCheckBox, 4, 0, 1, 1)
        self.snapshotDescriptionLimitCheckBox = QtGui.QCheckBox(self.checkinMiscOptionsGroupBox)
        self.snapshotDescriptionLimitCheckBox.setChecked(True)
        self.snapshotDescriptionLimitCheckBox.setObjectName("snapshotDescriptionLimitCheckBox")
        self.checkinMiscOptionsLayout.addWidget(self.snapshotDescriptionLimitCheckBox, 6, 0, 1, 1)
        self.snapshotDescriptionLimitSpinBox = QtGui.QSpinBox(self.checkinMiscOptionsGroupBox)
        self.snapshotDescriptionLimitSpinBox.setMinimum(20)
        self.snapshotDescriptionLimitSpinBox.setMaximum(50000)
        self.snapshotDescriptionLimitSpinBox.setSingleStep(5)
        self.snapshotDescriptionLimitSpinBox.setProperty("value", 80)
        self.snapshotDescriptionLimitSpinBox.setObjectName("snapshotDescriptionLimitSpinBox")
        self.checkinMiscOptionsLayout.addWidget(self.snapshotDescriptionLimitSpinBox, 6, 2, 1, 1)
        self.bottomVersionsRadioButton = QtGui.QRadioButton(self.checkinMiscOptionsGroupBox)
        self.bottomVersionsRadioButton.setObjectName("bottomVersionsRadioButton")
        self.checkinMiscOptionsLayout.addWidget(self.bottomVersionsRadioButton, 4, 1, 1, 1)
        self.label_2 = QtGui.QLabel(self.checkinMiscOptionsGroupBox)
        self.label_2.setObjectName("label_2")
        self.checkinMiscOptionsLayout.addWidget(self.label_2, 7, 0, 1, 1)
        self.displayLimitSpinBox = QtGui.QSpinBox(self.checkinMiscOptionsGroupBox)
        self.displayLimitSpinBox.setMinimum(20)
        self.displayLimitSpinBox.setMaximum(500)
        self.displayLimitSpinBox.setSingleStep(5)
        self.displayLimitSpinBox.setObjectName("displayLimitSpinBox")
        self.checkinMiscOptionsLayout.addWidget(self.displayLimitSpinBox, 7, 2, 1, 1)
        self.rightVersionsRadioButton = QtGui.QRadioButton(self.checkinMiscOptionsGroupBox)
        self.rightVersionsRadioButton.setChecked(True)
        self.rightVersionsRadioButton.setObjectName("rightVersionsRadioButton")
        self.checkinMiscOptionsLayout.addWidget(self.rightVersionsRadioButton, 4, 2, 1, 1)
        self.doubleClickSaveCheckBox = QtGui.QCheckBox(self.checkinMiscOptionsGroupBox)
        self.doubleClickSaveCheckBox.setObjectName("doubleClickSaveCheckBox")
        self.checkinMiscOptionsLayout.addWidget(self.doubleClickSaveCheckBox, 1, 0, 1, 3)
        self.doubleClickOpenCheckBox = QtGui.QCheckBox(self.checkinMiscOptionsGroupBox)
        self.doubleClickOpenCheckBox.setObjectName("doubleClickOpenCheckBox")
        self.checkinMiscOptionsLayout.addWidget(self.doubleClickOpenCheckBox, 2, 0, 1, 3)
        self.showAllProcessCheckBox = QtGui.QCheckBox(self.checkinMiscOptionsGroupBox)
        self.showAllProcessCheckBox.setObjectName("showAllProcessCheckBox")
        self.checkinMiscOptionsLayout.addWidget(self.showAllProcessCheckBox, 3, 0, 1, 3)
        self.getPreviewsThroughHttpCheckbox = QtGui.QCheckBox(self.checkinMiscOptionsGroupBox)
        self.getPreviewsThroughHttpCheckbox.setObjectName("getPreviewsThroughHttpCheckbox")
        self.checkinMiscOptionsLayout.addWidget(self.getPreviewsThroughHttpCheckbox, 0, 0, 1, 3)
        self.checkinMiscOptionsLayout.setColumnStretch(0, 1)
        self.checkinPageWidgetLayout.addWidget(self.checkinMiscOptionsGroupBox)
        self.snapshotsSavingOptionsGroupBox = QtGui.QGroupBox(checkinOptionsPageWidget)
        font = Qt4Gui.QFont()
        font.setWeight(75)
        font.setBold(True)
        self.snapshotsSavingOptionsGroupBox.setFont(font)
        self.snapshotsSavingOptionsGroupBox.setFlat(True)
        self.snapshotsSavingOptionsGroupBox.setObjectName("snapshotsSavingOptionsGroupBox")
        self.snapshotsSavingOptionsLayout = QtGui.QGridLayout(self.snapshotsSavingOptionsGroupBox)
        self.snapshotsSavingOptionsLayout.setContentsMargins(10, 24, -1, 0)
        self.snapshotsSavingOptionsLayout.setObjectName("snapshotsSavingOptionsLayout")
        self.repositoryComboBox = QtGui.QComboBox(self.snapshotsSavingOptionsGroupBox)
        self.repositoryComboBox.setObjectName("repositoryComboBox")
        self.snapshotsSavingOptionsLayout.addWidget(self.repositoryComboBox, 1, 1, 1, 3)
        self.updateVersionlessCheckBox = QtGui.QCheckBox(self.snapshotsSavingOptionsGroupBox)
        self.updateVersionlessCheckBox.setChecked(True)
        self.updateVersionlessCheckBox.setObjectName("updateVersionlessCheckBox")
        self.snapshotsSavingOptionsLayout.addWidget(self.updateVersionlessCheckBox, 4, 0, 1, 1)
        self.seuqenceNamingHorizontalLayout = QtGui.QHBoxLayout()
        self.seuqenceNamingHorizontalLayout.setSpacing(4)
        self.seuqenceNamingHorizontalLayout.setObjectName("seuqenceNamingHorizontalLayout")
        self.sequenceNamingTemplateLineEdit = QtGui.QLineEdit(self.snapshotsSavingOptionsGroupBox)
        self.sequenceNamingTemplateLineEdit.setReadOnly(True)
        self.sequenceNamingTemplateLineEdit.setObjectName("sequenceNamingTemplateLineEdit")
        self.seuqenceNamingHorizontalLayout.addWidget(self.sequenceNamingTemplateLineEdit)
        self.editSequenceNamingTemplateToolButton = QtGui.QToolButton(self.snapshotsSavingOptionsGroupBox)
        self.editSequenceNamingTemplateToolButton.setText("")
        self.editSequenceNamingTemplateToolButton.setAutoRaise(True)
        self.editSequenceNamingTemplateToolButton.setObjectName("editSequenceNamingTemplateToolButton")
        self.seuqenceNamingHorizontalLayout.addWidget(self.editSequenceNamingTemplateToolButton)
        self.seuqenceNamingHorizontalLayout.setStretch(0, 1)
        self.snapshotsSavingOptionsLayout.addLayout(self.seuqenceNamingHorizontalLayout, 11, 1, 1, 3)
        self.sequencePaddingHorizontalLayout = QtGui.QHBoxLayout()
        self.sequencePaddingHorizontalLayout.setSpacing(4)
        self.sequencePaddingHorizontalLayout.setObjectName("sequencePaddingHorizontalLayout")
        self.sequencePaddingHorizontalSlider = QtGui.QSlider(self.snapshotsSavingOptionsGroupBox)
        self.sequencePaddingHorizontalSlider.setMinimum(1)
        self.sequencePaddingHorizontalSlider.setMaximum(9)
        self.sequencePaddingHorizontalSlider.setProperty("value", 3)
        self.sequencePaddingHorizontalSlider.setOrientation(QtCore.Qt.Horizontal)
        self.sequencePaddingHorizontalSlider.setObjectName("sequencePaddingHorizontalSlider")
        self.sequencePaddingHorizontalLayout.addWidget(self.sequencePaddingHorizontalSlider)
        self.sequencePaddingSpinBox = QtGui.QSpinBox(self.snapshotsSavingOptionsGroupBox)
        self.sequencePaddingSpinBox.setMinimum(1)
        self.sequencePaddingSpinBox.setMaximum(9)
        self.sequencePaddingSpinBox.setProperty("value", 3)
        self.sequencePaddingSpinBox.setObjectName("sequencePaddingSpinBox")
        self.sequencePaddingHorizontalLayout.addWidget(self.sequencePaddingSpinBox)
        self.sequencePaddingHorizontalLayout.setStretch(0, 1)
        self.snapshotsSavingOptionsLayout.addLayout(self.sequencePaddingHorizontalLayout, 10, 1, 1, 3)
        self.createPlayblastCheckBox = QtGui.QCheckBox(self.snapshotsSavingOptionsGroupBox)
        self.createPlayblastCheckBox.setChecked(True)
        self.createPlayblastCheckBox.setObjectName("createPlayblastCheckBox")
        self.snapshotsSavingOptionsLayout.addWidget(self.createPlayblastCheckBox, 7, 0, 1, 1)
        self.confirmsHorizontalLayout = QtGui.QHBoxLayout()
        self.confirmsHorizontalLayout.setSpacing(0)
        self.confirmsHorizontalLayout.setObjectName("confirmsHorizontalLayout")
        self.askBeforeSaveCheckBox = QtGui.QCheckBox(self.snapshotsSavingOptionsGroupBox)
        self.askBeforeSaveCheckBox.setChecked(True)
        self.askBeforeSaveCheckBox.setObjectName("askBeforeSaveCheckBox")
        self.confirmsHorizontalLayout.addWidget(self.askBeforeSaveCheckBox)
        self.askReplaceRevisionCheckBox = QtGui.QCheckBox(self.snapshotsSavingOptionsGroupBox)
        self.askReplaceRevisionCheckBox.setChecked(True)
        self.askReplaceRevisionCheckBox.setObjectName("askReplaceRevisionCheckBox")
        self.confirmsHorizontalLayout.addWidget(self.askReplaceRevisionCheckBox)
        self.snapshotsSavingOptionsLayout.addLayout(self.confirmsHorizontalLayout, 8, 0, 1, 4)
        self.createMayaDirsCheckBox = QtGui.QCheckBox(self.snapshotsSavingOptionsGroupBox)
        self.createMayaDirsCheckBox.setObjectName("createMayaDirsCheckBox")
        self.snapshotsSavingOptionsLayout.addWidget(self.createMayaDirsCheckBox, 6, 0, 1, 1)
        self.generatePreviewsCheckBox = QtGui.QCheckBox(self.snapshotsSavingOptionsGroupBox)
        self.generatePreviewsCheckBox.setChecked(True)
        self.generatePreviewsCheckBox.setObjectName("generatePreviewsCheckBox")
        self.snapshotsSavingOptionsLayout.addWidget(self.generatePreviewsCheckBox, 5, 0, 1, 1)
        self.sequencePaddingCheckBox = QtGui.QCheckBox(self.snapshotsSavingOptionsGroupBox)
        self.sequencePaddingCheckBox.setObjectName("sequencePaddingCheckBox")
        self.snapshotsSavingOptionsLayout.addWidget(self.sequencePaddingCheckBox, 10, 0, 1, 1)
        self.checkinMethodLabel = QtGui.QLabel(self.snapshotsSavingOptionsGroupBox)
        self.checkinMethodLabel.setObjectName("checkinMethodLabel")
        self.snapshotsSavingOptionsLayout.addWidget(self.checkinMethodLabel, 2, 0, 1, 1)
        self.checkinMethodComboBox = QtGui.QComboBox(self.snapshotsSavingOptionsGroupBox)
        self.checkinMethodComboBox.setObjectName("checkinMethodComboBox")
        self.checkinMethodComboBox.addItem("")
        self.checkinMethodComboBox.addItem("")
        self.checkinMethodComboBox.addItem("")
        self.checkinMethodComboBox.addItem("")
        self.checkinMethodComboBox.addItem("")
        self.snapshotsSavingOptionsLayout.addWidget(self.checkinMethodComboBox, 2, 1, 1, 3)
        self.repositoryLabel = QtGui.QLabel(self.snapshotsSavingOptionsGroupBox)
        self.repositoryLabel.setObjectName("repositoryLabel")
        self.snapshotsSavingOptionsLayout.addWidget(self.repositoryLabel, 1, 0, 1, 1)
        self.sequqnceNamingTemplatelabel = QtGui.QLabel(self.snapshotsSavingOptionsGroupBox)
        self.sequqnceNamingTemplatelabel.setObjectName("sequqnceNamingTemplatelabel")
        self.snapshotsSavingOptionsLayout.addWidget(self.sequqnceNamingTemplatelabel, 11, 0, 1, 1)
        self.checkoutMethodLabel = QtGui.QLabel(self.snapshotsSavingOptionsGroupBox)
        self.checkoutMethodLabel.setObjectName("checkoutMethodLabel")
        self.snapshotsSavingOptionsLayout.addWidget(self.checkoutMethodLabel, 3, 0, 1, 1)
        self.checkoutMethodComboBox = QtGui.QComboBox(self.snapshotsSavingOptionsGroupBox)
        self.checkoutMethodComboBox.setObjectName("checkoutMethodComboBox")
        self.checkoutMethodComboBox.addItem("")
        self.checkoutMethodComboBox.addItem("")
        self.snapshotsSavingOptionsLayout.addWidget(self.checkoutMethodComboBox, 3, 1, 1, 3)
        self.checkinPageWidgetLayout.addWidget(self.snapshotsSavingOptionsGroupBox)
        self.dropPlateOptionsGroupBox = QtGui.QGroupBox(checkinOptionsPageWidget)
        font = Qt4Gui.QFont()
        font.setWeight(75)
        font.setBold(True)
        self.dropPlateOptionsGroupBox.setFont(font)
        self.dropPlateOptionsGroupBox.setFlat(True)
        self.dropPlateOptionsGroupBox.setObjectName("dropPlateOptionsGroupBox")
        self.dropPlateOptionsLayout = QtGui.QGridLayout(self.dropPlateOptionsGroupBox)
        self.dropPlateOptionsLayout.setContentsMargins(10, 24, -1, 0)
        self.dropPlateOptionsLayout.setObjectName("dropPlateOptionsLayout")
        self.horizontalSlider = QtGui.QSlider(self.dropPlateOptionsGroupBox)
        self.horizontalSlider.setMinimum(1)
        self.horizontalSlider.setMaximum(9)
        self.horizontalSlider.setProperty("value", 3)
        self.horizontalSlider.setOrientation(QtCore.Qt.Horizontal)
        self.horizontalSlider.setObjectName("horizontalSlider")
        self.dropPlateOptionsLayout.addWidget(self.horizontalSlider, 5, 1, 1, 1)
        self.minFramesPaddingSpinBox = QtGui.QSpinBox(self.dropPlateOptionsGroupBox)
        self.minFramesPaddingSpinBox.setMinimum(1)
        self.minFramesPaddingSpinBox.setMaximum(9)
        self.minFramesPaddingSpinBox.setProperty("value", 3)
        self.minFramesPaddingSpinBox.setObjectName("minFramesPaddingSpinBox")
        self.dropPlateOptionsLayout.addWidget(self.minFramesPaddingSpinBox, 5, 2, 1, 1)
        self.label = QtGui.QLabel(self.dropPlateOptionsGroupBox)
        self.label.setObjectName("label")
        self.dropPlateOptionsLayout.addWidget(self.label, 5, 0, 1, 1)
        self.uncheckFromDropPlateCheckBox = QtGui.QCheckBox(self.dropPlateOptionsGroupBox)
        self.uncheckFromDropPlateCheckBox.setChecked(True)
        self.uncheckFromDropPlateCheckBox.setObjectName("uncheckFromDropPlateCheckBox")
        self.dropPlateOptionsLayout.addWidget(self.uncheckFromDropPlateCheckBox, 1, 0, 1, 1)
        self.clearDropPlateAfterCheckincheckBox = QtGui.QCheckBox(self.dropPlateOptionsGroupBox)
        self.clearDropPlateAfterCheckincheckBox.setChecked(True)
        self.clearDropPlateAfterCheckincheckBox.setObjectName("clearDropPlateAfterCheckincheckBox")
        self.dropPlateOptionsLayout.addWidget(self.clearDropPlateAfterCheckincheckBox, 2, 0, 1, 1)
        self.oneFrameSequenceDetectionCheckBox = QtGui.QCheckBox(self.dropPlateOptionsGroupBox)
        self.oneFrameSequenceDetectionCheckBox.setChecked(True)
        self.oneFrameSequenceDetectionCheckBox.setObjectName("oneFrameSequenceDetectionCheckBox")
        self.dropPlateOptionsLayout.addWidget(self.oneFrameSequenceDetectionCheckBox, 4, 1, 1, 2)
        self.oneUdimDetectionCheckBox = QtGui.QCheckBox(self.dropPlateOptionsGroupBox)
        self.oneUdimDetectionCheckBox.setChecked(True)
        self.oneUdimDetectionCheckBox.setObjectName("oneUdimDetectionCheckBox")
        self.dropPlateOptionsLayout.addWidget(self.oneUdimDetectionCheckBox, 4, 0, 1, 1)
        self.syckDropPlateCheckBox = QtGui.QCheckBox(self.dropPlateOptionsGroupBox)
        self.syckDropPlateCheckBox.setChecked(True)
        self.syckDropPlateCheckBox.setObjectName("syckDropPlateCheckBox")
        self.dropPlateOptionsLayout.addWidget(self.syckDropPlateCheckBox, 0, 0, 1, 1)
        self.checkinPageWidgetLayout.addWidget(self.dropPlateOptionsGroupBox)
        self.defaultRepoPathsGroupBox = QtGui.QGroupBox(checkinOptionsPageWidget)
        font = Qt4Gui.QFont()
        font.setWeight(75)
        font.setBold(True)
        self.defaultRepoPathsGroupBox.setFont(font)
        self.defaultRepoPathsGroupBox.setFlat(True)
        self.defaultRepoPathsGroupBox.setObjectName("defaultRepoPathsGroupBox")
        self.defaultRepoPathsLayout = QtGui.QGridLayout(self.defaultRepoPathsGroupBox)
        self.defaultRepoPathsLayout.setContentsMargins(10, 24, -1, 0)
        self.defaultRepoPathsLayout.setObjectName("defaultRepoPathsLayout")
        self.handoffCheckBox = QtGui.QCheckBox(self.defaultRepoPathsGroupBox)
        self.handoffCheckBox.setObjectName("handoffCheckBox")
        self.defaultRepoPathsLayout.addWidget(self.handoffCheckBox, 5, 0, 1, 1)
        self.clientRepoDirNameLineEdit = QtGui.QLineEdit(self.defaultRepoPathsGroupBox)
        self.clientRepoDirNameLineEdit.setObjectName("clientRepoDirNameLineEdit")
        self.defaultRepoPathsLayout.addWidget(self.clientRepoDirNameLineEdit, 4, 2, 1, 1)
        self.sandboxDirPathLineEdit = QtGui.QLineEdit(self.defaultRepoPathsGroupBox)
        self.sandboxDirPathLineEdit.setObjectName("sandboxDirPathLineEdit")
        self.defaultRepoPathsLayout.addWidget(self.sandboxDirPathLineEdit, 2, 3, 1, 1)
        self.sandboxDirNameLineEdit = QtGui.QLineEdit(self.defaultRepoPathsGroupBox)
        self.sandboxDirNameLineEdit.setObjectName("sandboxDirNameLineEdit")
        self.defaultRepoPathsLayout.addWidget(self.sandboxDirNameLineEdit, 2, 2, 1, 1)
        self.localRepoDirNameLineEdit = QtGui.QLineEdit(self.defaultRepoPathsGroupBox)
        self.localRepoDirNameLineEdit.setObjectName("localRepoDirNameLineEdit")
        self.defaultRepoPathsLayout.addWidget(self.localRepoDirNameLineEdit, 3, 2, 1, 1)
        self.clientRepoCheckBox = QtGui.QCheckBox(self.defaultRepoPathsGroupBox)
        self.clientRepoCheckBox.setObjectName("clientRepoCheckBox")
        self.defaultRepoPathsLayout.addWidget(self.clientRepoCheckBox, 4, 0, 1, 1)
        self.localRepoCheckBox = QtGui.QCheckBox(self.defaultRepoPathsGroupBox)
        self.localRepoCheckBox.setChecked(True)
        self.localRepoCheckBox.setObjectName("localRepoCheckBox")
        self.defaultRepoPathsLayout.addWidget(self.localRepoCheckBox, 3, 0, 1, 1)
        self.handoffDirPathLineEdit = QtGui.QLineEdit(self.defaultRepoPathsGroupBox)
        self.handoffDirPathLineEdit.setObjectName("handoffDirPathLineEdit")
        self.defaultRepoPathsLayout.addWidget(self.handoffDirPathLineEdit, 5, 2, 1, 2)
        self.assetBaseDirColorToolButton = QtGui.QToolButton(self.defaultRepoPathsGroupBox)
        self.assetBaseDirColorToolButton.setMaximumSize(QtCore.QSize(20, 20))
        self.assetBaseDirColorToolButton.setStyleSheet("QToolButton {\n"
"    border: 1px solid rgb(128, 128, 128);\n"
"    border-radius: 4px;\n"
"    background-color:  rgb(96, 96, 96);\n"
"}\n"
"QToolButton:pressed {\n"
"    background-color: rgb(64, 64, 64);\n"
"}")
        self.assetBaseDirColorToolButton.setChecked(False)
        self.assetBaseDirColorToolButton.setObjectName("assetBaseDirColorToolButton")
        self.defaultRepoPathsLayout.addWidget(self.assetBaseDirColorToolButton, 1, 1, 1, 1)
        self.sandboxCheckBox = QtGui.QCheckBox(self.defaultRepoPathsGroupBox)
        self.sandboxCheckBox.setObjectName("sandboxCheckBox")
        self.defaultRepoPathsLayout.addWidget(self.sandboxCheckBox, 2, 0, 1, 1)
        self.localRepoDirPathLineEdit = QtGui.QLineEdit(self.defaultRepoPathsGroupBox)
        self.localRepoDirPathLineEdit.setObjectName("localRepoDirPathLineEdit")
        self.defaultRepoPathsLayout.addWidget(self.localRepoDirPathLineEdit, 3, 3, 1, 1)
        self.sandboxDirColorToolButton = QtGui.QToolButton(self.defaultRepoPathsGroupBox)
        self.sandboxDirColorToolButton.setMaximumSize(QtCore.QSize(20, 20))
        self.sandboxDirColorToolButton.setStyleSheet("QToolButton {\n"
"    border: 1px solid rgb(128, 128, 128);\n"
"    border-radius: 4px;\n"
"    background-color:  rgb(128, 64, 64);\n"
"}\n"
"QToolButton:pressed {\n"
"    background-color: rgb(108, 44, 44);\n"
"}")
        self.sandboxDirColorToolButton.setChecked(False)
        self.sandboxDirColorToolButton.setObjectName("sandboxDirColorToolButton")
        self.defaultRepoPathsLayout.addWidget(self.sandboxDirColorToolButton, 2, 1, 1, 1)
        self.clientRepoDirPathLineEdit = QtGui.QLineEdit(self.defaultRepoPathsGroupBox)
        self.clientRepoDirPathLineEdit.setObjectName("clientRepoDirPathLineEdit")
        self.defaultRepoPathsLayout.addWidget(self.clientRepoDirPathLineEdit, 4, 3, 1, 1)
        self.clientRepoDirColorToolButton = QtGui.QToolButton(self.defaultRepoPathsGroupBox)
        self.clientRepoDirColorToolButton.setMaximumSize(QtCore.QSize(20, 20))
        self.clientRepoDirColorToolButton.setStyleSheet("QToolButton {\n"
"    border: 1px solid rgb(128, 128, 128);\n"
"    border-radius: 4px;\n"
"    background-color:  rgb(31, 143, 0);\n"
"}\n"
"QToolButton:pressed {\n"
"    background-color: rgb(11, 123, 0);\n"
"}")
        self.clientRepoDirColorToolButton.setChecked(False)
        self.clientRepoDirColorToolButton.setObjectName("clientRepoDirColorToolButton")
        self.defaultRepoPathsLayout.addWidget(self.clientRepoDirColorToolButton, 4, 1, 1, 1)
        self.localRepoDirColorToolButton = QtGui.QToolButton(self.defaultRepoPathsGroupBox)
        self.localRepoDirColorToolButton.setMaximumSize(QtCore.QSize(20, 20))
        self.localRepoDirColorToolButton.setStyleSheet("QToolButton {\n"
"    border: 1px solid rgb(128, 128, 128);\n"
"    border-radius: 4px;\n"
"    background-color:  rgb(255, 140, 40);\n"
"}\n"
"QToolButton:pressed {\n"
"    background-color: rgb(235, 120, 20);\n"
"}")
        self.localRepoDirColorToolButton.setChecked(False)
        self.localRepoDirColorToolButton.setObjectName("localRepoDirColorToolButton")
        self.defaultRepoPathsLayout.addWidget(self.localRepoDirColorToolButton, 3, 1, 1, 1)
        self.assetBaseDirCheckBox = QtGui.QCheckBox(self.defaultRepoPathsGroupBox)
        self.assetBaseDirCheckBox.setChecked(True)
        self.assetBaseDirCheckBox.setObjectName("assetBaseDirCheckBox")
        self.defaultRepoPathsLayout.addWidget(self.assetBaseDirCheckBox, 0, 0, 2, 1)
        self.assetBaseDirNameLineEdit = QtGui.QLineEdit(self.defaultRepoPathsGroupBox)
        self.assetBaseDirNameLineEdit.setObjectName("assetBaseDirNameLineEdit")
        self.defaultRepoPathsLayout.addWidget(self.assetBaseDirNameLineEdit, 0, 2, 2, 1)
        self.assetBaseDirPathLineEdit = QtGui.QLineEdit(self.defaultRepoPathsGroupBox)
        self.assetBaseDirPathLineEdit.setObjectName("assetBaseDirPathLineEdit")
        self.defaultRepoPathsLayout.addWidget(self.assetBaseDirPathLineEdit, 0, 3, 2, 1)
        self.defaultRepoPathsLayout.setColumnStretch(3, 1)
        self.checkinPageWidgetLayout.addWidget(self.defaultRepoPathsGroupBox)
        self.customRepoPathsGroupBox = QtGui.QGroupBox(checkinOptionsPageWidget)
        self.customRepoPathsGroupBox.setEnabled(True)
        font = Qt4Gui.QFont()
        font.setWeight(75)
        font.setBold(True)
        self.customRepoPathsGroupBox.setFont(font)
        self.customRepoPathsGroupBox.setFlat(True)
        self.customRepoPathsGroupBox.setCheckable(True)
        self.customRepoPathsGroupBox.setChecked(False)
        self.customRepoPathsGroupBox.setObjectName("customRepoPathsGroupBox")
        self.customRepoPathsLayout = QtGui.QGridLayout(self.customRepoPathsGroupBox)
        self.customRepoPathsLayout.setContentsMargins(10, 24, -1, 0)
        self.customRepoPathsLayout.setObjectName("customRepoPathsLayout")
        self.label_7 = QtGui.QLabel(self.customRepoPathsGroupBox)
        self.label_7.setObjectName("label_7")
        self.customRepoPathsLayout.addWidget(self.label_7, 0, 0, 1, 1)
        self.customRepoDirColorToolButton = QtGui.QToolButton(self.customRepoPathsGroupBox)
        self.customRepoDirColorToolButton.setMaximumSize(QtCore.QSize(20, 20))
        self.customRepoDirColorToolButton.setStyleSheet("QToolButton {\n"
"    border: 1px solid rgb(128, 128, 128);\n"
"    border-radius: 4px;\n"
"    background-color:  rgb(64, 64, 64);\n"
"}\n"
"QToolButton:pressed {\n"
"    background-color: rgb(44, 44, 44);\n"
"}")
        self.customRepoDirColorToolButton.setChecked(False)
        self.customRepoDirColorToolButton.setObjectName("customRepoDirColorToolButton")
        self.customRepoPathsLayout.addWidget(self.customRepoDirColorToolButton, 0, 1, 1, 1)
        self.customRepoDirNameLineEdit = QtGui.QLineEdit(self.customRepoPathsGroupBox)
        self.customRepoDirNameLineEdit.setObjectName("customRepoDirNameLineEdit")
        self.customRepoPathsLayout.addWidget(self.customRepoDirNameLineEdit, 0, 2, 1, 3)
        self.label_8 = QtGui.QLabel(self.customRepoPathsGroupBox)
        self.label_8.setObjectName("label_8")
        self.customRepoPathsLayout.addWidget(self.label_8, 1, 0, 1, 1)
        self.customRepoDirPathLineEdit = QtGui.QLineEdit(self.customRepoPathsGroupBox)
        self.customRepoDirPathLineEdit.setObjectName("customRepoDirPathLineEdit")
        self.customRepoPathsLayout.addWidget(self.customRepoDirPathLineEdit, 1, 1, 1, 4)
        self.customRepoComboBox = QtGui.QComboBox(self.customRepoPathsGroupBox)
        self.customRepoComboBox.setObjectName("customRepoComboBox")
        self.customRepoPathsLayout.addWidget(self.customRepoComboBox, 2, 0, 1, 1)
        self.addCustomRepoToListPushButton = QtGui.QPushButton(self.customRepoPathsGroupBox)
        self.addCustomRepoToListPushButton.setObjectName("addCustomRepoToListPushButton")
        self.customRepoPathsLayout.addWidget(self.addCustomRepoToListPushButton, 2, 1, 1, 2)
        self.editCustomRepoPushButton = QtGui.QPushButton(self.customRepoPathsGroupBox)
        self.editCustomRepoPushButton.setObjectName("editCustomRepoPushButton")
        self.customRepoPathsLayout.addWidget(self.editCustomRepoPushButton, 2, 3, 1, 1)
        self.deleteCustomRepoPushButton = QtGui.QPushButton(self.customRepoPathsGroupBox)
        self.deleteCustomRepoPushButton.setObjectName("deleteCustomRepoPushButton")
        self.customRepoPathsLayout.addWidget(self.deleteCustomRepoPushButton, 2, 4, 1, 1)
        self.customRepoTreeWidget = QtGui.QTreeWidget(self.customRepoPathsGroupBox)
        self.customRepoTreeWidget.setStyleSheet("QTreeView::item {\n"
"    padding: 2px;\n"
"}")
        self.customRepoTreeWidget.setIndentation(0)
        self.customRepoTreeWidget.setRootIsDecorated(False)
        self.customRepoTreeWidget.setObjectName("customRepoTreeWidget")
        self.customRepoPathsLayout.addWidget(self.customRepoTreeWidget, 3, 0, 1, 5)
        self.checkinPageWidgetLayout.addWidget(self.customRepoPathsGroupBox)

        self.retranslateUi(checkinOptionsPageWidget)
        QtCore.QObject.connect(self.sequencePaddingHorizontalSlider, QtCore.SIGNAL("valueChanged(int)"), self.sequencePaddingSpinBox.setValue)
        QtCore.QObject.connect(self.sequencePaddingSpinBox, QtCore.SIGNAL("valueChanged(int)"), self.sequencePaddingHorizontalSlider.setValue)
        QtCore.QObject.connect(self.horizontalSlider, QtCore.SIGNAL("valueChanged(int)"), self.minFramesPaddingSpinBox.setValue)
        QtCore.QObject.connect(self.minFramesPaddingSpinBox, QtCore.SIGNAL("valueChanged(int)"), self.horizontalSlider.setValue)
        QtCore.QMetaObject.connectSlotsByName(checkinOptionsPageWidget)
Ejemplo n.º 28
0
    def setupUi(self, richedit):
        richedit.setObjectName("richedit")
        richedit.resize(506, 22)
        self.horizontalLayout = QtGui.QHBoxLayout(richedit)
        self.horizontalLayout.setSpacing(0)
        self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.boldButton = QtGui.QToolButton(richedit)
        self.boldButton.setToolTip("Set selected Text Bold")
        self.boldButton.setStatusTip("Set selected Text Bold")
        icon = Qt4Gui.QIcon()
        icon.addPixmap(Qt4Gui.QPixmap(":/ui_richedit/gliph/richedit/text_bold.png"), Qt4Gui.QIcon.Normal, Qt4Gui.QIcon.Off)
        self.boldButton.setIcon(icon)
        self.boldButton.setCheckable(True)
        self.boldButton.setAutoRaise(True)
        self.boldButton.setObjectName("boldButton")
        self.horizontalLayout.addWidget(self.boldButton)
        self.italicButton = QtGui.QToolButton(richedit)
        icon1 = Qt4Gui.QIcon()
        icon1.addPixmap(Qt4Gui.QPixmap(":/ui_richedit/gliph/richedit/text_italic.png"), Qt4Gui.QIcon.Normal, Qt4Gui.QIcon.Off)
        self.italicButton.setIcon(icon1)
        self.italicButton.setCheckable(True)
        self.italicButton.setAutoRaise(True)
        self.italicButton.setObjectName("italicButton")
        self.horizontalLayout.addWidget(self.italicButton)
        self.underlinedButton = QtGui.QToolButton(richedit)
        icon2 = Qt4Gui.QIcon()
        icon2.addPixmap(Qt4Gui.QPixmap(":/ui_richedit/gliph/richedit/text_underline.png"), Qt4Gui.QIcon.Normal, Qt4Gui.QIcon.Off)
        self.underlinedButton.setIcon(icon2)
        self.underlinedButton.setCheckable(True)
        self.underlinedButton.setAutoRaise(True)
        self.underlinedButton.setObjectName("underlinedButton")
        self.horizontalLayout.addWidget(self.underlinedButton)
        self.strikedButton = QtGui.QToolButton(richedit)
        self.strikedButton.setText("")
        icon3 = Qt4Gui.QIcon()
        icon3.addPixmap(Qt4Gui.QPixmap(":/ui_richedit/gliph/richedit/text_strikethrough.png"), Qt4Gui.QIcon.Normal, Qt4Gui.QIcon.Off)
        self.strikedButton.setIcon(icon3)
        self.strikedButton.setCheckable(True)
        self.strikedButton.setAutoRaise(True)
        self.strikedButton.setObjectName("strikedButton")
        self.horizontalLayout.addWidget(self.strikedButton)
        self.leftButton = QtGui.QToolButton(richedit)
        self.leftButton.setText("")
        icon4 = Qt4Gui.QIcon()
        icon4.addPixmap(Qt4Gui.QPixmap(":/ui_richedit/gliph/richedit/text_align_left.png"), Qt4Gui.QIcon.Normal, Qt4Gui.QIcon.Off)
        self.leftButton.setIcon(icon4)
        self.leftButton.setCheckable(True)
        self.leftButton.setAutoRaise(True)
        self.leftButton.setObjectName("leftButton")
        self.horizontalLayout.addWidget(self.leftButton)
        self.centerButton = QtGui.QToolButton(richedit)
        self.centerButton.setText("")
        icon5 = Qt4Gui.QIcon()
        icon5.addPixmap(Qt4Gui.QPixmap(":/ui_richedit/gliph/richedit/text_align_center.png"), Qt4Gui.QIcon.Normal, Qt4Gui.QIcon.Off)
        self.centerButton.setIcon(icon5)
        self.centerButton.setCheckable(True)
        self.centerButton.setAutoRaise(True)
        self.centerButton.setObjectName("centerButton")
        self.horizontalLayout.addWidget(self.centerButton)
        self.rightButton = QtGui.QToolButton(richedit)
        self.rightButton.setText("")
        icon6 = Qt4Gui.QIcon()
        icon6.addPixmap(Qt4Gui.QPixmap(":/ui_richedit/gliph/richedit/text_align_right.png"), Qt4Gui.QIcon.Normal, Qt4Gui.QIcon.Off)
        self.rightButton.setIcon(icon6)
        self.rightButton.setCheckable(True)
        self.rightButton.setAutoRaise(True)
        self.rightButton.setObjectName("rightButton")
        self.horizontalLayout.addWidget(self.rightButton)
        self.justButton = QtGui.QToolButton(richedit)
        self.justButton.setText("")
        icon7 = Qt4Gui.QIcon()
        icon7.addPixmap(Qt4Gui.QPixmap(":/ui_richedit/gliph/richedit/text_align_justify.png"), Qt4Gui.QIcon.Normal, Qt4Gui.QIcon.Off)
        self.justButton.setIcon(icon7)
        self.justButton.setCheckable(True)
        self.justButton.setAutoRaise(True)
        self.justButton.setObjectName("justButton")
        self.horizontalLayout.addWidget(self.justButton)
        self.numbersListButton = QtGui.QToolButton(richedit)
        self.numbersListButton.setText("")
        icon8 = Qt4Gui.QIcon()
        icon8.addPixmap(Qt4Gui.QPixmap(":/ui_richedit/gliph/richedit/text_list_numbers.png"), Qt4Gui.QIcon.Normal, Qt4Gui.QIcon.Off)
        self.numbersListButton.setIcon(icon8)
        self.numbersListButton.setAutoRaise(True)
        self.numbersListButton.setObjectName("numbersListButton")
        self.horizontalLayout.addWidget(self.numbersListButton)
        self.bulletsListButton = QtGui.QToolButton(richedit)
        self.bulletsListButton.setText("")
        icon9 = Qt4Gui.QIcon()
        icon9.addPixmap(Qt4Gui.QPixmap(":/ui_richedit/gliph/richedit/text_list_bullets.png"), Qt4Gui.QIcon.Normal, Qt4Gui.QIcon.Off)
        self.bulletsListButton.setIcon(icon9)
        self.bulletsListButton.setAutoRaise(True)
        self.bulletsListButton.setObjectName("bulletsListButton")
        self.horizontalLayout.addWidget(self.bulletsListButton)
        self.downTextButton = QtGui.QToolButton(richedit)
        self.downTextButton.setText("")
        icon10 = Qt4Gui.QIcon()
        icon10.addPixmap(Qt4Gui.QPixmap(":/ui_richedit/gliph/richedit/text_subscript.png"), Qt4Gui.QIcon.Normal, Qt4Gui.QIcon.Off)
        self.downTextButton.setIcon(icon10)
        self.downTextButton.setAutoRaise(True)
        self.downTextButton.setObjectName("downTextButton")
        self.horizontalLayout.addWidget(self.downTextButton)
        self.upTextButton = QtGui.QToolButton(richedit)
        self.upTextButton.setText("")
        icon11 = Qt4Gui.QIcon()
        icon11.addPixmap(Qt4Gui.QPixmap(":/ui_richedit/gliph/richedit/text_superscript.png"), Qt4Gui.QIcon.Normal, Qt4Gui.QIcon.Off)
        self.upTextButton.setIcon(icon11)
        self.upTextButton.setAutoRaise(True)
        self.upTextButton.setObjectName("upTextButton")
        self.horizontalLayout.addWidget(self.upTextButton)
        self.capsButton = QtGui.QToolButton(richedit)
        self.capsButton.setText("")
        icon12 = Qt4Gui.QIcon()
        icon12.addPixmap(Qt4Gui.QPixmap(":/ui_richedit/gliph/richedit/text_allcaps.png"), Qt4Gui.QIcon.Normal, Qt4Gui.QIcon.Off)
        self.capsButton.setIcon(icon12)
        self.capsButton.setAutoRaise(True)
        self.capsButton.setObjectName("capsButton")
        self.horizontalLayout.addWidget(self.capsButton)
        self.smallCapsButton = QtGui.QToolButton(richedit)
        self.smallCapsButton.setText("")
        icon13 = Qt4Gui.QIcon()
        icon13.addPixmap(Qt4Gui.QPixmap(":/ui_richedit/gliph/richedit/text_smallcaps.png"), Qt4Gui.QIcon.Normal, Qt4Gui.QIcon.Off)
        self.smallCapsButton.setIcon(icon13)
        self.smallCapsButton.setAutoRaise(True)
        self.smallCapsButton.setObjectName("smallCapsButton")
        self.horizontalLayout.addWidget(self.smallCapsButton)
        self.fontcolorButton = QtGui.QToolButton(richedit)
        self.fontcolorButton.setText("")
        icon14 = Qt4Gui.QIcon()
        icon14.addPixmap(Qt4Gui.QPixmap(":/ui_richedit/gliph/richedit/color_wheel.png"), Qt4Gui.QIcon.Normal, Qt4Gui.QIcon.Off)
        self.fontcolorButton.setIcon(icon14)
        self.fontcolorButton.setAutoRaise(True)
        self.fontcolorButton.setObjectName("fontcolorButton")
        self.horizontalLayout.addWidget(self.fontcolorButton)
        self.fontButton = QtGui.QToolButton(richedit)
        self.fontButton.setText("")
        icon15 = Qt4Gui.QIcon()
        icon15.addPixmap(Qt4Gui.QPixmap(":/ui_richedit/gliph/richedit/font.png"), Qt4Gui.QIcon.Normal, Qt4Gui.QIcon.Off)
        self.fontButton.setIcon(icon15)
        self.fontButton.setAutoRaise(True)
        self.fontButton.setObjectName("fontButton")
        self.horizontalLayout.addWidget(self.fontButton)
        self.linkButton = QtGui.QToolButton(richedit)
        self.linkButton.setText("")
        icon16 = Qt4Gui.QIcon()
        icon16.addPixmap(Qt4Gui.QPixmap(":/ui_richedit/gliph/richedit/link_add.png"), Qt4Gui.QIcon.Normal, Qt4Gui.QIcon.Off)
        self.linkButton.setIcon(icon16)
        self.linkButton.setAutoRaise(True)
        self.linkButton.setObjectName("linkButton")
        self.horizontalLayout.addWidget(self.linkButton)
        self.pictureButton = QtGui.QToolButton(richedit)
        self.pictureButton.setText("")
        icon17 = Qt4Gui.QIcon()
        icon17.addPixmap(Qt4Gui.QPixmap(":/ui_richedit/gliph/richedit/picture_add.png"), Qt4Gui.QIcon.Normal, Qt4Gui.QIcon.Off)
        self.pictureButton.setIcon(icon17)
        self.pictureButton.setAutoRaise(True)
        self.pictureButton.setObjectName("pictureButton")
        self.horizontalLayout.addWidget(self.pictureButton)
        self.folderButton = QtGui.QToolButton(richedit)
        self.folderButton.setText("")
        icon18 = Qt4Gui.QIcon()
        icon18.addPixmap(Qt4Gui.QPixmap(":/ui_richedit/gliph/richedit/folder_add.png"), Qt4Gui.QIcon.Normal, Qt4Gui.QIcon.Off)
        self.folderButton.setIcon(icon18)
        self.folderButton.setAutoRaise(True)
        self.folderButton.setObjectName("folderButton")
        self.horizontalLayout.addWidget(self.folderButton)
        self.cutButton = QtGui.QToolButton(richedit)
        self.cutButton.setText("")
        icon19 = Qt4Gui.QIcon()
        icon19.addPixmap(Qt4Gui.QPixmap(":/ui_richedit/gliph/richedit/cut_red.png"), Qt4Gui.QIcon.Normal, Qt4Gui.QIcon.Off)
        self.cutButton.setIcon(icon19)
        self.cutButton.setAutoRaise(True)
        self.cutButton.setObjectName("cutButton")
        self.horizontalLayout.addWidget(self.cutButton)
        self.copyButton = QtGui.QToolButton(richedit)
        self.copyButton.setText("")
        icon20 = Qt4Gui.QIcon()
        icon20.addPixmap(Qt4Gui.QPixmap(":/ui_richedit/gliph/richedit/page_white_copy.png"), Qt4Gui.QIcon.Normal, Qt4Gui.QIcon.Off)
        self.copyButton.setIcon(icon20)
        self.copyButton.setAutoRaise(True)
        self.copyButton.setObjectName("copyButton")
        self.horizontalLayout.addWidget(self.copyButton)
        self.pasteButton = QtGui.QToolButton(richedit)
        self.pasteButton.setText("")
        icon21 = Qt4Gui.QIcon()
        icon21.addPixmap(Qt4Gui.QPixmap(":/ui_richedit/gliph/richedit/page_white_paste.png"), Qt4Gui.QIcon.Normal, Qt4Gui.QIcon.Off)
        self.pasteButton.setIcon(icon21)
        self.pasteButton.setAutoRaise(True)
        self.pasteButton.setObjectName("pasteButton")
        self.horizontalLayout.addWidget(self.pasteButton)
        spacerItem = QtGui.QSpacerItem(0, 8, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.horizontalLayout.setStretch(22, 1)

        self.retranslateUi(richedit)
        QtCore.QMetaObject.connectSlotsByName(richedit)
        richedit.setTabOrder(self.boldButton, self.italicButton)
        richedit.setTabOrder(self.italicButton, self.underlinedButton)
        richedit.setTabOrder(self.underlinedButton, self.strikedButton)
        richedit.setTabOrder(self.strikedButton, self.leftButton)
        richedit.setTabOrder(self.leftButton, self.centerButton)
        richedit.setTabOrder(self.centerButton, self.rightButton)
        richedit.setTabOrder(self.rightButton, self.justButton)
        richedit.setTabOrder(self.justButton, self.numbersListButton)
        richedit.setTabOrder(self.numbersListButton, self.fontcolorButton)
        richedit.setTabOrder(self.fontcolorButton, self.pictureButton)
        richedit.setTabOrder(self.pictureButton, self.linkButton)
        richedit.setTabOrder(self.linkButton, self.folderButton)
        richedit.setTabOrder(self.folderButton, self.copyButton)
        richedit.setTabOrder(self.copyButton, self.cutButton)
Ejemplo n.º 29
0
 def setIcon(self):
     icon = Qt4Gui.QIcon(':/ui_main/gliph/tactic_favicon.ico')
     self.setWindowIcon(icon)
    def create_scene(self):
        self.scene_created = True

        self.pm1 = Pixmap(self)
        self.pm2 = Pixmap(self)
        self.pm3 = Pixmap(self)

        self.scene.addItem(self.pm1.pixmap_item)
        self.scene.addItem(self.pm2.pixmap_item)
        self.scene.addItem(self.pm3.pixmap_item)

        # animation
        self.machine = QtCore.QStateMachine()
        self.state1 = QtCore.QState()
        self.state2 = QtCore.QState()
        self.state3 = QtCore.QState()

        self.state1.assignProperty(self.pm1, 'pos', QtCore.QPoint(0, 0))
        self.state1.assignProperty(self.pm1, 'opacity', 1)

        self.state2.assignProperty(self.pm1, 'pos', QtCore.QPoint(-255, 0))
        self.state2.assignProperty(self.pm1, 'opacity', 0)

        self.state3.assignProperty(self.pm1, 'pos', QtCore.QPoint(255, 0))
        self.state3.assignProperty(self.pm1, 'opacity', 0)

        self.state1.assignProperty(self.pm2, 'pos', QtCore.QPoint(255, 0))
        self.state1.assignProperty(self.pm2, 'opacity', 0)

        self.state2.assignProperty(self.pm2, 'pos', QtCore.QPoint(0, 0))
        self.state2.assignProperty(self.pm2, 'opacity', 1)

        self.state3.assignProperty(self.pm2, 'pos', QtCore.QPoint(-255, 0))
        self.state3.assignProperty(self.pm2, 'opacity', 0)

        self.state1.assignProperty(self.pm3, 'pos', QtCore.QPoint(-255, 0))
        self.state1.assignProperty(self.pm3, 'opacity', 0)

        self.state2.assignProperty(self.pm3, 'pos', QtCore.QPoint(255, 0))
        self.state2.assignProperty(self.pm3, 'opacity', 0)

        self.state3.assignProperty(self.pm3, 'pos', QtCore.QPoint(0, 0))
        self.state3.assignProperty(self.pm3, 'opacity', 1)

        self.pm1_anm = QtCore.QPropertyAnimation(self.pm1, 'pos', self)
        self.pm1_anm.setEasingCurve(QtCore.QEasingCurve.OutExpo)
        self.pm1_anm.setDuration(300)

        self.pm1_anm_o = QtCore.QPropertyAnimation(self.pm1, 'opacity', self)
        self.pm1_anm_o.setEasingCurve(QtCore.QEasingCurve.OutExpo)
        self.pm1_anm_o.setDuration(200)

        self.pm2_anm = QtCore.QPropertyAnimation(self.pm2, 'pos', self)
        self.pm2_anm.setEasingCurve(QtCore.QEasingCurve.OutExpo)
        self.pm2_anm.setDuration(300)

        self.pm2_anm_o = QtCore.QPropertyAnimation(self.pm2, 'opacity', self)
        self.pm2_anm_o.setEasingCurve(QtCore.QEasingCurve.OutExpo)
        self.pm2_anm_o.setDuration(200)

        self.pm3_anm = QtCore.QPropertyAnimation(self.pm3, 'pos', self)
        self.pm3_anm.setEasingCurve(QtCore.QEasingCurve.OutExpo)
        self.pm3_anm.setDuration(300)

        self.pm3_anm_o = QtCore.QPropertyAnimation(self.pm3, 'opacity', self)
        self.pm3_anm_o.setEasingCurve(QtCore.QEasingCurve.OutExpo)
        self.pm3_anm_o.setDuration(200)

        self.t4 = self.state1.addTransition(self.value_decreased, self.state3)
        self.t4.addAnimation(self.pm1_anm)
        self.t4.addAnimation(self.pm1_anm_o)
        self.t4.addAnimation(self.pm2_anm)
        self.t4.addAnimation(self.pm2_anm_o)
        self.t4.addAnimation(self.pm3_anm)
        self.t4.addAnimation(self.pm3_anm_o)

        self.t5 = self.state2.addTransition(self.value_decreased, self.state1)
        self.t5.addAnimation(self.pm1_anm)
        self.t5.addAnimation(self.pm1_anm_o)
        self.t5.addAnimation(self.pm2_anm)
        self.t5.addAnimation(self.pm2_anm_o)
        self.t5.addAnimation(self.pm3_anm)
        self.t5.addAnimation(self.pm3_anm_o)

        self.t6 = self.state3.addTransition(self.value_decreased, self.state2)
        self.t6.addAnimation(self.pm1_anm)
        self.t6.addAnimation(self.pm1_anm_o)
        self.t6.addAnimation(self.pm2_anm)
        self.t6.addAnimation(self.pm2_anm_o)
        self.t6.addAnimation(self.pm3_anm)
        self.t6.addAnimation(self.pm3_anm_o)

        self.t1 = self.state1.addTransition(self.value_increased, self.state2)
        self.t1.addAnimation(self.pm1_anm)
        self.t1.addAnimation(self.pm1_anm_o)
        self.t1.addAnimation(self.pm2_anm)
        self.t1.addAnimation(self.pm2_anm_o)
        self.t1.addAnimation(self.pm3_anm)
        self.t1.addAnimation(self.pm3_anm_o)

        self.t2 = self.state2.addTransition(self.value_increased, self.state3)
        self.t2.addAnimation(self.pm1_anm)
        self.t2.addAnimation(self.pm1_anm_o)
        self.t2.addAnimation(self.pm2_anm)
        self.t2.addAnimation(self.pm2_anm_o)
        self.t2.addAnimation(self.pm3_anm)
        self.t2.addAnimation(self.pm3_anm_o)

        self.t3 = self.state3.addTransition(self.value_increased, self.state1)
        self.t3.addAnimation(self.pm1_anm)
        self.t3.addAnimation(self.pm1_anm_o)
        self.t3.addAnimation(self.pm2_anm)
        self.t3.addAnimation(self.pm2_anm_o)
        self.t3.addAnimation(self.pm3_anm)
        self.t3.addAnimation(self.pm3_anm_o)

        # initial fill
        if self.pix_list:
            self.pm_list = [self.pm1, self.pm2, self.pm3]
            for i, pm in enumerate(self.pm_list):
                pixmap = Qt4Gui.QPixmap(self.pix_list[i % len(self.pix_list)])
                if not pixmap.isNull():
                    pm.add_pixmap(pixmap.scaledToWidth(640, QtCore.Qt.SmoothTransformation))

            self.previewGraphicsView.setSceneRect(self.pm1.pixmap_item.boundingRect())
            self.previewGraphicsView.fitInView(self.pm1.pixmap_item.boundingRect(), QtCore.Qt.KeepAspectRatio)

        self.imagesSlider.setValue(0)

        if not self.machine.isRunning():
            self.machine.addState(self.state1)
            self.machine.addState(self.state2)
            self.machine.addState(self.state3)
            self.machine.setInitialState(self.state1)
            self.machine.start()