59 def save(self): |
59 def save(self): |
60 """ |
60 """ |
61 Public slot to save the Editor Highlighter Associations configuration. |
61 Public slot to save the Editor Highlighter Associations configuration. |
62 """ |
62 """ |
63 lexerAssocs = {} |
63 lexerAssocs = {} |
64 for index in range(\ |
64 for index in range( |
65 self.editorLexerList.topLevelItemCount()): |
65 self.editorLexerList.topLevelItemCount()): |
66 itm = self.editorLexerList.topLevelItem(index) |
66 itm = self.editorLexerList.topLevelItem(index) |
67 lexerAssocs[itm.text(0)] = itm.text(1) |
67 lexerAssocs[itm.text(0)] = itm.text(1) |
68 Preferences.setEditorLexerAssocs(lexerAssocs) |
68 Preferences.setEditorLexerAssocs(lexerAssocs) |
69 |
69 |
81 if not pygmentsLexer: |
81 if not pygmentsLexer: |
82 lexer = pygmentsLexer |
82 lexer = pygmentsLexer |
83 else: |
83 else: |
84 lexer = "Pygments|{0}".format(pygmentsLexer) |
84 lexer = "Pygments|{0}".format(pygmentsLexer) |
85 if ext and lexer: |
85 if ext and lexer: |
86 itmList = self.editorLexerList.findItems(\ |
86 itmList = self.editorLexerList.findItems( |
87 ext, Qt.MatchFlags(Qt.MatchExactly), 0) |
87 ext, Qt.MatchFlags(Qt.MatchExactly), 0) |
88 if itmList: |
88 if itmList: |
89 index = self.editorLexerList.indexOfTopLevelItem(itmList[0]) |
89 index = self.editorLexerList.indexOfTopLevelItem(itmList[0]) |
90 itm = self.editorLexerList.takeTopLevelItem(index) |
90 itm = self.editorLexerList.takeTopLevelItem(index) |
91 del itm |
91 del itm |