Plugins/ViewManagerPlugins/Tabview/Tabview.py

changeset 560
0a621357b213
parent 501
5c615a85241a
child 638
265c31231d9d
equal deleted inserted replaced
559:ee695ebbd6e0 560:0a621357b213
863 Public method to change the displayed name of the editor. 863 Public method to change the displayed name of the editor.
864 864
865 @param editor editor window to be changed 865 @param editor editor window to be changed
866 @param newName new name to be shown (string) 866 @param newName new name to be shown (string)
867 """ 867 """
868 if self.filenameOnly: 868 if newName:
869 tabName = os.path.basename(newName) 869 if self.filenameOnly:
870 else: 870 tabName = os.path.basename(newName)
871 tabName = e5App().getObject("Project").getRelativePath(newName) 871 else:
872 if len(tabName) > self.maxFileNameChars: 872 tabName = e5App().getObject("Project").getRelativePath(newName)
873 tabName = "...{0}".format(tabName[-self.maxFileNameChars:]) 873 if len(tabName) > self.maxFileNameChars:
874 index = self.currentTabWidget.indexOf(editor) 874 tabName = "...{0}".format(tabName[-self.maxFileNameChars:])
875 self.currentTabWidget.setTabText(index, tabName) 875 index = self.currentTabWidget.indexOf(editor)
876 self.currentTabWidget.setTabToolTip(index, newName) 876 self.currentTabWidget.setTabText(index, tabName)
877 self.changeCaption.emit(newName) 877 self.currentTabWidget.setTabToolTip(index, newName)
878 self.changeCaption.emit(newName)
878 879
879 def _modificationStatusChanged(self, m, editor): 880 def _modificationStatusChanged(self, m, editor):
880 """ 881 """
881 Protected slot to handle the modificationStatusChanged signal. 882 Protected slot to handle the modificationStatusChanged signal.
882 883

eric ide

mercurial