11 import os |
11 import os |
12 |
12 |
13 from PyQt4.QtCore import * |
13 from PyQt4.QtCore import * |
14 from PyQt4.QtGui import * |
14 from PyQt4.QtGui import * |
15 |
15 |
16 from Ui_FiletypeAssociationDialog import Ui_FiletypeAssociationDialog |
16 from .Ui_FiletypeAssociationDialog import Ui_FiletypeAssociationDialog |
17 |
17 |
18 class FiletypeAssociationDialog(QDialog, Ui_FiletypeAssociationDialog): |
18 class FiletypeAssociationDialog(QDialog, Ui_FiletypeAssociationDialog): |
19 """ |
19 """ |
20 Class implementing a dialog to enter filetype associations for the project. |
20 Class implementing a dialog to enter filetype associations for the project. |
21 """ |
21 """ |
41 self.trUtf8("Interfaces"), self.trUtf8("Others"), |
41 self.trUtf8("Interfaces"), self.trUtf8("Others"), |
42 self.trUtf8("Ignore")] |
42 self.trUtf8("Ignore")] |
43 self.filetypeCombo.addItems(self.filetypeStrings) |
43 self.filetypeCombo.addItems(self.filetypeStrings) |
44 |
44 |
45 self.project = project |
45 self.project = project |
46 for pattern, filetype in self.project.pdata["FILETYPES"].items(): |
46 for pattern, filetype in list(self.project.pdata["FILETYPES"].items()): |
47 try: |
47 try: |
48 index = self.filetypes.index(filetype) |
48 index = self.filetypes.index(filetype) |
49 itm = self.__createItem(pattern, self.filetypeStrings[index]) |
49 itm = self.__createItem(pattern, self.filetypeStrings[index]) |
50 except ValueError: |
50 except ValueError: |
51 pass # silently discard entries of unknown type |
51 pass # silently discard entries of unknown type |