Пример #1
0
 def _create_help_item(self, image, text):
     Item = QListWidgetItem(QIcon(image), text)
     font = Item.font()
     font.setBold(True)
     Item.setSizeHint(QSize(20, 30))
     Item.setBackground(QBrush(Qt.lightGray))
     Item.setForeground(QBrush(Qt.black))
     Item.setFont(font)
     return Item
Пример #2
0
 def _create_help_item(self, image, text):
     Item = QListWidgetItem(QIcon(image), text)
     font = Item.font()
     font.setBold(True)
     Item.setSizeHint(QSize(20, 30))
     Item.setBackground(QBrush(Qt.lightGray))
     Item.setForeground(QBrush(Qt.black))
     Item.setFont(font)
     return Item
Пример #3
0
 def add_no_found(self):
     #Load no results found message
     noFoundItem = QListWidgetItem(
         QIcon(resources.IMAGES['delete']),
             'No results were found!')
     font = noFoundItem.font()
     font.setBold(True)
     noFoundItem.setSizeHint(QSize(20, 30))
     noFoundItem.setBackground(QBrush(Qt.lightGray))
     noFoundItem.setForeground(QBrush(Qt.black))
     noFoundItem.setFont(font)
     self.listWidget.addItem(noFoundItem)
Пример #4
0
 def add_help(self):
     #Load help
     fileItem = QListWidgetItem(
         QIcon(resources.IMAGES['locate-file']),
             '@\t(Filter only by Files)')
     font = fileItem.font()
     font.setBold(True)
     fileItem.setSizeHint(QSize(20, 30))
     fileItem.setBackground(QBrush(Qt.lightGray))
     fileItem.setForeground(QBrush(Qt.black))
     fileItem.setFont(font)
     self.listWidget.addItem(fileItem)
     classItem = QListWidgetItem(
         QIcon(resources.IMAGES['locate-class']),
             '<\t(Filter only by Classes)')
     self.listWidget.addItem(classItem)
     classItem.setSizeHint(QSize(20, 30))
     classItem.setBackground(QBrush(Qt.lightGray))
     classItem.setForeground(QBrush(Qt.black))
     classItem.setFont(font)
     methodItem = QListWidgetItem(
         QIcon(resources.IMAGES['locate-function']),
             '>\t(Filter only by Methods)')
     self.listWidget.addItem(methodItem)
     methodItem.setSizeHint(QSize(20, 30))
     methodItem.setBackground(QBrush(Qt.lightGray))
     methodItem.setForeground(QBrush(Qt.black))
     methodItem.setFont(font)
     thisFileItem = QListWidgetItem(
         QIcon(resources.IMAGES['locate-on-this-file']),
             '.\t(Filter only by Classes and Methods in this File)')
     font = thisFileItem.font()
     font.setBold(True)
     thisFileItem.setSizeHint(QSize(20, 30))
     thisFileItem.setBackground(QBrush(Qt.lightGray))
     thisFileItem.setForeground(QBrush(Qt.black))
     thisFileItem.setFont(font)
     self.listWidget.addItem(thisFileItem)
     nonPythonItem = QListWidgetItem(
         QIcon(resources.IMAGES['locate-nonpython']),
             '!\t(Filter only by Non Python Files)')
     self.listWidget.addItem(nonPythonItem)
     nonPythonItem.setSizeHint(QSize(20, 30))
     nonPythonItem.setBackground(QBrush(Qt.lightGray))
     nonPythonItem.setForeground(QBrush(Qt.black))
     nonPythonItem.setFont(font)
Пример #5
0
    def initExtList(self):
        extset = set(self.parent().settings.extensions)
        #for easier performance in checking
        for ext in self.parent().settings.extensions:
            item = QListWidgetItem(ext, self.mdExts)
            item.setFlags(item.flags() | Qt.ItemIsUserCheckable)
            item.setCheckState(Qt.Checked)

        for ext in self.parent().settings.faulty_exts:
            item = QListWidgetItem(ext, self.mdExts)
            item.setFlags(item.flags() | Qt.ItemIsUserCheckable)
            item.setBackground(QBrush(QColor('red')))
            item.setForeground(QBrush(QColor('black')))
            item.setCheckState(Qt.Checked)

        for ext in allMDExtensions():
            if ext in extset: continue
            item = QListWidgetItem(ext, self.mdExts)
            item.setFlags(item.flags() | Qt.ItemIsUserCheckable)
            item.setCheckState(Qt.Unchecked)
Пример #6
0
    def initExtList(self):
        extset=set(self.parent().settings.extensions)
        #for easier performance in checking
        for ext in self.parent().settings.extensions:
            item = QListWidgetItem(ext, self.mdExts)
            item.setFlags(item.flags() | Qt.ItemIsUserCheckable)
            item.setCheckState(Qt.Checked)

        for ext in self.parent().settings.faulty_exts:
            item = QListWidgetItem(ext, self.mdExts)
            item.setFlags(item.flags() | Qt.ItemIsUserCheckable)
            item.setBackground(QBrush(QColor('red')))
            item.setForeground(QBrush(QColor('black')))
            item.setCheckState(Qt.Checked)

        for ext in allMDExtensions():
            if ext in extset: continue
            item = QListWidgetItem(ext, self.mdExts)
            item.setFlags(item.flags() | Qt.ItemIsUserCheckable)
            item.setCheckState(Qt.Unchecked)
    def _updateDtmListItems(self):

        layer = self._getCurrentSelectedLayer()
        self.dtmList.clear()
        dtms = list(self._getDtmsForLayer(layer))

        redBrush = QBrush(QColor(255, 0, 0, 255))
        redBrush.setStyle(1)

        greenBrush = QBrush(QColor(0, 255, 0, 255))
        greenBrush.setStyle(1)

        for dtm in dtms:
            newListItem = QListWidgetItem()
            newListItem.setText(dtm)
            if self._dtmInFolder(dtm):
                newListItem.setBackground(greenBrush)
            else:
                newListItem.setBackground(redBrush)
            self.dtmList.insertItem(0, newListItem)
Пример #8
0
 def add_help(self):
     #Load help
     fileItem = QListWidgetItem(QIcon(resources.IMAGES['locate-file']),
                                '@\t(Filter only by Files)')
     font = fileItem.font()
     font.setBold(True)
     fileItem.setSizeHint(QSize(20, 30))
     fileItem.setBackground(QBrush(Qt.lightGray))
     fileItem.setForeground(QBrush(Qt.black))
     fileItem.setFont(font)
     self.listWidget.addItem(fileItem)
     classItem = QListWidgetItem(QIcon(resources.IMAGES['locate-class']),
                                 '<\t(Filter only by Classes)')
     self.listWidget.addItem(classItem)
     classItem.setSizeHint(QSize(20, 30))
     classItem.setBackground(QBrush(Qt.lightGray))
     classItem.setForeground(QBrush(Qt.black))
     classItem.setFont(font)
     methodItem = QListWidgetItem(
         QIcon(resources.IMAGES['locate-function']),
         '>\t(Filter only by Methods)')
     self.listWidget.addItem(methodItem)
     methodItem.setSizeHint(QSize(20, 30))
     methodItem.setBackground(QBrush(Qt.lightGray))
     methodItem.setForeground(QBrush(Qt.black))
     methodItem.setFont(font)
     attributeItem = QListWidgetItem(
         QIcon(resources.IMAGES['locate-attributes']),
         '-\t(Filter only by Attributes)')
     self.listWidget.addItem(attributeItem)
     attributeItem.setSizeHint(QSize(20, 30))
     attributeItem.setBackground(QBrush(Qt.lightGray))
     attributeItem.setForeground(QBrush(Qt.black))
     attributeItem.setFont(font)
     thisFileItem = QListWidgetItem(
         QIcon(resources.IMAGES['locate-on-this-file']),
         '.\t(Filter only by Classes and Methods in this File)')
     font = thisFileItem.font()
     font.setBold(True)
     thisFileItem.setSizeHint(QSize(20, 30))
     thisFileItem.setBackground(QBrush(Qt.lightGray))
     thisFileItem.setForeground(QBrush(Qt.black))
     thisFileItem.setFont(font)
     self.listWidget.addItem(thisFileItem)
     nonPythonItem = QListWidgetItem(
         QIcon(resources.IMAGES['locate-nonpython']),
         '!\t(Filter only by Non Python Files)')
     self.listWidget.addItem(nonPythonItem)
     nonPythonItem.setSizeHint(QSize(20, 30))
     nonPythonItem.setBackground(QBrush(Qt.lightGray))
     nonPythonItem.setForeground(QBrush(Qt.black))
     nonPythonItem.setFont(font)