Project/LexerAssociationDialog.py

changeset 12
1d8dd9706f46
parent 0
de9c2efb9d02
child 13
1af94a91f439
equal deleted inserted replaced
11:b0996e4a289e 12:1d8dd9706f46
14 from PyQt4.QtCore import Qt, pyqtSlot 14 from PyQt4.QtCore import Qt, pyqtSlot
15 from PyQt4.QtGui import QHeaderView, QTreeWidgetItem, QDialog 15 from PyQt4.QtGui import QHeaderView, QTreeWidgetItem, QDialog
16 16
17 import QScintilla.Lexers 17 import QScintilla.Lexers
18 18
19 from Ui_LexerAssociationDialog import Ui_LexerAssociationDialog 19 from .Ui_LexerAssociationDialog import Ui_LexerAssociationDialog
20 20
21 class LexerAssociationDialog(QDialog, Ui_LexerAssociationDialog): 21 class LexerAssociationDialog(QDialog, Ui_LexerAssociationDialog):
22 """ 22 """
23 Class implementing a dialog to enter lexer associations for the project. 23 Class implementing a dialog to enter lexer associations for the project.
24 """ 24 """
50 pygmentsLexers = [''] + sorted([l[0] for l in get_all_lexers()]) 50 pygmentsLexers = [''] + sorted([l[0] for l in get_all_lexers()])
51 self.pygmentsLexerCombo.addItems(pygmentsLexers) 51 self.pygmentsLexerCombo.addItems(pygmentsLexers)
52 52
53 # set initial values 53 # set initial values
54 self.project = project 54 self.project = project
55 for ext, lexer in self.project.pdata["LEXERASSOCS"].items(): 55 for ext, lexer in list(self.project.pdata["LEXERASSOCS"].items()):
56 QTreeWidgetItem(self.editorLexerList, [ext, lexer]) 56 QTreeWidgetItem(self.editorLexerList, [ext, lexer])
57 self.editorLexerList.sortByColumn(0, Qt.AscendingOrder) 57 self.editorLexerList.sortByColumn(0, Qt.AscendingOrder)
58 58
59 @pyqtSlot() 59 @pyqtSlot()
60 def on_addLexerButton_clicked(self): 60 def on_addLexerButton_clicked(self):

eric ide

mercurial