コード例 #1
0
 def __init__(self, parent=None):
     QVersionTreeScene.__init__(self, parent)
     self.indicatorStart = QPlaybackVersionIndicator()
     self.indicatorStart.setPen(QtGui.QPen(QtGui.QColor(0, 128, 0), 2))
     self.indicatorEnd = QPlaybackVersionIndicator()
     self.indicatorEnd.setPen(QtGui.QPen(QtGui.QColor(128, 0, 0), 2))
     self.indicatorExtra = QPlaybackVersionIndicator()
     self.indicatorExtra.setPen(QtGui.QPen(QtGui.QColor(*(ColorByName.get_int('goldenrod_medium'))), 2))
コード例 #2
0
class TransferFunctionPoint(QtGui.QGraphicsEllipseItem):

    selection_pens = {
        True:
        QtGui.QPen(
            QtGui.QBrush(
                QtGui.QColor(*(ColorByName.get_int('goldenrod_medium')))),
            0.012),
        False:
        QtGui.QPen()
    }

    def __init__(self, scalar, opacity, color, parent=None):
        QtGui.QGraphicsEllipseItem.__init__(self, parent)
        self._scalar = scalar
        self._opacity = opacity
        self._color = QtGui.QColor(color[0] * 255, color[1] * 255,
                                   color[2] * 255)
        self.setPen(QtGui.QPen(QtGui.QColor(0, 0, 0)))
        self.setFlag(QtGui.QGraphicsItem.ItemIsMovable)
        self.setFlag(QtGui.QGraphicsItem.ItemIsSelectable)
        self.setFlag(QtGui.QGraphicsItem.ItemIsFocusable)
        self.setZValue(2.0)

        self._sx = 1.0
        self._sy = 1.0
        self._left_line = None
        self._right_line = None
        self._point = QtCore.QPointF(scalar, opacity)
        self.refresh()

        self.setToolTip("Double-click to change color\n"
                        "Right-click to remove point\n"
                        "Scalar: %.5f, Opacity: %.5f" %
                        (self._scalar, self._opacity))
        # This sets up the linked list of Lines

    def keyPressEvent(self, event):
        if event.key() == QtCore.Qt.Key_Backspace or \
           event.key() == QtCore.Qt.Key_Delete:
            self.remove_self()

    def refresh(self):
        dx = 0.025 / self._sx
        dy = 0.025 / self._sy
        # this is the setup
        self.setBrush(QtGui.QBrush(self._color))
        self.setRect(-dx, -dy, 2 * dx, 2 * dy)
        self.setPos(self._scalar, self._opacity)

    def update_scale(self, sx, sy):
        self._sx = sx
        self._sy = sy
        self.refresh()

    def itemChange(self, change, value):
        if change == QtGui.QGraphicsItem.ItemSelectedChange:
            self.setPen(self.selection_pens[value.toBool()])
        if change == QtGui.QGraphicsItem.ItemPositionChange:
            # moves point
            pt = value.toPointF()
            pt.setY(clamp(pt.y(), 0.0, 1.0))
            self._opacity = pt.y()
            self._point.setY(pt.y())
            if not self._left_line:
                pt.setX(0.0)
            elif not self._right_line:
                pt.setX(1.0)
            else:
                assert self._left_line._point_right == self
                assert self._right_line._point_left == self
                pt.setX(
                    clamp(pt.x(), self._left_line._point_left._point.x(),
                          self._right_line._point_right._point.x(), 1e-6))
                self._point.setX(pt.x())
                self._scalar = pt.x()
            if self._left_line:
                self._left_line.refresh()
            if self._right_line:
                self._right_line.refresh()
            if self.scene():
                self.scene()._tf_poly.setup()
            self.setToolTip("Double-click to change color\n"
                            "Right-click to remove point\n"
                            "Scalar: %.5f, Opacity: %.5f" %
                            (self._scalar, self._opacity))
            return QtGui.QGraphicsItem.itemChange(self, change,
                                                  QtCore.QVariant(pt))
        return QtGui.QGraphicsItem.itemChange(self, change, value)

    def remove_self(self):
        if not self._left_line or not self._right_line:
            # Ignore, self is a corner node that can't be removed
            return

        # Removes the right line and self, re-ties data structure
        self._left_line._point_right = self._right_line._point_right
        self._left_line._point_right._left_line = self._left_line

        # be friends with garbage collector
        self._right_line._point_left = None
        self._right_line._point_right = None
        self.scene()._tf_poly.setup()
        self.scene().removeItem(self._right_line)
        self.scene().removeItem(self)
        self._left_line.refresh()

    def mouseDoubleClickEvent(self, event):
        new_color = QtGui.QColorDialog.getColor(self._color)
        if not new_color.isValid():
            return
        self._color = new_color
        if self._left_line:
            self._left_line.refresh()
        if self._right_line:
            self._right_line.refresh()
        self.refresh()
        self.scene()._tf_poly.setup()

    def mousePressEvent(self, event):
        if event.button() == QtCore.Qt.RightButton:
            event.accept()
            self.remove_self()
        else:
            QtGui.QGraphicsEllipseItem.mousePressEvent(self, event)

    def add_self_to_transfer_function(self, tf):
        tf.add_point(
            self._scalar, self._opacity,
            (self._color.redF(), self._color.greenF(), self._color.blueF()))
コード例 #3
0
ファイル: theme.py プロジェクト: painter1/vistrails
    def __init__(self):
        """ DefaultTheme() -> DefaultTheme
        This is for initializing all Qt objects
        
        """
        DefaultCoreTheme.__init__(self)
        ######################
        #### MEASUREMENTS ####

        # Port Shape
        self.PORT_RECT = QtCore.QRectF(0, 0, self.PORT_WIDTH, self.PORT_HEIGHT)

        # Configure button shape
        self.CONFIGURE_SHAPE = _create_configure_shape(self.CONFIGURE_WIDTH,
                                                       self.CONFIGURE_HEIGHT)

        #### BRUSH & PEN ####
        # Background brush of the pipeline view
        # self.PIPELINE_VIEW_BACKGROUND_BRUSH = QtGui.QBrush(
        #     QtGui.QImage(core.system.vistrails_root_directory() +
        #                  '/gui/resources/images/pipeline_bg.png'))
        #     #QtGui.QColor("white"))
        # # Background brush of the version tree
        # self.VERSION_TREE_BACKGROUND_BRUSH = QtGui.QBrush(
        #     QtGui.QImage(core.system.vistrails_root_directory() +
        #                  '/gui/resources/images/version_bg.png'))
        # Background brush of the query pipeline view
        # self.QUERY_BACKGROUND_BRUSH = QtGui.QBrush(
        #     QtGui.QImage(core.system.vistrails_root_directory() +
        #                  '/gui/resources/images/query_bg.png'))
        self.PIPELINE_VIEW_BACKGROUND_BRUSH = QtGui.QBrush(
            QtGui.QColor(128, 128, 128))
        self.VERSION_TREE_BACKGROUND_BRUSH = QtGui.QBrush(
            QtGui.QColor(240, 240, 240))
        self.QUERY_BACKGROUND_BRUSH = QtGui.QBrush(QtGui.QColor(119, 143, 159))
        self.QUERY_RESULT_BACKGROUND_BRUSH = QtGui.QBrush(
            QtGui.QColor(208, 226, 239))

        # Pen to draw a module shape at regular state
        self.MODULE_PEN = QtGui.QPen(
            QtGui.QBrush(QtGui.QColor(*(ColorByName.get_int('black')))), 2)
        # Pen to draw a module shape when selected
        self.MODULE_SELECTED_PEN = QtGui.QPen(
            QtGui.QBrush(
                QtGui.QColor(*(ColorByName.get_int('goldenrod_medium')))), 3)
        # Brush and pen to draw a module label
        self.MODULE_LABEL_PEN = QtGui.QPen(
            QtGui.QBrush(QtGui.QColor(*(ColorByName.get_int('black')))), 2)
        self.MODULE_LABEL_SELECTED_PEN = QtGui.QPen(
            QtGui.QBrush(QtGui.QColor(*(ColorByName.get_int('black')))), 2)
        # Brush to draw a module shape at different states
        self.MODULE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('light_grey'))))
        self.ERROR_MODULE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('salmon'))))
        self.SUCCESS_MODULE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('mint'))))
        self.ACTIVE_MODULE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('navajo_white'))))
        self.COMPUTING_MODULE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('yellow'))))
        self.NOT_EXECUTED_MODULE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('light_goldenrod'))))
        self.PERSISTENT_MODULE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('slate_blue'))))
        self.SUSPENDED_MODULE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('aureoline_yellow'))))

        self.INVALID_MODULE_PEN = QtGui.QPen(
            QtGui.QBrush(QtGui.QColor(51, 51, 51, 255)), 2)
        self.INVALID_MODULE_LABEL_PEN = QtGui.QPen(
            QtGui.QBrush(QtGui.QColor(51, 51, 51, 255)), 2)
        self.INVALID_MODULE_BRUSH = QtGui.QBrush(QtGui.QColor(
            125, 92, 92, 255))

        # Pen and brush for un-matched queried modules
        self.GHOSTED_MODULE_PEN = QtGui.QPen(
            QtGui.QBrush(
                QtGui.QColor(*(ColorByName.get_int('dark_dim_grey')))), 2)
        # Pen to draw module label when it is unmatched due to a query
        self.GHOSTED_MODULE_LABEL_PEN = QtGui.QPen(
            QtGui.QBrush(
                QtGui.QColor(*(ColorByName.get_int('dark_dim_grey')))), 2)
        self.GHOSTED_MODULE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('light_dim_grey'))))

        # Pen and brush for breakpoint modules
        self.BREAKPOINT_MODULE_PEN = QtGui.QPen(
            QtGui.QBrush(
                QtGui.QColor(*(ColorByName.get_int('dark_dim_grey')))), 2)
        self.BREAKPOINT_MODULE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('light_dim_grey'))))
        self.BREAKPOINT_MODULE_LABEL_PEN = QtGui.QPen(
            QtGui.QBrush(
                QtGui.QColor(*(ColorByName.get_int('dark_dim_grey')))), 2)

        # Module pen styles
        self.ABSTRACTION_PEN = QtGui.QPen(
            QtGui.QBrush(QtGui.QColor(*(ColorByName.get_int('black')))), 2,
            QtCore.Qt.DotLine)
        self.GROUP_PEN = QtGui.QPen(
            QtGui.QBrush(QtGui.QColor(*(ColorByName.get_int('black')))), 2,
            QtCore.Qt.DashLine)

        # Brush and pen to draw a port shape at regular state
        self.PORT_PEN = QtGui.QPen(
            QtGui.QBrush(QtGui.QColor(*(ColorByName.get_int('black')))), 1)
        self.PORT_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('light_grey'))))
        self.PORT_FILLED_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('goldenrod_medium'))))
        self.PORT_SELECTED_PEN = QtGui.QPen(
            QtGui.QBrush(
                QtGui.QColor(*(ColorByName.get_int('goldenrod_medium')))), 3)
        self.PORT_OPTIONAL_PEN = QtGui.QPen(
            QtGui.QBrush(QtGui.QColor(*(ColorByName.get_int('lamp_black')))),
            1)
        self.PORT_OPTIONAL_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('titanium_white'))))

        # Pen and brush for drawing ports of ghosted modules
        self.GHOSTED_PORT_PEN = QtGui.QPen(
            QtGui.QBrush(
                QtGui.QColor(*(ColorByName.get_int('dark_dim_grey')))), 2)
        self.GHOSTED_PORT_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('light_dim_grey'))))

        self.INVALID_PORT_PEN = QtGui.QPen(
            QtGui.QBrush(QtGui.QColor(51, 51, 51, 255)), 2)
        self.INVALID_PORT_BRUSH = QtGui.QBrush(QtGui.QColor(125, 92, 92, 255))

        # Pen and brush for drawing the configure button
        self.CONFIGURE_PEN = QtGui.QPen(
            QtGui.QBrush(QtGui.QColor(*(ColorByName.get_int('black')))), 1)
        self.CONFIGURE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black'))))

        # Pen and brush for drawing the ghosted configure button
        self.GHOSTED_CONFIGURE_PEN = QtGui.QPen(
            QtGui.QBrush(
                QtGui.QColor(*(ColorByName.get_int('dark_dim_grey')))), 2)
        self.GHOSTED_CONFIGURE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('dark_dim_grey'))))

        # Brush and pen to draw connections
        self.CONNECTION_PEN = QtGui.QPen(
            QtGui.QBrush(QtGui.QColor(*(ColorByName.get_int('black')))), 2)
        self.CONNECTION_SELECTED_PEN = QtGui.QPen(
            QtGui.QBrush(
                QtGui.QColor(*(ColorByName.get_int('goldenrod_medium')))), 3)
        self.CONNECTION_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black'))))

        # Pen for drawing while connecting any ghosted modules
        self.GHOSTED_CONNECTION_PEN = QtGui.QPen(
            QtGui.QBrush(
                QtGui.QColor(*(ColorByName.get_int('dark_dim_grey')))), 2)

        # Pen to draw version tree node
        self.VERSION_PEN = QtGui.QPen(
            QtGui.QBrush(QtGui.QColor(*(ColorByName.get_int('black')))), 2)
        self.GHOSTED_VERSION_PEN = QtGui.QPen(
            QtGui.QBrush(QtGui.QColor(*(ColorByName.get_int('light_grey')))),
            2)
        self.VERSION_SELECTED_PEN = QtGui.QPen(
            QtGui.QBrush(
                QtGui.QColor(*(ColorByName.get_int('goldenrod_medium')))), 4)

        self.VERSION_LABEL_COLOR = \
            QtGui.QColor(*(ColorByName.get_int('black')))
        self.GHOSTED_VERSION_LABEL_COLOR = \
            QtGui.QColor(*(ColorByName.get_int('light_grey')))

        # Brush to draw version belongs to the current user
        self.VERSION_USER_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('desatcornflower'))))
        self.GHOSTED_VERSION_USER_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('very_light_grey'))))

        # Brush to draw version belongs to the other users
        self.VERSION_OTHER_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('melon'))))

        # Brush and pen to draw a link between two versions
        self.LINK_PEN = QtGui.QPen(
            QtGui.QBrush(QtGui.QColor(*(ColorByName.get_int('black')))), 1.5)
        self.LINK_SELECTED_PEN = QtGui.QPen(
            QtGui.QBrush(
                QtGui.QColor(*(ColorByName.get_int('goldenrod_medium')))), 3)
        self.GHOSTED_LINK_PEN = QtGui.QPen(
            QtGui.QBrush(QtGui.QColor(*(ColorByName.get_int('light_grey')))),
            2)

        # Selection box color
        self.SELECTION_BOX_BRUSH = QtGui.QBrush(
            QtGui.QColor(*ColorByName.get_int('light_grey')))
        self.SELECTION_BOX_PEN = QtGui.QPen(
            QtGui.QBrush(QtGui.QColor(*ColorByName.get_int('lamp_black'))), 1)

        # Color of the version is being diff from in
        self.VISUAL_DIFF_FROM_VERSION_BRUSH = QtGui.QBrush(
            QtGui.QColor(*ColorByName.get_int('melon')))

        # Color of the version is being diff to in
        self.VISUAL_DIFF_TO_VERSION_BRUSH = QtGui.QBrush(
            QtGui.QColor(*ColorByName.get_int('steel_blue_light')))

        # Color of the paramter changed modules in Visual Diff
        self.VISUAL_DIFF_PARAMETER_CHANGED_BRUSH = QtGui.QBrush(
            QtGui.QColor(*ColorByName.get_int('light_grey')))

        # Color of the shared modules in Visual Diff
        self.VISUAL_DIFF_SHARED_BRUSH = QtGui.QBrush(
            QtGui.QColor(155, 155, 155, 255))

        # Color of shared modules in Visual Diff matched by heuristic
        self.VISUAL_DIFF_MATCH_BRUSH = QtGui.QBrush(
            QtGui.QColor(*ColorByName.get_int('white')))

        # Color of partially shared modules in Visual Diff
        self.VISUAL_DIFF_SUMMARY_BRUSH = QtGui.QBrush(
            QtGui.QColor(*ColorByName.get_int('spring_green')))

        # Pen & Brush of the circled id on the right corner of the
        # virtual cell label
        self.ANNOTATED_ID_PEN = QtGui.QPen(QtCore.Qt.white)
        self.ANNOTATED_ID_BRUSH = QtGui.QBrush(QtGui.QColor(157, 0, 0, 255))

        #### FONTS ####
        # Font for module text
        self.MODULE_FONT = QtGui.QFont("Arial", 14, QtGui.QFont.Bold)
        self.MODULE_FONT_METRIC = QtGui.QFontMetrics(self.MODULE_FONT)
        self.MODULE_DESC_FONT = QtGui.QFont("Arial", 12)
        self.MODULE_DESC_FONT_METRIC = QtGui.QFontMetrics(
            self.MODULE_DESC_FONT)

        # Font for version text
        self.VERSION_FONT = QtGui.QFont("Arial", 15, QtGui.QFont.Bold)
        self.VERSION_FONT_METRIC = QtGui.QFontMetrics(self.VERSION_FONT)
        self.VERSION_DESCRIPTION_FONT = QtGui.QFont("Arial", 15,
                                                    QtGui.QFont.Normal, True)
        self.VERSION_DESCRIPTION_FONT_METRIC = \
            QtGui.QFontMetrics(self.VERSION_DESCRIPTION_FONT)
        self.VERSION_PROPERTIES_FONT = QtGui.QFont("Arial", 12)
        self.VERSION_PROPERTIES_FONT_METRIC = \
            QtGui.QFontMetrics(self.VERSION_PROPERTIES_FONT)
        self.VERSION_PROPERTIES_PEN = QtGui.QBrush(
            QtGui.QColor(20, 100, 20, 255))

        # Font showing on the Parameter Inspector window of Visual Diff
        self.VISUAL_DIFF_PARAMETER_FONT = QtGui.QFont('Arial', 10)

        # Font showing on the Legend window of Visual Diff
        self.VISUAL_DIFF_LEGEND_FONT = QtGui.QFont('Arial', 9)

        # Font for PythonSource
        self.PYTHON_SOURCE_EDITOR_FONT = QtGui.QFont('Courier', 10,
                                                     QtGui.QFont.Normal)
        # Font for Splash Screen messages
        self.SPLASH_SCREEN_FONT = QtGui.QFont('Arial', 10, QtGui.QFont.Normal)
        #### ICONS & IMAGES ####
        #The application disclaimer image
        self.DISCLAIMER_IMAGE = QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/disclaimer.png')
        #The application icon
        self.APPLICATION_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/uvcdat-icon.png')

        #The application pixmap
        self.APPLICATION_PIXMAP = QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/vistrails_icon_small.png')

        # The execute icons in the first spot of vistrail view toolbar
        self.EXECUTE_PIPELINE_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/execute.png')
        self.EXECUTE_EXPLORE_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/execute_explore.png')

        # The undo icons for the vistrail view toolbar
        self.UNDO_ICON = QtGui.QIcon(core.system.vistrails_root_directory() +
                                     '/gui/resources/images/undo.png')

        # The redo icons for the vistrail view toolbar
        self.REDO_ICON = QtGui.QIcon(core.system.vistrails_root_directory() +
                                     '/gui/resources/images/redo.png')

        # Icon to select the tabbed view
        self.TABBED_VIEW_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/tabbed_view.png')

        # Icon to select the horizontal split view
        self.HORIZONTAL_VIEW_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/hor_view.png')

        # Icon to select the vertical split view
        self.VERTICAL_VIEW_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/ver_view.png')

        # Icon to select the docking-style view
        self.DOCK_VIEW_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/dock_view.png')

        # Toolbar icon for creating a new Vistrail
        self.NEW_VISTRAIL_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/new_vistrail.png')

        # Toolbar icon for opening a vistrail
        self.OPEN_VISTRAIL_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/open_vistrail.png')

        #Toolbar icon for opening a vistrail from a database
        self.OPEN_VISTRAIL_DB_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/openfromdb.png')

        #Icon for database connections
        self.DB_ICON = QtGui.QIcon(core.system.vistrails_root_directory() +
                                   '/gui/resources/images/database.png')

        #Icon for vistrails files
        self.FILE_ICON = QtGui.QIcon(core.system.vistrails_root_directory() +
                                     '/gui/resources/images/file.png')

        # Toolbar icon for save the current Vistrail
        self.SAVE_VISTRAIL_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/save_vistrail.png')

        # Toolbar icon for toggling console mode window
        self.CONSOLE_MODE_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/console.png')

        # Background image of the Visual Diff pipeline view
        self.VISUAL_DIFF_BACKGROUND_IMAGE = QtGui.QImage(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/pipeline_bg.png')

        # Toolbar icon for showing the Parameter Inspector window
        self.VISUAL_DIFF_SHOW_PARAM_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/show_params.png')

        # Toolbar icon for showing the Legend window
        self.VISUAL_DIFF_SHOW_LEGEND_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/show_legends.png')

        # Toolbar icon for creating an analogy
        self.VISUAL_DIFF_CREATE_ANALOGY_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/analogy.png')

        # Toolbar icon for close button on the vistrail tabbar
        self.VIEW_MANAGER_CLOSE_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/closeview.png')

        # Toolbar icon for the dock toolbutton on the splitted window
        self.DOCK_BACK_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/dockback.png')

        # Icon for adding string in the parameter exploration widget
        self.ADD_STRING_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/edit_add.png')

        # Icon for moving string up in the parameter exploration widget
        self.UP_STRING_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/up.png')

        # Icon for moving string up in the parameter exploration widget
        self.DOWN_STRING_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/down.png')

        # Icon for expand all/collapse all buttons in the Module Palette
        self.EXPAND_ALL_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/expand_all.png')

        self.COLLAPSE_ALL_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/collapse_all.png')

        # Icons for tree/list view buttons in the Workspace
        self.LIST_VIEW_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/list_view.png')

        self.TREE_VIEW_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/tree_view.png')

        # Toolbar icons for views
        self.PIPELINE_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/pipeline.png')
        self.HISTORY_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/history.png')
        self.QUERY_ICON = QtGui.QIcon(core.system.vistrails_root_directory() +
                                      '/gui/resources/images/full_tree.png')
        self.EXPLORE_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/explore.png')
        self.PROVENANCE_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/search_database.png')

        # Toolbar icon for visual query on a vistrail
        self.VISUAL_QUERY_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/visual_query.png')

        # Toolbar icon for viewing the whole version tree
        self.VIEW_FULL_TREE_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/full_tree.png')

        # Toolbar icon for viewing the whole version tree
        self.PERFORM_PARAMETER_EXPLORATION_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/perform_pe.png')

        # Toolbar icon for dragging pixmap of VisDiff
        self.VERSION_DRAG_PIXMAP = QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/dragging.png')

        #Tabbar icon for detach a tab
        self.DETACH_TAB_ICON = QtGui.QIcon()
        self.DETACH_TAB_ICON.addFile(core.system.vistrails_root_directory() +
                                     '/gui/resources/images/detach.png',
                                     mode=QtGui.QIcon.Normal)
        self.DETACH_TAB_ICON.addFile(core.system.vistrails_root_directory() +
                                     '/gui/resources/images/detach_on.png',
                                     mode=QtGui.QIcon.Active)

        #toolbutton icon for pin/unpin palette
        self.PINNED_PALETTE_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/pinned.png')
        self.UNPINNED_PALETTE_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/unpinned.png')
        # Parameter Exploration Pixmaps
        self.EXPLORE_COLUMN_PIXMAP = QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/column.png')
        self.EXPLORE_ROW_PIXMAP = QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/row.png')
        self.EXPLORE_SHEET_PIXMAP = QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/sheet.png')
        self.EXPLORE_TIME_PIXMAP = QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/time.png')
        self.EXPLORE_SKIP_PIXMAP = QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/skip.png')
        self.REMOVE_PARAM_PIXMAP = QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/remove_param.png')
        self.RIGHT_ARROW_PIXMAP = QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/right.png')

        # Cursor for zoom in/out graphics views
        self.SELECT_CURSOR = QtGui.QCursor(QtCore.Qt.ArrowCursor)
        self.OPEN_HAND_CURSOR = QtGui.QCursor(
            QtGui.QPixmap(core.system.vistrails_root_directory() +
                          '/gui/resources/images/open_hand.png'))
        self.CLOSE_HAND_CURSOR = QtGui.QCursor(
            QtGui.QPixmap(core.system.vistrails_root_directory() +
                          '/gui/resources/images/close_hand.png'))
        self.ZOOM_CURSOR = QtGui.QCursor(
            QtGui.QPixmap(core.system.vistrails_root_directory() +
                          '/gui/resources/images/zoom.png'))

        # Cursor icon for zoom in/out graphics views
        self.SELECT_ICON = QtGui.QIcon(
            QtGui.QPixmap(core.system.vistrails_root_directory() +
                          '/gui/resources/images/select_icon.png'))
        self.PAN_ICON = QtGui.QIcon(
            QtGui.QPixmap(core.system.vistrails_root_directory() +
                          '/gui/resources/images/pan_icon.png'))
        self.ZOOM_ICON = QtGui.QIcon(
            QtGui.QPixmap(core.system.vistrails_root_directory() +
                          '/gui/resources/images/zoom_icon.png'))

        # Mashup Icons
        self.EXECUTE_MASHUP_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/mashup_execute.png')
        self.MASHUP_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/mashup_create.png')
        self.MASHUP_ALIAS_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/alias.png')

        # Saved Queries icons
        self.QUERY_VIEW_ICON = self.ZOOM_ICON
        self.QUERY_ARROW_ICON = QtGui.QIcon(
            QtGui.QPixmap(core.system.vistrails_root_directory() +
                          '/gui/resources/images/zoom_arrow_icon.png'))
        self.QUERY_EDIT_ICON = QtGui.QIcon(
            QtGui.QPixmap(core.system.vistrails_root_directory() +
                          '/gui/resources/images/edit.png'))

        #### COLORS ####
        # Color for the PIP frame
        self.PIP_FRAME_COLOR = QtGui.QColor(
            *(ColorByName.get_int('yellow_light')))

        # Color of selected methods in the modules method area
        self.METHOD_SELECT_COLOR = QtGui.QColor(
            *ColorByName.get_int('yellow_light'))

        # Color of the hover/unhover alias labels
        self.HOVER_DEFAULT_COLOR = QtGui.QColor(*ColorByName.get_int('black'))
        self.HOVER_SELECT_COLOR = QtGui.QColor(*ColorByName.get_int('blue'))

        # colors for debug messages
        #self.DEBUG_INFO_COLOR = QtGui.QColor(QtCore.Qt.darkGray)
        #self.DEBUG_WARNING_COLOR = QtGui.QColor(QtCore.Qt.black)
        self.DEBUG_INFO_COLOR = QtGui.QColor(QtCore.Qt.black)
        self.DEBUG_WARNING_COLOR = QtGui.QColor("#707000")
        self.DEBUG_CRITICAL_COLOR = QtGui.QColor(QtCore.Qt.red)

        class QTransparentColor(QtGui.QColor):
            def name(self):
                return 'transparent'

        self.DEBUG_FILTER_BACKGROUND_COLOR = QTransparentColor("transparent")
コード例 #4
0
ファイル: theme.py プロジェクト: imclab/vistrails
    def __init__(self):
        """ DefaultTheme() -> DefaultTheme
        This is for initializing all Qt objects
        
        """
        DefaultCoreTheme.__init__(self)
        ######################
        #### MEASUREMENTS ####

        # Port Shape
        self.PORT_RECT = QtCore.QRectF(0, 0, self.PORT_WIDTH, self.PORT_HEIGHT)

        # Configure button shape
        self.CONFIGURE_SHAPE = _create_configure_shape(self.CONFIGURE_WIDTH,
                                                       self.CONFIGURE_HEIGHT)

        #### BRUSH & PEN ####
        # Background brush of the pipeline view
        # self.PIPELINE_VIEW_BACKGROUND_BRUSH = QtGui.QBrush(
        #     QtGui.QImage(core.system.vistrails_root_directory() +
        #                  '/gui/resources/images/pipeline_bg.png'))
        #     #QtGui.QColor("white"))
        # # Background brush of the version tree
        # self.VERSION_TREE_BACKGROUND_BRUSH = QtGui.QBrush(
        #     QtGui.QImage(core.system.vistrails_root_directory() +
        #                  '/gui/resources/images/version_bg.png'))
        # Background brush of the query pipeline view
        # self.QUERY_BACKGROUND_BRUSH = QtGui.QBrush(
        #     QtGui.QImage(core.system.vistrails_root_directory() +
        #                  '/gui/resources/images/query_bg.png'))
        self.PIPELINE_VIEW_BACKGROUND_BRUSH = QtGui.QBrush(
            QtGui.QColor(128, 128, 128))
        self.VERSION_TREE_BACKGROUND_BRUSH = QtGui.QBrush(
            QtGui.QColor(240, 240, 240))
        self.QUERY_BACKGROUND_BRUSH = QtGui.QBrush(
            QtGui.QColor(119, 143, 159))
        self.QUERY_RESULT_BACKGROUND_BRUSH = QtGui.QBrush(
            QtGui.QColor(208, 226, 239))

        # Pen to draw a module shape at regular state
        self.MODULE_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black')))), 2)
        # Pen to draw a module shape when selected
        self.MODULE_SELECTED_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('goldenrod_medium')))), 3)
        # Brush and pen to draw a module label
        self.MODULE_LABEL_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black')))), 2)
        self.MODULE_LABEL_SELECTED_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black')))), 2)
        # Brush to draw a module shape at different states
        self.MODULE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('light_grey'))))
        self.ERROR_MODULE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('salmon'))))
        self.SUCCESS_MODULE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('mint'))))
        self.ACTIVE_MODULE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('navajo_white'))))
        self.COMPUTING_MODULE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('yellow'))))
        self.NOT_EXECUTED_MODULE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('light_goldenrod'))))
        self.PERSISTENT_MODULE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('slate_blue'))))
        self.SUSPENDED_MODULE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('aureoline_yellow'))))

        self.INVALID_MODULE_PEN = QtGui.QPen(QtGui.QBrush(
                QtGui.QColor(51, 51, 51, 255)), 2)
        self.INVALID_MODULE_LABEL_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(51, 51, 51, 255)), 2)
        self.INVALID_MODULE_BRUSH = QtGui.QBrush(
            QtGui.QColor(125, 92, 92, 255))

        # Pen and brush for un-matched queried modules
        self.GHOSTED_MODULE_PEN = QtGui.QPen(QtGui.QBrush(
                QtGui.QColor(*(ColorByName.get_int('dark_dim_grey')))), 2)
        # Pen to draw module label when it is unmatched due to a query
        self.GHOSTED_MODULE_LABEL_PEN = QtGui.QPen(QtGui.QBrush(
                QtGui.QColor(*(ColorByName.get_int('dark_dim_grey')))), 2)
        self.GHOSTED_MODULE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('light_dim_grey'))))

        # Pen and brush for breakpoint modules
        self.BREAKPOINT_MODULE_PEN = QtGui.QPen(QtGui.QBrush(
                QtGui.QColor(*(ColorByName.get_int('dark_dim_grey')))), 2)
        self.BREAKPOINT_MODULE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('light_dim_grey'))))
        self.BREAKPOINT_MODULE_LABEL_PEN = QtGui.QPen(QtGui.QBrush(
                QtGui.QColor(*(ColorByName.get_int('dark_dim_grey')))), 2)

        # Module pen styles
        self.ABSTRACTION_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black')))), 2,
                                          QtCore.Qt.DotLine)
        self.GROUP_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black')))), 2,
                                          QtCore.Qt.DashLine)

        # Brush and pen to draw a port shape at regular state
        self.PORT_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black')))), 1)
        self.PORT_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('light_grey'))))
        self.PORT_FILLED_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('goldenrod_medium'))))
        self.PORT_SELECTED_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('goldenrod_medium')))), 3)
        self.PORT_OPTIONAL_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('lamp_black')))), 1)
        self.PORT_OPTIONAL_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('titanium_white'))))
        
        # Pen and brush for drawing ports of ghosted modules
        self.GHOSTED_PORT_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('dark_dim_grey')))), 2)
        self.GHOSTED_PORT_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('light_dim_grey'))))

        self.INVALID_PORT_PEN = QtGui.QPen(QtGui.QBrush(
                QtGui.QColor(51, 51, 51, 255)), 2)
        self.INVALID_PORT_BRUSH = QtGui.QBrush(
            QtGui.QColor(125, 92, 92, 255))

        # Pen and brush for drawing the configure button
        self.CONFIGURE_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black')))), 1)
        self.CONFIGURE_BRUSH= QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black'))))

        # Pen and brush for drawing the ghosted configure button
        self.GHOSTED_CONFIGURE_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('dark_dim_grey')))), 2)
        self.GHOSTED_CONFIGURE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('dark_dim_grey'))))

        # Brush and pen to draw connections
        self.CONNECTION_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black')))), 2)
        self.CONNECTION_SELECTED_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('goldenrod_medium')))), 3)
        self.CONNECTION_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black'))))

        # Pen for drawing while connecting any ghosted modules
        self.GHOSTED_CONNECTION_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('dark_dim_grey')))), 2)

        # Pen to draw version tree node
        self.VERSION_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black')))), 2)    
        self.GHOSTED_VERSION_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('light_grey')))), 2)    
        self.VERSION_SELECTED_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('goldenrod_medium')))), 4)

        self.VERSION_LABEL_COLOR = \
            QtGui.QColor(*(ColorByName.get_int('black')))
        self.GHOSTED_VERSION_LABEL_COLOR = \
            QtGui.QColor(*(ColorByName.get_int('light_grey')))

        # Brush to draw version belongs to the current user
        self.VERSION_USER_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('desatcornflower'))))
        self.GHOSTED_VERSION_USER_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('very_light_grey'))))

        # Brush to draw version belongs to the other users
        self.VERSION_OTHER_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('melon'))))
    
        # Brush and pen to draw a link between two versions
        self.LINK_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black')))), 1.5)
        self.LINK_SELECTED_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('goldenrod_medium')))), 3)
        self.GHOSTED_LINK_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('light_grey')))), 2)

        # Selection box color
        self.SELECTION_BOX_BRUSH = QtGui.QBrush(
            QtGui.QColor(*ColorByName.get_int('light_grey')))
        self.SELECTION_BOX_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*ColorByName.get_int('lamp_black'))), 1)
        
        # Color of the version is being diff from in
        self.VISUAL_DIFF_FROM_VERSION_BRUSH = QtGui.QBrush(
            QtGui.QColor(*ColorByName.get_int('melon')))
        
        # Color of the version is being diff to in
        self.VISUAL_DIFF_TO_VERSION_BRUSH = QtGui.QBrush(
            QtGui.QColor(*ColorByName.get_int('steel_blue_light')))
        
        # Color of the paramter changed modules in Visual Diff
        self.VISUAL_DIFF_PARAMETER_CHANGED_BRUSH = QtGui.QBrush(
            QtGui.QColor(*ColorByName.get_int('light_grey')))
        
        # Color of the shared modules in Visual Diff
        self.VISUAL_DIFF_SHARED_BRUSH = QtGui.QBrush(
            QtGui.QColor(155, 155, 155, 255))

        # Color of shared modules in Visual Diff matched by heuristic
        self.VISUAL_DIFF_MATCH_BRUSH = QtGui.QBrush(
            QtGui.QColor(*ColorByName.get_int('white')))
        
        # Color of partially shared modules in Visual Diff
        self.VISUAL_DIFF_SUMMARY_BRUSH = QtGui.QBrush(
            QtGui.QColor(*ColorByName.get_int('spring_green')))

        # Pen & Brush of the circled id on the right corner of the
        # virtual cell label
        self.ANNOTATED_ID_PEN = QtGui.QPen(
            QtCore.Qt.white)
        self.ANNOTATED_ID_BRUSH = QtGui.QBrush(
            QtGui.QColor(157, 0, 0, 255))
    
        #### FONTS ####        
        # Font for module text
        self.MODULE_FONT = QtGui.QFont("Arial", 14, QtGui.QFont.Bold)
        self.MODULE_FONT_METRIC = QtGui.QFontMetrics(self.MODULE_FONT)
        self.MODULE_DESC_FONT = QtGui.QFont("Arial", 12)
        self.MODULE_DESC_FONT_METRIC = QtGui.QFontMetrics(self.MODULE_DESC_FONT)
    
        # Font for version text
        self.VERSION_FONT = QtGui.QFont("Arial", 15, QtGui.QFont.Bold)
        self.VERSION_FONT_METRIC = QtGui.QFontMetrics(self.VERSION_FONT)
        self.VERSION_DESCRIPTION_FONT = QtGui.QFont("Arial", 15, QtGui.QFont.Normal, 
                                                    True)
        self.VERSION_DESCRIPTION_FONT_METRIC = \
            QtGui.QFontMetrics(self.VERSION_DESCRIPTION_FONT)
        self.VERSION_PROPERTIES_FONT = QtGui.QFont("Arial", 12)
        self.VERSION_PROPERTIES_FONT_METRIC = \
            QtGui.QFontMetrics(self.VERSION_PROPERTIES_FONT)
        self.VERSION_PROPERTIES_PEN =  QtGui.QBrush(
            QtGui.QColor(20, 100, 20, 255))
            

        # Font showing on the Parameter Inspector window of Visual Diff
        self.VISUAL_DIFF_PARAMETER_FONT = QtGui.QFont('Arial', 10)
        
        # Font showing on the Legend window of Visual Diff
        self.VISUAL_DIFF_LEGEND_FONT = QtGui.QFont('Arial', 9)

        # Font for PythonSource
        self.PYTHON_SOURCE_EDITOR_FONT = QtGui.QFont('Courier', 10, 
                                                     QtGui.QFont.Normal)
        # Font for Splash Screen messages
        self.SPLASH_SCREEN_FONT = QtGui.QFont('Arial', 10,
                                              QtGui.QFont.Normal)
        #### ICONS & IMAGES ####
        #The application disclaimer image
        self.DISCLAIMER_IMAGE = QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/disclaimer.png')
        #The application icon
        self.APPLICATION_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/uvcdat-icon.png')

        #The application pixmap
        self.APPLICATION_PIXMAP = QtGui.QPixmap(
             core.system.vistrails_root_directory() +
            '/gui/resources/images/vistrails_icon_small.png')

        # The execute icons in the first spot of vistrail view toolbar
        self.EXECUTE_PIPELINE_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/execute.png')
        self.EXECUTE_EXPLORE_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/execute_explore.png')

        # The undo icons for the vistrail view toolbar
        self.UNDO_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/undo.png')

        # The redo icons for the vistrail view toolbar
        self.REDO_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/redo.png')

        # Icon to select the tabbed view
        self.TABBED_VIEW_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/tabbed_view.png')
    
        # Icon to select the horizontal split view
        self.HORIZONTAL_VIEW_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/hor_view.png')
    
        # Icon to select the vertical split view
        self.VERTICAL_VIEW_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/ver_view.png')
    
        # Icon to select the docking-style view
        self.DOCK_VIEW_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/dock_view.png')
    
        # Toolbar icon for creating a new Vistrail
        self.NEW_VISTRAIL_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/new_vistrail.png')
        
        # Toolbar icon for opening a vistrail
        self.OPEN_VISTRAIL_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/open_vistrail.png')

        #Toolbar icon for opening a vistrail from a database
        self.OPEN_VISTRAIL_DB_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/openfromdb.png')

        #Icon for database connections
        self.DB_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/database.png')

        #Icon for vistrails files
        self.FILE_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/file.png')
        
        # Toolbar icon for save the current Vistrail
        self.SAVE_VISTRAIL_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/save_vistrail.png')
    
        # Toolbar icon for toggling console mode window
        self.CONSOLE_MODE_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/console.png')

        # Background image of the Visual Diff pipeline view
        self.VISUAL_DIFF_BACKGROUND_IMAGE = QtGui.QImage(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/pipeline_bg.png')
        
        # Toolbar icon for showing the Parameter Inspector window
        self.VISUAL_DIFF_SHOW_PARAM_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/show_params.png')
        
        # Toolbar icon for showing the Legend window
        self.VISUAL_DIFF_SHOW_LEGEND_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/show_legends.png')

        # Toolbar icon for creating an analogy
        self.VISUAL_DIFF_CREATE_ANALOGY_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/analogy.png')

        # Toolbar icon for close button on the vistrail tabbar
        self.VIEW_MANAGER_CLOSE_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/closeview.png')

        # Toolbar icon for the dock toolbutton on the splitted window
        self.DOCK_BACK_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/dockback.png')

        # Icon for adding string in the parameter exploration widget
        self.ADD_STRING_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/edit_add.png')

        # Icon for moving string up in the parameter exploration widget
        self.UP_STRING_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/up.png')

        # Icon for moving string up in the parameter exploration widget
        self.DOWN_STRING_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/down.png')

        # Icon for expand all/collapse all buttons in the Module Palette
        self.EXPAND_ALL_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/expand_all.png')
        
        self.COLLAPSE_ALL_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/collapse_all.png')
        
        # Icons for tree/list view buttons in the Workspace
        self.LIST_VIEW_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/list_view.png')
        
        self.TREE_VIEW_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/tree_view.png')

        # Toolbar icons for views
        self.PIPELINE_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/pipeline.png')
        self.HISTORY_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/history.png')
        self.QUERY_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/full_tree.png')
        self.EXPLORE_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/explore.png')
        self.PROVENANCE_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/search_database.png')

        # Toolbar icon for visual query on a vistrail
        self.VISUAL_QUERY_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/visual_query.png')
        
        # Toolbar icon for viewing the whole version tree
        self.VIEW_FULL_TREE_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/full_tree.png')

        # Toolbar icon for viewing the whole version tree
        self.PERFORM_PARAMETER_EXPLORATION_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/perform_pe.png')

        # Toolbar icon for dragging pixmap of VisDiff
        self.VERSION_DRAG_PIXMAP = QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/dragging.png')

        #Tabbar icon for detach a tab        
        self.DETACH_TAB_ICON = QtGui.QIcon()
        self.DETACH_TAB_ICON.addFile(core.system.vistrails_root_directory() +
                                     '/gui/resources/images/detach.png',
                                     mode=QtGui.QIcon.Normal)
        self.DETACH_TAB_ICON.addFile(core.system.vistrails_root_directory() +
                                     '/gui/resources/images/detach_on.png',
                                     mode=QtGui.QIcon.Active)

        #toolbutton icon for pin/unpin palette
        self.PINNED_PALETTE_ICON = QtGui.QIcon(
                                core.system.vistrails_root_directory() +
                                '/gui/resources/images/pinned.png')
        self.UNPINNED_PALETTE_ICON = QtGui.QIcon(
                                core.system.vistrails_root_directory() +
                                '/gui/resources/images/unpinned.png')
        # Parameter Exploration Pixmaps
        self.EXPLORE_COLUMN_PIXMAP = QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/column.png')
        self.EXPLORE_ROW_PIXMAP = QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/row.png')
        self.EXPLORE_SHEET_PIXMAP = QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/sheet.png')
        self.EXPLORE_TIME_PIXMAP = QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/time.png')        
        self.EXPLORE_SKIP_PIXMAP = QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/skip.png')        
        self.REMOVE_PARAM_PIXMAP = QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/remove_param.png')        
        self.RIGHT_ARROW_PIXMAP = QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/right.png')        
        
        # Cursor for zoom in/out graphics views
        self.SELECT_CURSOR = QtGui.QCursor(QtCore.Qt.ArrowCursor)
        self.OPEN_HAND_CURSOR = QtGui.QCursor(QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/open_hand.png'))
        self.CLOSE_HAND_CURSOR = QtGui.QCursor(QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/close_hand.png'))
        self.ZOOM_CURSOR = QtGui.QCursor(QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/zoom.png'))
                
        # Cursor icon for zoom in/out graphics views
        self.SELECT_ICON = QtGui.QIcon(QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/select_icon.png'))
        self.PAN_ICON = QtGui.QIcon(QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/pan_icon.png'))
        self.ZOOM_ICON = QtGui.QIcon(QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/zoom_icon.png'))
        
        # Mashup Icons
        self.EXECUTE_MASHUP_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/mashup_execute.png')
        self.MASHUP_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/mashup_create.png')
        self.MASHUP_ALIAS_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/alias.png')
        
        # Saved Queries icons
        self.QUERY_VIEW_ICON = self.ZOOM_ICON
        self.QUERY_ARROW_ICON = QtGui.QIcon(QtGui.QPixmap(
                core.system.vistrails_root_directory() +
                '/gui/resources/images/zoom_arrow_icon.png'))
        self.QUERY_EDIT_ICON = QtGui.QIcon(QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/edit.png'))

        #### COLORS ####
        # Color for the PIP frame
        self.PIP_FRAME_COLOR = QtGui.QColor(
            *(ColorByName.get_int('yellow_light')))

        # Color of selected methods in the modules method area
        self.METHOD_SELECT_COLOR = QtGui.QColor(
            *ColorByName.get_int('yellow_light'))

        # Color of the hover/unhover alias labels
        self.HOVER_DEFAULT_COLOR = QtGui.QColor(
            *ColorByName.get_int('black'))
        self.HOVER_SELECT_COLOR = QtGui.QColor(
            *ColorByName.get_int('blue'))
        
        # colors for debug messages
        #self.DEBUG_INFO_COLOR = QtGui.QColor(QtCore.Qt.darkGray)
        #self.DEBUG_WARNING_COLOR = QtGui.QColor(QtCore.Qt.black)
        self.DEBUG_INFO_COLOR = QtGui.QColor(QtCore.Qt.black)
        self.DEBUG_WARNING_COLOR = QtGui.QColor("#707000")
        self.DEBUG_CRITICAL_COLOR = QtGui.QColor(QtCore.Qt.red)
        class QTransparentColor(QtGui.QColor):
            def name(self):
                return 'transparent'
        self.DEBUG_FILTER_BACKGROUND_COLOR = QTransparentColor("transparent")
コード例 #5
0
ファイル: theme.py プロジェクト: gzt200361/ThirdParty-2.0.0
    def __init__(self):
        """ DefaultTheme() -> DefaultTheme
        This is for initializing all Qt objects
        
        """
        ######################
        #### MEASUREMENTS ####

        # Padded space of Version shape and its label
        self.VERSION_LABEL_MARGIN = (60, 35)

        # Padded space of Module shape into its label
        self.MODULE_LABEL_MARGIN = (20, 20, 20, 15)

        # Margin of Module shape into its ports
        self.MODULE_PORT_MARGIN = (4, 4, 4, 4)

        # Space between ports inside a module
        self.MODULE_PORT_SPACE = 4

        # The space added to the end of port shapes before it reaches the
        # margin of the module
        self.MODULE_PORT_PADDED_SPACE = 20

        # Width and Height of Port shape
        self.PORT_WIDTH = 10
        self.PORT_HEIGHT = 10
        self.PORT_RECT = QtCore.QRectF(0, 0, self.PORT_WIDTH, self.PORT_HEIGHT)

        # Width and Height of Configure button shape
        self.CONFIGURE_WIDTH = 6
        self.CONFIGURE_HEIGHT = 10

        self.CONFIGURE_SHAPE = _create_configure_shape(self.CONFIGURE_WIDTH,
                                                       self.CONFIGURE_HEIGHT)

        # The number of control points when drawing connection curve
        self.CONNECTION_CONTROL_POINTS = 20

        # Control the size and gap for the 3 little segments when
        # draw connections between versions
        self.LINK_SEGMENT_LENGTH = 15
        self.LINK_SEGMENT_GAP = 5
        self.LINK_SEGMENT_SQUARE_LENGTH = 12

        # The size of the frame containing the PIP graphics view
        self.PIP_IN_FRAME_WIDTH = 5
        self.PIP_OUT_FRAME_WIDTH = 1

        # The size of the frame containing the PIP graphics view
        self.PIP_DEFAULT_SIZE = (128, 128)

        # The default minimum size of the graphics views
        self.BOUNDING_RECT_MINIMUM = 512

        # Default Paramter Inspector Window dimension
        self.VISUAL_DIFF_PARAMETER_WINDOW_SIZE = (348,256)

        # Default legend size (small rectangular shape)
        self.VISUAL_DIFF_LEGEND_SIZE = (16, 16)

        # Virtual Cell Label default  size
        self.VIRTUAL_CELL_LABEL_SIZE = (40, 40)

        # Query Preview Size
        self.QUERY_PREVIEW_SIZE = (256, 256)


        #### BRUSH & PEN ####
        # Background brush of the pipeline view
        self.PIPELINE_VIEW_BACKGROUND_BRUSH = QtGui.QBrush(
            QtGui.QImage(core.system.vistrails_root_directory() +
                         '/gui/resources/images/pipeline_bg.png'))
            #QtGui.QColor("white"))
        # Background brush of the version tree
        self.VERSION_TREE_BACKGROUND_BRUSH = QtGui.QBrush(
            QtGui.QImage(core.system.vistrails_root_directory() +
                         '/gui/resources/images/version_bg.png'))
        
        # Background brush of the query pipeline view
        self.QUERY_BACKGROUND_BRUSH = QtGui.QBrush(
            QtGui.QImage(core.system.vistrails_root_directory() +
                         '/gui/resources/images/query_bg.png'))

        # Pen to draw a module shape at regular state
        self.MODULE_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black')))), 2)
        # Pen to draw a module shape when selected
        self.MODULE_SELECTED_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('goldenrod_medium')))), 3)
        # Brush and pen to draw a module label
        self.MODULE_LABEL_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black')))), 2)
        self.MODULE_LABEL_SELECTED_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black')))), 2)
        # Pen to draw module label when it is unmatched due to a query
        self.GHOSTED_MODULE_LABEL_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('dark_dim_grey')))), 2)
        # Brush to draw a module shape at different states
        self.MODULE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('light_grey'))))
        self.ERROR_MODULE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('salmon'))))
        self.SUCCESS_MODULE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('mint'))))
        self.ACTIVE_MODULE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('navajo_white'))))
        self.COMPUTING_MODULE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('yellow'))))
        self.NOT_EXECUTED_MODULE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('light_goldenrod'))))

        # Pen and brush for un-matched queried modules
        self.GHOSTED_MODULE_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('dark_dim_grey')))), 2)
        self.GHOSTED_MODULE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('light_dim_grey'))))

        # Brush and pen to draw a port shape at regular state
        self.PORT_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black')))), 1)
        self.PORT_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('light_grey'))))
        self.PORT_SELECTED_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('goldenrod_medium')))), 3)
        self.PORT_OPTIONAL_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('lamp_black')))), 1)
        self.PORT_OPTIONAL_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('titanium_white'))))
        
        # Pen and brush for drawing ports of ghosted modules
        self.GHOSTED_PORT_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('dark_dim_grey')))), 2)
        self.GHOSTED_PORT_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('light_dim_grey'))))

        # Pen and brush for drawing the configure button
        self.CONFIGURE_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black')))), 1)
        self.CONFIGURE_BRUSH= QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black'))))

        # Pen and brush for drawing the ghosted configure button
        self.GHOSTED_CONFIGURE_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('dark_dim_grey')))), 2)
        self.GHOSTED_CONFIGURE_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('dark_dim_grey'))))

        # Brush and pen to draw connections
        self.CONNECTION_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black')))), 2)
        self.CONNECTION_SELECTED_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('goldenrod_medium')))), 3)
        self.CONNECTION_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black'))))

        # Pen for drawing while connecting any ghosted modules
        self.GHOSTED_CONNECTION_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('dark_dim_grey')))), 2)

        # Pen to draw version tree node
        self.VERSION_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black')))), 2)    
        self.GHOSTED_VERSION_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('light_grey')))), 2)    
        self.VERSION_SELECTED_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('goldenrod_medium')))), 4)

        # Brush and pen to draw a version label
        self.VERSION_LABEL_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black')))), 2)
        self.GHOSTED_VERSION_LABEL_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('light_grey')))), 2)
        self.VERSION_LABEL_SELECTED_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black')))), 2)

        # Brush to draw version belongs to the current user
        self.VERSION_USER_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('desatcornflower'))))
        self.GHOSTED_VERSION_USER_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('very_light_grey'))))

        # Brush to draw version belongs to the other users
        self.VERSION_OTHER_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('melon'))))
    
        # Brush and pen to draw a link between two versions
        self.LINK_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black')))), 1.5)
        self.LINK_SELECTED_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('goldenrod_medium')))), 3)
        self.GHOSTED_LINK_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('light_grey')))), 2)

        # Selection box color
        self.SELECTION_BOX_BRUSH = QtGui.QBrush(
            QtGui.QColor(*ColorByName.get_int('light_grey')))
        self.SELECTION_BOX_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*ColorByName.get_int('lamp_black'))), 1)
        
        # Color of the version is being diff from in
        self.VISUAL_DIFF_FROM_VERSION_BRUSH = QtGui.QBrush(
            QtGui.QColor(*ColorByName.get_int('melon')))
        
        # Color of the version is being diff to in
        self.VISUAL_DIFF_TO_VERSION_BRUSH = QtGui.QBrush(
            QtGui.QColor(*ColorByName.get_int('steel_blue_light')))
        
        # Color of the paramter changed modules in Visual Diff
        self.VISUAL_DIFF_PARAMETER_CHANGED_BRUSH = QtGui.QBrush(
            QtGui.QColor(*ColorByName.get_int('light_grey')))
        
        # Color of the shared modules in Visual Diff
        self.VISUAL_DIFF_SHARED_BRUSH = QtGui.QBrush(
            QtGui.QColor(155, 155, 155, 255))
    
        # Pen & Brush of the circled id on the right corner of the
        # virtual cell label
        self.ANNOTATED_ID_PEN = QtGui.QPen(
            QtCore.Qt.white)
        self.ANNOTATED_ID_BRUSH = QtGui.QBrush(
            QtGui.QColor(157, 0, 0, 255))
    
        #### FONTS ####        
        # Font for module text
        self.MODULE_FONT = QtGui.QFont("Arial", 14, QtGui.QFont.Bold)
        self.MODULE_FONT_METRIC = QtGui.QFontMetrics(self.MODULE_FONT)
        self.MODULE_DESC_FONT = QtGui.QFont("Arial", 12)
        self.MODULE_DESC_FONT_METRIC = QtGui.QFontMetrics(self.MODULE_DESC_FONT)
    
        # Font for version text
        self.VERSION_FONT = QtGui.QFont("Arial", 15, QtGui.QFont.Bold)
        self.VERSION_FONT_METRIC = QtGui.QFontMetrics(self.VERSION_FONT)
        self.VERSION_DESCRIPTION_FONT = QtGui.QFont("Arial", 15, QtGui.QFont.Normal, 
                                                    True)
        self.VERSION_DESCRIPTION_FONT_METRIC = \
            QtGui.QFontMetrics(self.VERSION_DESCRIPTION_FONT)
        self.VERSION_PROPERTIES_FONT = QtGui.QFont("Arial", 12)
        self.VERSION_PROPERTIES_FONT_METRIC = \
            QtGui.QFontMetrics(self.VERSION_PROPERTIES_FONT)
        self.VERSION_PROPERTIES_PEN =  QtGui.QBrush(
            QtGui.QColor(20, 100, 20, 255))
            

        # Font showing on the Parameter Inspector window of Visual Diff
        self.VISUAL_DIFF_PARAMETER_FONT = QtGui.QFont('Arial', 10)
        
        # Font showing on the Legend window of Visual Diff
        self.VISUAL_DIFF_LEGEND_FONT = QtGui.QFont('Arial', 9)


        #### ICONS & IMAGES ####
        #The application disclaimer image
        self.DISCLAIMER_IMAGE = QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/disclaimer.png')
        #The application icon
        self.APPLICATION_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/vistrails_icon_small.png')

        #The application pixmap
        self.APPLICATION_PIXMAP = QtGui.QPixmap(
             core.system.vistrails_root_directory() +
            '/gui/resources/images/vistrails_icon_small.png')

        # The execute icons in the first spot of vistrail view toolbar
        self.EXECUTE_PIPELINE_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/execute.png')
        self.EXECUTE_EXPLORE_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/execute_explore.png')

        # The undo icons for the vistrail view toolbar
        self.UNDO_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/undo.png')

        # The redo icons for the vistrail view toolbar
        self.REDO_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/redo.png')

        # Icon to select the tabbed view
        self.TABBED_VIEW_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/tabbed_view.png')
    
        # Icon to select the horizontal split view
        self.HORIZONTAL_VIEW_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/hor_view.png')
    
        # Icon to select the vertical split view
        self.VERTICAL_VIEW_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/ver_view.png')
    
        # Icon to select the docking-style view
        self.DOCK_VIEW_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/dock_view.png')
    
        # Toolbar icon for creating a new Vistrail
        self.NEW_VISTRAIL_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/new_vistrail.png')
        
        # Toolbar icon for opening a vistrail
        self.OPEN_VISTRAIL_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/open_vistrail.png')

        #Toolbar icon for opening a vistrail from a database
        self.OPEN_VISTRAIL_DB_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/openfromdb.png')

        #Icon for database connections
        self.DB_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/database.png')

        #Icon for vistrails files
        self.FILE_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/file.png')
        
        # Toolbar icon for save the current Vistrail
        self.SAVE_VISTRAIL_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/save_vistrail.png')
    
        # Toolbar icon for toggling console mode window
        self.CONSOLE_MODE_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/console.png')

        # Toolbar icon for toggling bookmarks window
        self.BOOKMARKS_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/bookmarks.png')
        
        # BOOKMARKS WINDOW
        #Toolbar icon for removing bookmark
        self.BOOKMARKS_REMOVE_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/edittrash.png')

        #Toolbar icon for reloading a bookmark
        self.BOOKMARKS_RELOAD_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/reload.png')

        # Background image of the Visual Diff pipeline view
        self.VISUAL_DIFF_BACKGROUND_IMAGE = QtGui.QImage(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/pipeline_bg.png')
        
        # Toolbar icon for showing the Parameter Inspector window
        self.VISUAL_DIFF_SHOW_PARAM_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/show_params.png')
        
        # Toolbar icon for showing the Legend window
        self.VISUAL_DIFF_SHOW_LEGEND_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/show_legends.png')

        # Toolbar icon for creating an analogy
        self.VISUAL_DIFF_CREATE_ANALOGY_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/analogy.png')

        # Toolbar icon for close button on the vistrail tabbar
        self.VIEW_MANAGER_CLOSE_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/closeview.png')

        # Toolbar icon for the dock toolbutton on the splitted window
        self.DOCK_BACK_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/dockback.png')

        # Icon for adding string in the parameter exploration widget
        self.ADD_STRING_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/edit_add.png')

        # Icon for moving string up in the parameter exploration widget
        self.UP_STRING_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/up.png')

        # Icon for moving string up in the parameter exploration widget
        self.DOWN_STRING_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/down.png')

        # Toolbar icons for views
        self.PIPELINE_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/pipeline.png')
        self.HISTORY_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/history.png')
        self.QUERY_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/full_tree.png')
        self.EXPLORE_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/explore.png')

        # Toolbar icon for visual query on a vistrail
        self.VISUAL_QUERY_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/visual_query.png')
        
        # Toolbar icon for viewing the whole version tree
        self.VIEW_FULL_TREE_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/full_tree.png')

        # Toolbar icon for viewing the whole version tree
        self.PERFORM_PARAMETER_EXPLORATION_ICON = QtGui.QIcon(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/perform_pe.png')

        # Toolbar icon for dragging pixmap of VisDiff
        self.VERSION_DRAG_PIXMAP = QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/dragging.png')

        # Parameter Exploration Pixmaps
        self.EXPLORE_COLUMN_PIXMAP = QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/column.png')
        self.EXPLORE_ROW_PIXMAP = QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/row.png')
        self.EXPLORE_SHEET_PIXMAP = QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/sheet.png')
        self.EXPLORE_TIME_PIXMAP = QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/time.png')        
        self.EXPLORE_SKIP_PIXMAP = QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/skip.png')        
        self.REMOVE_PARAM_PIXMAP = QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/remove_param.png')        
        self.RIGHT_ARROW_PIXMAP = QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/right.png')        
        
        # Cursor for zoom in/out graphics views
        self.SELECT_CURSOR = QtGui.QCursor(QtCore.Qt.ArrowCursor)
        self.OPEN_HAND_CURSOR = QtGui.QCursor(QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/open_hand.png'))
        self.CLOSE_HAND_CURSOR = QtGui.QCursor(QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/close_hand.png'))
        self.ZOOM_CURSOR = QtGui.QCursor(QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/zoom.png'))
                
        # Cursor icon for zoom in/out graphics views
        self.SELECT_ICON = QtGui.QIcon(QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/select_icon.png'))
        self.PAN_ICON = QtGui.QIcon(QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/pan_icon.png'))
        self.ZOOM_ICON = QtGui.QIcon(QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/zoom_icon.png'))

        # Saved Queries icons
        self.QUERY_VIEW_ICON = self.ZOOM_ICON
        self.QUERY_ARROW_ICON = QtGui.QIcon(QtGui.QPixmap(
                core.system.vistrails_root_directory() +
                '/gui/resources/images/zoom_arrow_icon.png'))
        self.QUERY_EDIT_ICON = QtGui.QIcon(QtGui.QPixmap(
            core.system.vistrails_root_directory() +
            '/gui/resources/images/edit.png'))

        #### COLORS ####
        # Color for the PIP frame
        self.PIP_FRAME_COLOR = QtGui.QColor(
            *(ColorByName.get_int('yellow_light')))

        # Color of selected methods in the modules method area
        self.METHOD_SELECT_COLOR = QtGui.QColor(
            *ColorByName.get_int('yellow_light'))

        # Color of the hover/unhover alias labels
        self.HOVER_DEFAULT_COLOR = QtGui.QColor(
            *ColorByName.get_int('black'))
        self.HOVER_SELECT_COLOR = QtGui.QColor(
            *ColorByName.get_int('blue'))
コード例 #6
0
    def __init__(self):
        """ PluginTheme() -> PluginTheme
        This is for initializing all icons, colors, and measurements

        """
        ####################
        ### Measurements ###
        ####################
        
        # Padded space of Version shape and its label
        self.VERSION_LABEL_MARGIN = (60, 35)
        
        # Control the size and gap for the 3 little segments when
        # draw connections between versions
        self.LINK_SEGMENT_LENGTH = 15
        self.LINK_SEGMENT_GAP = 5
        self.LINK_SEGMENT_SQUARE_LENGTH = 12

        # The default minimum size of the graphics views
        self.BOUNDING_RECT_MINIMUM = 64

        ##############
        ### Colors ###
        ##############

        # Background brush of the version tree
        self.VERSION_TREE_BACKGROUND_BRUSH = QtGui.QBrush(QtGui.QColor(255, 255, 255, 255))    
        
        # Pen to draw version tree node
        self.VERSION_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black')))), 2)    
        self.GHOSTED_VERSION_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('light_grey')))), 2)    
        self.VERSION_SELECTED_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('goldenrod_medium')))), 4)

        # Brush and pen to draw a version label
        self.VERSION_LABEL_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black')))), 2)
        self.GHOSTED_VERSION_LABEL_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('light_grey')))), 2)
        self.VERSION_LABEL_SELECTED_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black')))), 2)

        # Brush to draw version belongs to the current user
        self.VERSION_USER_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('desatcornflower'))))
        self.GHOSTED_VERSION_USER_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('very_light_grey'))))

        # Brush to draw version belongs to the other users
        self.VERSION_OTHER_BRUSH = QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('melon'))))
    
        # Brush and pen to draw a link between two versions
        self.LINK_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('black')))), 1.5)
        self.LINK_SELECTED_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('goldenrod_medium')))), 3)
        self.GHOSTED_LINK_PEN = QtGui.QPen(QtGui.QBrush(
            QtGui.QColor(*(ColorByName.get_int('light_grey')))), 2)

        # Color of the hover/unhover labels
        self.HOVER_DEFAULT_COLOR = QtGui.QColor(
            *ColorByName.get_int('black'))
        self.HOVER_SELECT_COLOR = QtGui.QColor(
            *ColorByName.get_int('blue'))
        
        #############
        ### Fonts ###
        #############
        
        self.VERSION_FONT = QtGui.QFont("Arial", 15, QtGui.QFont.Bold)
        self.VERSION_FONT_METRIC = QtGui.QFontMetrics(self.VERSION_FONT)
        self.VERSION_DESCRIPTION_FONT = QtGui.QFont("Arial", 15, QtGui.QFont.Normal, 
                                                    True)
        self.VERSION_DESCRIPTION_FONT_METRIC = \
            QtGui.QFontMetrics(self.VERSION_DESCRIPTION_FONT)

        if systemType in ['Windows', 'Microsoft']:
            font = QtGui.QFont("Arial", 8)
            font.setBold(True)
            self.VERSION_PROPERTIES_FONT = font
            self.VERSION_PROPERTIES_FONT_METRIC = QtGui.QFontMetrics(font)
        elif systemType in ['Darwin']:
            self.VERSION_PROPERTIES_FONT = QtGui.QFont("Arial", 11)
            self.VERSION_PROPERTIES_FONT_METRIC = \
                QtGui.QFontMetrics(self.VERSION_PROPERTIES_FONT)
        else:
            self.VERSION_PROPERTIES_FONT = QtGui.QFont("Arial", 8)
            self.VERSION_PROPERTIES_FONT_METRIC = \
                QtGui.QFontMetrics(self.VERSION_PROPERTIES_FONT)

        self.VERSION_PROPERTIES_PEN =  QtGui.QBrush(
            QtGui.QColor(20, 100, 20, 255))
        
        
        #############
        ### Icons ###
        #############
        
        self.APPLICATION_ICON = QtGui.QIcon(':/images/app_icon.png')
        self.APPLICATION_PIXMAP = QtGui.QPixmap(':/images/app_icon.png')
        self.SELECT_CURSOR = QtGui.QCursor(QtCore.Qt.ArrowCursor)
        self.OPEN_HAND_CURSOR = QtGui.QCursor(QtCore.Qt.OpenHandCursor)
        self.CLOSE_HAND_CURSOR = QtGui.QCursor(QtCore.Qt.ClosedHandCursor)
        self.ZOOM_CURSOR = QtGui.QCursor(QtCore.Qt.SizeVerCursor)
        self.NEW_VISTRAIL_ICON = QtGui.QIcon(':/images/new.png') 
        self.OPEN_VISTRAIL_ICON = QtGui.QIcon(':/images/open.png')
        self.SAVE_VISTRAIL_ICON = QtGui.QIcon(':/images/save.png') 
        self.UNDO_ICON = QtGui.QIcon(':/images/undo.png')
        self.REDO_ICON = QtGui.QIcon(':/images/redo.png')
        self.PAN_ICON = QtGui.QIcon(':/images/pan.png')
        self.SELECT_ICON = QtGui.QIcon(':/images/arrow.png')
        self.ZOOM_ICON = QtGui.QIcon(':/images/zoom.png')
        self.QUERY_VIEW_ICON = QtGui.QIcon(':/images/find.png')
        self.PLAY_ICON = QtGui.QIcon(':/images/play.png')
        self.PAUSE_ICON = QtGui.QIcon(':/images/pause.png')
        self.SPEED_ICON = QtGui.QIcon(':/images/speed.png')
        self.STOP_ICON = QtGui.QIcon(':/images/stop.png')
        self.PICK_VERSIONS_ICON = QtGui.QIcon(':/images/pickversions.png')
        self.VIEW_ON_ICON = QtGui.QIcon(':/images/view_on.png')
        self.VIEW_OFF_ICON = QtGui.QIcon(':/images/view_off.png')
        if systemType in ['Darwin']:
            self.CLOSE_ICON = QtGui.QIcon(':/images/mac_close.png')
            self.QUERY_ARROW_ICON = QtGui.QIcon(':/images/find_arrow.png')
            self.SPEED_ICON = QtGui.QIcon(':/images/speed_arrow.png')
        else:
            self.CLOSE_ICON = QtGui.QIcon(':/images/close.png')
            self.QUERY_ARROW_ICON = QtGui.QIcon(':/images/find.png')
            self.SPEED_ICON = QtGui.QIcon(':/images/speed.png')
        

        ###########################
        ### Unused Measurements ###
        ###########################

        self.VIRTUAL_CELL_LABEL_SIZE = (0,0)
        self.PIP_IN_FRAME_WIDTH = 0
        self.PIP_OUT_FRAME_WIDTH = 0
        self.PIP_DEFAULT_SIZE = (0,0)
        self.MODULE_LABEL_MARGIN = (0,0,0,0)
        self.MODULE_PORT_MARGIN = (0,0,0,0)
        self.PORT_WIDTH = 0
        self.PORT_HEIGHT = 0
        self.PORT_RECT = QtCore.QRectF(0, 0, 0, 0)
        self.MODULE_PORT_SPACE = 0
        self.MODULE_PORT_PADDED_SPACE = 0
        self.CONFIGURE_WIDTH = 0
        self.CONFIGURE_HEIGHT = 0
        self.CONFIGURE_SHAPE = QtGui.QPolygonF()

        #####################
        ### Unused Colors ###
        #####################

        self.PIP_FRAME_COLOR = QtGui.QColor(0,0,0,0)

        ####################
        ### Unused Icons ###
        ####################
        
        empty_icon = QtGui.QIcon(':/images/empty.png')
        empty_pixmap = QtGui.QPixmap(':/images/empty.png')

        self.DISCLAIMER_IMAGE = empty_pixmap
        self.EXECUTE_PIPELINE_ICON = empty_icon
        self.EXECUTE_EXPLORE_ICON = empty_icon
        self.TABBED_VIEW_ICON = empty_icon
        self.HORIZONTAL_VIEW_ICON = empty_icon
        self.VERTICAL_VIEW_ICON = empty_icon
        self.DOCK_VIEW_ICON = empty_icon
        self.OPEN_VISTRAIL_DB_ICON = empty_icon
        self.DB_ICON = empty_icon
        self.FILE_ICON = empty_icon
        self.CONSOLE_MODE_ICON = empty_icon
        self.BOOKMARKS_ICON = empty_icon
        self.BOOKMARKS_REMOVE_ICON = empty_icon
        self.BOOKMARKS_RELOAD_ICON = empty_icon
        self.VISUAL_DIFF_BACKGROUND_IMAGE = empty_icon
        self.VISUAL_DIFF_SHOW_PARAM_ICON = empty_icon
        self.VISUAL_DIFF_SHOW_LEGEND_ICON = empty_icon
        self.VISUAL_DIFF_CREATE_ANALOGY_ICON = empty_icon
        self.VIEW_MANAGER_CLOSE_ICON = empty_icon
        self.DOCK_BACK_ICON = empty_icon
        self.ADD_STRING_ICON = empty_icon
        self.UP_STRING_ICON = empty_icon
        self.DOWN_STRING_ICON = empty_icon
        self.PIPELINE_ICON = empty_icon
        self.HISTORY_ICON = empty_icon
        self.QUERY_ICON = empty_icon
        self.EXPLORE_ICON = empty_icon
        self.VISUAL_QUERY_ICON = empty_icon
        self.VIEW_FULL_TREE_ICON = empty_icon
        self.PERFORM_PARAMETER_EXPLORACTION_ICON = empty_icon
        self.VERSION_DRAG_PIXAMP = empty_pixmap
        self.EXPLORE_COLUMN_PIXMAP = empty_pixmap
        self.EXPLORE_ROW_PIXMAP = empty_pixmap
        self.EXPLORE_SHEET_PIXMAP = empty_pixmap
        self.EXPLORE_TIME_PIXMAP = empty_pixmap
        self.EXPLORE_SKIP_PIXMAP = empty_pixmap
        self.REMOVE_PARAM_PIXMAP = empty_pixmap
        self.RIGHT_ARROW_PIXMAP = empty_pixmap
        self.QUERY_EDIT_ICON = empty_icon

        ######################
        ### Unused Brushes ###
        ######################

        empty_brush = QtGui.QBrush(QtGui.QColor(255,255,255,255))
        empty_pen = QtGui.QPen(empty_brush, 1)
        self.PIPELINE_VIEW_BACKGROUND_BRUSH = empty_brush
        self.QUERY_BACKGROUND_BRUSH = empty_brush
        self.MODULE_BRUSH = empty_brush
        self.MODULE_PEN = empty_pen
        self.MODULE_SELECTED_PEN = empty_pen
        self.MODULE_LABEL_PEN = empty_pen
        self.MODULE_LABEL_SELECTED_PEN = empty_pen
        self.GHOSTED_MODULE_LABEL_PEN = empty_pen
        self.PORT_PEN = empty_pen
        self.PORT_BRUSH = empty_brush
        self.PORT_SELECTED_PEN = empty_pen
        self.PORT_OPTIONAL_PEN = empty_pen
        self.PORT_OPTIONAL_BRUSH = empty_brush
        self.CONFIGURE_PEN = empty_pen
        self.CONFIGURE_BRUSH = empty_brush

        ####################
        ### Unused Fonts ###
        ####################

        self.MODULE_FONT = QtGui.QFont("Arial", 14, QtGui.QFont.Bold)
        self.MODULE_FONT_METRIC = QtGui.QFontMetrics(self.MODULE_FONT)
        self.MODULE_DESC_FONT = QtGui.QFont("Arial", 12)
        self.MODULE_DESC_FONT_METRIC = QtGui.QFontMetrics(self.MODULE_DESC_FONT)

        ##############
        ### Timers ###
        ##############
        self.STATUS_TIMER_LENGTH = 3000