eric6/Project/FiletypeAssociationDialog.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
equal deleted inserted replaced
8141:27f636beebad 8143:2c730d5fd177
28 self.setupUi(self) 28 self.setupUi(self)
29 29
30 self.filetypeAssociationList.headerItem().setText( 30 self.filetypeAssociationList.headerItem().setText(
31 self.filetypeAssociationList.columnCount(), "") 31 self.filetypeAssociationList.columnCount(), "")
32 self.filetypeAssociationList.header().setSortIndicator( 32 self.filetypeAssociationList.header().setSortIndicator(
33 0, Qt.AscendingOrder) 33 0, Qt.SortOrder.AscendingOrder)
34 34
35 # keep these lists in sync 35 # keep these lists in sync
36 self.filetypes = ["SOURCES", "FORMS", "TRANSLATIONS", "RESOURCES", 36 self.filetypes = ["SOURCES", "FORMS", "TRANSLATIONS", "RESOURCES",
37 "INTERFACES", "PROTOCOLS", "OTHERS", "__IGNORE__"] 37 "INTERFACES", "PROTOCOLS", "OTHERS", "__IGNORE__"]
38 self.filetypeStrings = [self.tr("Sources"), self.tr("Forms"), 38 self.filetypeStrings = [self.tr("Sources"), self.tr("Forms"),
66 def __reformat(self): 66 def __reformat(self):
67 """ 67 """
68 Private method to reformat the tree. 68 Private method to reformat the tree.
69 """ 69 """
70 self.filetypeAssociationList.header().resizeSections( 70 self.filetypeAssociationList.header().resizeSections(
71 QHeaderView.ResizeToContents) 71 QHeaderView.ResizeMode.ResizeToContents)
72 self.filetypeAssociationList.header().setStretchLastSection(True) 72 self.filetypeAssociationList.header().setStretchLastSection(True)
73 73
74 def __createItem(self, pattern, filetype): 74 def __createItem(self, pattern, filetype):
75 """ 75 """
76 Private slot to create a new entry in the association list. 76 Private slot to create a new entry in the association list.
108 """ 108 """
109 pattern = self.filePatternEdit.text() 109 pattern = self.filePatternEdit.text()
110 filetype = self.filetypeCombo.currentText() 110 filetype = self.filetypeCombo.currentText()
111 if pattern: 111 if pattern:
112 items = self.filetypeAssociationList.findItems( 112 items = self.filetypeAssociationList.findItems(
113 pattern, Qt.MatchFlags(Qt.MatchExactly), 0) 113 pattern, Qt.MatchFlags(Qt.MatchFlag.MatchExactly), 0)
114 for itm in items: 114 for itm in items:
115 itm = self.filetypeAssociationList.takeTopLevelItem( 115 itm = self.filetypeAssociationList.takeTopLevelItem(
116 self.filetypeAssociationList.indexOfTopLevelItem(itm)) 116 self.filetypeAssociationList.indexOfTopLevelItem(itm))
117 del itm 117 del itm
118 itm = self.__createItem(pattern, filetype) 118 itm = self.__createItem(pattern, filetype)

eric ide

mercurial