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

branch
eric7
changeset 10849
78d338b6d89f
parent 10690
fab36645aa7d
child 10879
25c211d24fd3
equal deleted inserted replaced
10848:328c9a177c64 10849:78d338b6d89f
500 if len(txt) > maxFileNameChars: 500 if len(txt) > maxFileNameChars:
501 txt = "...{0}".format(txt[-maxFileNameChars:]) 501 txt = "...{0}".format(txt[-maxFileNameChars:])
502 if editor.checkReadOnly(): 502 if editor.checkReadOnly():
503 txt = self.tr("{0} (ro)").format(txt) 503 txt = self.tr("{0} (ro)").format(txt)
504 504
505 assembly = editor.parent() 505 assembly = editor.getAssembly()
506 index = self.indexOf(assembly) 506 index = self.indexOf(assembly)
507 if index > -1: 507 if index > -1:
508 self.setTabText(index, txt) 508 self.setTabText(index, txt)
509 self.setTabToolTip(index, fn) 509 self.setTabToolTip(index, fn)
510 510
532 """ 532 """
533 if isinstance(widget, Editor): 533 if isinstance(widget, Editor):
534 widget.cursorLineChanged.disconnect() 534 widget.cursorLineChanged.disconnect()
535 widget.captionChanged.disconnect() 535 widget.captionChanged.disconnect()
536 self.editors.remove(widget) 536 self.editors.remove(widget)
537 index = self.indexOf(widget.parent()) 537 index = self.indexOf(widget.getAssembly())
538 else: 538 else:
539 index = self.indexOf(widget) 539 index = self.indexOf(widget)
540 if index > -1: 540 if index > -1:
541 self.removeTab(index) 541 self.removeTab(index)
542 542
645 @type QLabel or Editor 645 @type QLabel or Editor
646 @return tab index of the editor 646 @return tab index of the editor
647 @rtype int 647 @rtype int
648 """ 648 """
649 if isinstance(widget, Editor): 649 if isinstance(widget, Editor):
650 widget = widget.parent() 650 widget = widget.getAssembly()
651 return super().indexOf(widget) 651 return super().indexOf(widget)
652 652
653 def hasEditor(self, editor): 653 def hasEditor(self, editor):
654 """ 654 """
655 Public method to check for an editor. 655 Public method to check for an editor.

eric ide

mercurial