82 elif code.startswith("S"): |
82 elif code.startswith("S"): |
83 itm.setIcon(0, UI.PixmapCache.getIcon("securityLow")) |
83 itm.setIcon(0, UI.PixmapCache.getIcon("securityLow")) |
84 else: |
84 else: |
85 # unknown category prefix => warning |
85 # unknown category prefix => warning |
86 itm.setIcon(0, UI.PixmapCache.getIcon("warning")) |
86 itm.setIcon(0, UI.PixmapCache.getIcon("warning")) |
87 itm.setFlags(itm.flags() | Qt.ItemIsUserCheckable) |
87 itm.setFlags(itm.flags() | Qt.ItemFlag.ItemIsUserCheckable) |
88 if code in codeList: |
88 if code in codeList: |
89 itm.setCheckState(0, Qt.Checked) |
89 itm.setCheckState(0, Qt.CheckState.Checked) |
90 codeList.remove(code) |
90 codeList.remove(code) |
91 else: |
91 else: |
92 itm.setCheckState(0, Qt.Unchecked) |
92 itm.setCheckState(0, Qt.CheckState.Unchecked) |
93 self.codeTable.resizeColumnToContents(0) |
93 self.codeTable.resizeColumnToContents(0) |
94 self.codeTable.resizeColumnToContents(1) |
94 self.codeTable.resizeColumnToContents(1) |
95 self.codeTable.header().setStretchLastSection(True) |
95 self.codeTable.header().setStretchLastSection(True) |
96 |
96 |
97 self.__extraCodes = codeList[:] |
97 self.__extraCodes = codeList[:] |
105 """ |
105 """ |
106 selectedCodes = [] |
106 selectedCodes = [] |
107 |
107 |
108 for index in range(self.codeTable.topLevelItemCount()): |
108 for index in range(self.codeTable.topLevelItemCount()): |
109 itm = self.codeTable.topLevelItem(index) |
109 itm = self.codeTable.topLevelItem(index) |
110 if itm.checkState(0) == Qt.Checked: |
110 if itm.checkState(0) == Qt.CheckState.Checked: |
111 selectedCodes.append(itm.text(0)) |
111 selectedCodes.append(itm.text(0)) |
112 |
112 |
113 return ", ".join(self.__extraCodes + selectedCodes) |
113 return ", ".join(self.__extraCodes + selectedCodes) |