632 itm.setText(txt) |
632 itm.setText(txt) |
633 itm.setToolTip(newName) |
633 itm.setToolTip(newName) |
634 self.viewlist.setCurrentRow(currentRow) |
634 self.viewlist.setCurrentRow(currentRow) |
635 self.changeCaption.emit(newName) |
635 self.changeCaption.emit(newName) |
636 |
636 |
637 def _modificationStatusChanged(self, m, editor): |
637 def __setIcon(self, editor, modified): |
638 """ |
638 """ |
639 Protected slot to handle the modificationStatusChanged signal. |
639 Private method to set the icon for the given editor. |
640 |
640 |
641 @param m flag indicating the modification status |
641 @param editor reference to the editor to set the icon for |
|
642 @type Editor |
|
643 @param modified flag indicating the modification status |
642 @type bool |
644 @type bool |
643 @param editor editor window changed |
|
644 @type Editor |
|
645 """ |
645 """ |
646 currentRow = self.viewlist.currentRow() |
646 currentRow = self.viewlist.currentRow() |
647 index = self.editors.index(editor) |
647 index = self.editors.index(editor) |
648 keys = [] |
648 keys = [] |
649 if m: |
649 if modified: |
650 keys.append("fileModified") |
650 keys.append("fileModified") |
651 if editor.hasSyntaxErrors(): |
651 if editor.hasSyntaxErrors(): |
652 keys.append("syntaxError22") |
652 keys.append("syntaxError22") |
653 elif editor.hasWarnings(): |
653 elif editor.hasWarnings(): |
654 keys.append("warning22") |
654 keys.append("warning22") |
656 keys.append("empty") |
656 keys.append("empty") |
657 item = self.viewlist.item(index) |
657 item = self.viewlist.item(index) |
658 if item: |
658 if item: |
659 item.setIcon(EricPixmapCache.getCombinedIcon(keys)) |
659 item.setIcon(EricPixmapCache.getCombinedIcon(keys)) |
660 self.viewlist.setCurrentRow(currentRow) |
660 self.viewlist.setCurrentRow(currentRow) |
661 self._checkActions(editor) |
661 |
662 |
662 def _modificationStatusChanged(self, modified, editor): |
663 def _syntaxErrorToggled(self, editor): |
663 """ |
664 """ |
664 Protected slot to handle the modificationStatusChanged signal. |
665 Protected slot to handle the syntaxerrorToggled signal. |
665 |
666 |
666 @param modified flag indicating the modification status |
|
667 @type bool |
667 @param editor editor that sent the signal |
668 @param editor editor that sent the signal |
668 @type Editor |
669 @type Editor |
669 """ |
670 """ |
670 currentRow = self.viewlist.currentRow() |
671 self.__setIcon(editor, modified) |
671 index = self.editors.index(editor) |
672 self._checkActions(editor) |
672 keys = [] |
673 |
673 if editor.isModified(): |
674 def _syntaxErrorToggled(self, editor): |
674 keys.append("fileModified") |
675 """ |
675 if editor.hasSyntaxErrors(): |
676 Protected slot to handle the syntaxerrorToggled signal. |
676 keys.append("syntaxError22") |
677 |
677 elif editor.hasWarnings(): |
678 @param editor editor that sent the signal |
678 keys.append("warning22") |
679 @type Editor |
679 if not keys: |
680 """ |
680 keys.append("empty") |
681 self.__setIcon(editor, editor.isModified()) |
681 item = self.viewlist.item(index) |
|
682 if item: |
|
683 item.setIcon(EricPixmapCache.getCombinedIcon(keys)) |
|
684 self.viewlist.setCurrentRow(currentRow) |
|
685 |
|
686 ViewManager._syntaxErrorToggled(self, editor) |
682 ViewManager._syntaxErrorToggled(self, editor) |
687 |
683 |
688 def addSplit(self): |
684 def addSplit(self): |
689 """ |
685 """ |
690 Public method used to split the current view. |
686 Public method used to split the current view. |