1193 index = self.currentTabWidget.indexOf(editor) |
1193 index = self.currentTabWidget.indexOf(editor) |
1194 self.currentTabWidget.setTabText(index, tabName) |
1194 self.currentTabWidget.setTabText(index, tabName) |
1195 self.currentTabWidget.setTabToolTip(index, newName) |
1195 self.currentTabWidget.setTabToolTip(index, newName) |
1196 self.changeCaption.emit(newName) |
1196 self.changeCaption.emit(newName) |
1197 |
1197 |
1198 def _modificationStatusChanged(self, m, editor): |
1198 def __setIcon(self, editor, modified): |
1199 """ |
1199 """ |
1200 Protected slot to handle the modificationStatusChanged signal. |
1200 Private method to set the icon for the given editor. |
1201 |
1201 |
1202 @param m flag indicating the modification status |
1202 @param editor reference to the editor to set the icon for |
|
1203 @type Editor |
|
1204 @param modified flag indicating the modification status |
1203 @type bool |
1205 @type bool |
1204 @param editor editor window changed |
|
1205 @type Editor |
|
1206 """ |
1206 """ |
1207 for tw in self.tabWidgets: |
1207 for tw in self.tabWidgets: |
1208 if tw.hasEditor(editor): |
1208 if tw.hasEditor(editor): |
1209 break |
1209 break |
1210 index = tw.indexOf(editor) |
1210 index = tw.indexOf(editor) |
1211 keys = [] |
1211 keys = [] |
1212 if m: |
1212 if modified: |
1213 keys.append("fileModified") |
1213 keys.append("fileModified") |
1214 if editor.hasSyntaxErrors(): |
1214 if editor.hasSyntaxErrors(): |
1215 keys.append("syntaxError22") |
1215 keys.append("syntaxError22") |
1216 elif editor.hasWarnings(): |
1216 elif editor.hasWarnings(): |
1217 keys.append("warning22") |
1217 keys.append("warning22") |
1218 if not keys: |
1218 if not keys: |
1219 keys.append("empty") |
1219 keys.append("empty") |
1220 tw.setTabIcon(index, EricPixmapCache.getCombinedIcon(keys)) |
1220 tw.setTabIcon(index, EricPixmapCache.getCombinedIcon(keys)) |
1221 self._checkActions(editor) |
1221 |
1222 |
1222 def _modificationStatusChanged(self, modified, editor): |
1223 def _syntaxErrorToggled(self, editor): |
1223 """ |
1224 """ |
1224 Protected slot to handle the modificationStatusChanged signal. |
1225 Protected slot to handle the syntaxerrorToggled signal. |
1225 |
1226 |
1226 @param modified flag indicating the modification status |
|
1227 @type bool |
1227 @param editor editor that sent the signal |
1228 @param editor editor that sent the signal |
1228 @type Editor |
1229 @type Editor |
1229 """ |
1230 """ |
1230 for tw in self.tabWidgets: |
1231 self.__setIcon(editor, modified) |
1231 if tw.hasEditor(editor): |
1232 self._checkActions(editor) |
1232 break |
1233 |
1233 index = tw.indexOf(editor) |
1234 def _syntaxErrorToggled(self, editor): |
1234 keys = [] |
1235 """ |
1235 if editor.isModified(): |
1236 Protected slot to handle the syntaxerrorToggled signal. |
1236 keys.append("fileModified") |
1237 |
1237 if editor.hasSyntaxErrors(): |
1238 @param editor editor that sent the signal |
1238 keys.append("syntaxError22") |
1239 @type Editor |
1239 elif editor.hasWarnings(): |
1240 """ |
1240 keys.append("warning22") |
1241 self.__setIcon(editor, editor.isModified()) |
1241 if not keys: |
|
1242 keys.append("empty") |
|
1243 tw.setTabIcon(index, EricPixmapCache.getCombinedIcon(keys)) |
|
1244 |
1242 |
1245 ViewManager._syntaxErrorToggled(self, editor) |
1243 ViewManager._syntaxErrorToggled(self, editor) |
1246 |
1244 |
1247 def addSplit(self): |
1245 def addSplit(self): |
1248 """ |
1246 """ |