src/eric7/Plugins/ViewManagerPlugins/Tabview/Tabview.py

branch
eric7
changeset 9758
6d24ab9c0404
parent 9653
e67609152c5e
child 10069
435cc5875135
equal deleted inserted replaced
9757:ab6e87f6f1c4 9758:6d24ab9c0404
486 txt = ericApp().getObject("Project").getRelativePath(fn) 486 txt = ericApp().getObject("Project").getRelativePath(fn)
487 487
488 maxFileNameChars = Preferences.getUI("TabViewManagerFilenameLength") 488 maxFileNameChars = Preferences.getUI("TabViewManagerFilenameLength")
489 if len(txt) > maxFileNameChars: 489 if len(txt) > maxFileNameChars:
490 txt = "...{0}".format(txt[-maxFileNameChars:]) 490 txt = "...{0}".format(txt[-maxFileNameChars:])
491 if editor.isReadOnly(): 491 if editor.checkReadOnly():
492 txt = self.tr("{0} (ro)").format(txt) 492 txt = self.tr("{0} (ro)").format(txt)
493 493
494 assembly = editor.parent() 494 assembly = editor.parent()
495 index = self.indexOf(assembly) 495 index = self.indexOf(assembly)
496 if index > -1: 496 if index > -1:
1050 txt = os.path.basename(fn) 1050 txt = os.path.basename(fn)
1051 else: 1051 else:
1052 txt = ericApp().getObject("Project").getRelativePath(fn) 1052 txt = ericApp().getObject("Project").getRelativePath(fn)
1053 if len(txt) > self.maxFileNameChars: 1053 if len(txt) > self.maxFileNameChars:
1054 txt = "...{0}".format(txt[-self.maxFileNameChars :]) 1054 txt = "...{0}".format(txt[-self.maxFileNameChars :])
1055 if not os.access(fn, os.W_OK): 1055 if editor.checkReadOnly():
1056 txt = self.tr("{0} (ro)").format(txt) 1056 txt = self.tr("{0} (ro)").format(txt)
1057 if addNext: 1057 if addNext:
1058 index = self.currentTabWidget.currentIndex() + 1 1058 index = self.currentTabWidget.currentIndex() + 1
1059 self.currentTabWidget.insertWidget(index, win, txt) 1059 self.currentTabWidget.insertWidget(index, win, txt)
1060 elif indexes: 1060 elif indexes:
1105 txt = os.path.basename(fn) 1105 txt = os.path.basename(fn)
1106 else: 1106 else:
1107 txt = ericApp().getObject("Project").getRelativePath(fn) 1107 txt = ericApp().getObject("Project").getRelativePath(fn)
1108 if len(txt) > self.maxFileNameChars: 1108 if len(txt) > self.maxFileNameChars:
1109 txt = "...{0}".format(txt[-self.maxFileNameChars :]) 1109 txt = "...{0}".format(txt[-self.maxFileNameChars :])
1110 if not os.access(fn, os.W_OK): 1110 if editor.checkReadOnly():
1111 txt = self.tr("{0} (ro)").format(txt) 1111 txt = self.tr("{0} (ro)").format(txt)
1112 nindex = tabWidget.insertWidget(index, win, txt) 1112 nindex = tabWidget.insertWidget(index, win, txt)
1113 tabWidget.setTabToolTip(nindex, fn) 1113 tabWidget.setTabToolTip(nindex, fn)
1114 tabWidget.setCurrentWidget(win) 1114 tabWidget.setCurrentWidget(win)
1115 win.show() 1115 win.show()
1496 txt = os.path.basename(fn) 1496 txt = os.path.basename(fn)
1497 else: 1497 else:
1498 txt = ericApp().getObject("Project").getRelativePath(fn) 1498 txt = ericApp().getObject("Project").getRelativePath(fn)
1499 if len(txt) > self.maxFileNameChars: 1499 if len(txt) > self.maxFileNameChars:
1500 txt = "...{0}".format(txt[-self.maxFileNameChars :]) 1500 txt = "...{0}".format(txt[-self.maxFileNameChars :])
1501 if not os.access(fn, os.W_OK): 1501 if editor.checkReadOnly():
1502 txt = self.tr("{0} (ro)").format(txt) 1502 txt = self.tr("{0} (ro)").format(txt)
1503 tabWidget.setTabText(index, txt) 1503 tabWidget.setTabText(index, txt)
1504 1504
1505 def getTabWidgetById(self, id_): 1505 def getTabWidgetById(self, id_):
1506 """ 1506 """

eric ide

mercurial