101 self.editorLexerList.header().sortIndicatorOrder()) |
101 self.editorLexerList.header().sortIndicatorOrder()) |
102 |
102 |
103 @pyqtSlot() |
103 @pyqtSlot() |
104 def on_deleteLexerButton_clicked(self): |
104 def on_deleteLexerButton_clicked(self): |
105 """ |
105 """ |
106 Private slot to delete the currently selected lexer association of the list. |
106 Private slot to delete the currently selected lexer association of the |
|
107 list. |
107 """ |
108 """ |
108 itmList = self.editorLexerList.selectedItems() |
109 itmList = self.editorLexerList.selectedItems() |
109 if itmList: |
110 if itmList: |
110 index = self.editorLexerList.indexOfTopLevelItem(itmList[0]) |
111 index = self.editorLexerList.indexOfTopLevelItem(itmList[0]) |
111 itm = self.editorLexerList.takeTopLevelItem(index) |
112 itm = self.editorLexerList.takeTopLevelItem(index) |
115 self.editorFileExtEdit.clear() |
116 self.editorFileExtEdit.clear() |
116 self.editorLexerCombo.setCurrentIndex(0) |
117 self.editorLexerCombo.setCurrentIndex(0) |
117 |
118 |
118 def on_editorLexerList_itemClicked(self, itm, column): |
119 def on_editorLexerList_itemClicked(self, itm, column): |
119 """ |
120 """ |
120 Private slot to handle the clicked signal of the lexer association list. |
121 Private slot to handle the clicked signal of the lexer association |
|
122 list. |
121 |
123 |
122 @param itm reference to the selecte item (QTreeWidgetItem) |
124 @param itm reference to the selecte item (QTreeWidgetItem) |
123 @param column column the item was clicked or activated (integer) (ignored) |
125 @param column column the item was clicked or activated (integer) |
|
126 (ignored) |
124 """ |
127 """ |
125 if itm is None: |
128 if itm is None: |
126 self.editorFileExtEdit.clear() |
129 self.editorFileExtEdit.clear() |
127 self.editorLexerCombo.setCurrentIndex(0) |
130 self.editorLexerCombo.setCurrentIndex(0) |
128 self.pygmentsLexerCombo.setCurrentIndex(0) |
131 self.pygmentsLexerCombo.setCurrentIndex(0) |
139 self.editorLexerCombo.setCurrentIndex(index) |
142 self.editorLexerCombo.setCurrentIndex(index) |
140 self.pygmentsLexerCombo.setCurrentIndex(pygmentsIndex) |
143 self.pygmentsLexerCombo.setCurrentIndex(pygmentsIndex) |
141 |
144 |
142 def on_editorLexerList_itemActivated(self, itm, column): |
145 def on_editorLexerList_itemActivated(self, itm, column): |
143 """ |
146 """ |
144 Private slot to handle the activated signal of the lexer association list. |
147 Private slot to handle the activated signal of the lexer association |
|
148 list. |
145 |
149 |
146 @param itm reference to the selecte item (QTreeWidgetItem) |
150 @param itm reference to the selecte item (QTreeWidgetItem) |
147 @param column column the item was clicked or activated (integer) (ignored) |
151 @param column column the item was clicked or activated (integer) |
|
152 (ignored) |
148 """ |
153 """ |
149 self.on_editorLexerList_itemClicked(itm, column) |
154 self.on_editorLexerList_itemClicked(itm, column) |
150 |
155 |
151 @pyqtSlot(str) |
156 @pyqtSlot(str) |
152 def on_editorLexerCombo_currentIndexChanged(self, text): |
157 def on_editorLexerCombo_currentIndexChanged(self, text): |
153 """ |
158 """ |
154 Private slot to handle the selection of a lexer. |
159 Private slot to handle the selection of a lexer. |
|
160 |
|
161 @param text text of the lexer combo (string) |
155 """ |
162 """ |
156 if text in self.extras: |
163 if text in self.extras: |
157 self.pygmentsLexerCombo.setEnabled(True) |
164 self.pygmentsLexerCombo.setEnabled(True) |
158 self.pygmentsLabel.setEnabled(True) |
165 self.pygmentsLabel.setEnabled(True) |
159 else: |
166 else: |