Beispiel #1
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)
Beispiel #2
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)
Beispiel #3
0
    def fillSourceList(self):
        """ Change dialog controls when an other calculation type selected.
        """
        # get the selected stations
        stn1 = self.ui.Station1Combo.itemData(
            self.ui.Station1Combo.currentIndex())
        stn2 = self.ui.Station2Combo.itemData(
            self.ui.Station2Combo.currentIndex())
        # clear source and target list
        self.ui.SourceList.clear()
        self.ui.TargetList.clear()
        # get tartget poins according to the stations
        targets = []
        if stn1 is not None and (self.ui.OrientRadio.isChecked() or \
                self.ui.ResectionRadio.isChecked() or self.ui.FreeRadio.isChecked()):
            targets = get_targets(stn1[0], stn1[1], stn1[2], True)
        elif stn1 is not None and self.ui.RadialRadio.isChecked():
            targets = get_targets(stn1[0], stn1[1], stn1[2], False, True)
        elif stn1 is not None and stn2 is not None and \
                self.ui.IntersectRadio.isChecked():
            # fill source list for intersection (common points)
            targets_stn1 = get_targets(stn1[0], stn1[1], stn1[2], False)
            targets_stn2 = get_targets(stn2[0], stn2[1], stn2[2], False)
            for t1 in targets_stn1:
                for t2 in targets_stn2:
                    if t1[0] == t2[0]:
                        if not t1[0] in targets:
                            targets.append([t1, t2])
                        break

        # fill source list widget
        known_list = get_known()
        if targets is not None:
            for target in targets:
                if self.ui.IntersectRadio.isChecked():
                    item = QListWidgetItem(target[0][0])
                    item.setData(Qt.UserRole, target)
                    if known_list is not None and target[0][0] in known_list:
                        itemfont = item.font()
                        itemfont.setWeight(QFont.Bold)
                        item.setFont(itemfont)
                else:
                    item = QListWidgetItem(u"%s (id:%s)" %
                                           (target[0], target[2]))
                    item.setData(Qt.UserRole, target)
                    if known_list is not None and target[0] in known_list:
                        itemfont = item.font()
                        itemfont.setWeight(QFont.Bold)
                        item.setFont(itemfont)
                self.ui.SourceList.addItem(item)
Beispiel #4
0
 def addHeading(self, heading):
     item = QListWidgetItem(heading)
     item.setSizeHint(QSize(10, 25))
     fnt = item.font()
     fnt.setBold(True)
     item.setFont(fnt)
     self.hostList.addItem(item)
Beispiel #5
0
 def fillSourceList(self):
     """ Change dialog controls when an other calculation type selected.
     """
     # get the selected stations
     stn1 = self.ui.Station1Combo.itemData( self.ui.Station1Combo.currentIndex() )
     stn2 = self.ui.Station2Combo.itemData( self.ui.Station2Combo.currentIndex() )
     # clear source and target list
     self.ui.SourceList.clear()
     self.ui.TargetList.clear()
     # get tartget poins according to the stations
     targets = []
     if stn1 is not None and (self.ui.OrientRadio.isChecked() or \
             self.ui.ResectionRadio.isChecked() or self.ui.FreeRadio.isChecked()):
         targets = get_targets(stn1[0], stn1[1], stn1[2],True)
     elif stn1 is not None and self.ui.RadialRadio.isChecked():
         targets = get_targets(stn1[0], stn1[1], stn1[2],False,True)
     elif stn1 is not None and stn2 is not None and \
             self.ui.IntersectRadio.isChecked():
         # fill source list for intersection (common points)
         targets_stn1 = get_targets(stn1[0], stn1[1], stn1[2],False)
         targets_stn2 = get_targets(stn2[0], stn2[1], stn2[2],False)
         for t1 in targets_stn1:
             for t2 in targets_stn2:
                 if t1[0] == t2[0]:
                     if not t1[0] in targets:
                         targets.append([t1,t2])
                     break
         
     # fill source list widget
     known_list = get_known()
     if targets is not None:
         for target in targets:
             if self.ui.IntersectRadio.isChecked():
                 item = QListWidgetItem(target[0][0])
                 item.setData(Qt.UserRole,target)
                 if known_list is not None and target[0][0] in known_list:
                     itemfont = item.font()
                     itemfont.setWeight(QFont.Bold)
                     item.setFont(itemfont)
             else:
                 item = QListWidgetItem(u"%s (id:%s)"% (target[0],target[2]) )
                 item.setData(Qt.UserRole,target)
                 if known_list is not None and target[0] in known_list:
                     itemfont = item.font()
                     itemfont.setWeight(QFont.Bold)
                     item.setFont(itemfont)
             self.ui.SourceList.addItem( item )
Beispiel #6
0
    def addHeadlineMatches(self, poslist):

        for p in poslist:
            it = QListWidgetItem(p.h, self.lw)
            f = it.font()
            f.setBold(True)
            it.setFont(f)
            self.its[id(it)] = (p, None)
Beispiel #7
0
    def addHeadlineMatches(self, poslist):

        for p in poslist:
            it = QListWidgetItem(p.h, self.lw)   
            f = it.font()
            f.setBold(True)
            it.setFont(f)
            self.its[id(it)] = (p,None)
Beispiel #8
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
Beispiel #9
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
Beispiel #10
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)
Beispiel #11
0
    def addBodyMatches(self, poslist):

        for p in poslist:
            it = QListWidgetItem(p.h, self.lw)
            f = it.font()
            f.setBold(True)
            it.setFont(f)

            self.its[id(it)] = (p, None)
            ms = matchlines(p.b, p.matchiter)
            for ml, pos in ms:
                #print "ml",ml,"pos",pos
                it = QListWidgetItem(ml, self.lw)
                self.its[id(it)] = (p, pos)
Beispiel #12
0
    def addBodyMatches(self, poslist):
                
        for p in poslist:
            it = QListWidgetItem(p.h, self.lw)
            f = it.font()
            f.setBold(True)
            it.setFont(f)

            self.its[id(it)] = (p, None)
            ms = matchlines(p.b, p.matchiter)
            for ml, pos in ms:
                #print "ml",ml,"pos",pos
                it = QListWidgetItem(ml, self.lw)   
                self.its[id(it)] = (p,pos)
Beispiel #13
0
 def fillTargetList(self):
     """ Change Target List when an other calculation type selected.
     """
     self.ui.TargetList.clear()
     self.ui.OrderList.clear()
     # get target points
     targets = get_stations(False,False)
     # fill target list widget
     known_list = get_known()
     if targets is not None:
         for target in targets:
             item = QListWidgetItem(u"%s (%s:%s)"% (target[0],target[1],target[2]) )
             item.setData(Qt.UserRole,target)
             if known_list is not None and target[0] in known_list:
                 itemfont = item.font()
                 itemfont.setWeight(QFont.Bold)
                 item.setFont(itemfont)
             self.ui.TargetList.addItem( item )
Beispiel #14
0
 def fillTargetList(self):
     """ Change Target List when an other calculation type selected.
     """
     self.ui.TargetList.clear()
     self.ui.OrderList.clear()
     # get target points
     targets = get_stations(False, False)
     # fill target list widget
     known_list = get_known()
     if targets is not None:
         for target in targets:
             item = QListWidgetItem(u"%s (%s:%s)" %
                                    (target[0], target[1], target[2]))
             item.setData(Qt.UserRole, target)
             if known_list is not None and target[0] in known_list:
                 itemfont = item.font()
                 itemfont.setWeight(QFont.Bold)
                 item.setFont(itemfont)
             self.ui.TargetList.addItem(item)