src/eric7/Plugins/ViewManagerPlugins/Listspace/Listspace.py

branch
eric7
changeset 10849
78d338b6d89f
parent 10690
fab36645aa7d
child 11090
f5f5f5803935
equal deleted inserted replaced
10848:328c9a177c64 10849:78d338b6d89f
64 @param widget widget to be removed 64 @param widget widget to be removed
65 @type QWidget 65 @type QWidget
66 """ 66 """
67 if isinstance(widget, Editor): 67 if isinstance(widget, Editor):
68 self.editors.remove(widget) 68 self.editors.remove(widget)
69 widget = widget.parent() 69 widget = widget.getAssembly()
70 super().removeWidget(widget) 70 super().removeWidget(widget)
71 71
72 def currentWidget(self): 72 def currentWidget(self):
73 """ 73 """
74 Public method to get a reference to the current editor. 74 Public method to get a reference to the current editor.
90 """ 90 """
91 if widget is not None: 91 if widget is not None:
92 if isinstance(widget, Editor): 92 if isinstance(widget, Editor):
93 self.editors.remove(widget) 93 self.editors.remove(widget)
94 self.editors.insert(0, widget) 94 self.editors.insert(0, widget)
95 widget = widget.parent() 95 widget = widget.getAssembly()
96 super().setCurrentWidget(widget) 96 super().setCurrentWidget(widget)
97 97
98 def setCurrentIndex(self, index): 98 def setCurrentIndex(self, index):
99 """ 99 """
100 Public method to set the current widget by its index. 100 Public method to set the current widget by its index.
458 if len(self.editors) > 1: 458 if len(self.editors) > 1:
459 ind = 1 459 ind = 1
460 else: 460 else:
461 return 461 return
462 stack.setCurrentWidget(stack.firstEditor()) 462 stack.setCurrentWidget(stack.firstEditor())
463 self._showView(self.editors[ind].parent()) 463 self._showView(self.editors[ind].getAssembly())
464 464
465 aw = self.activeWindow() 465 aw = self.activeWindow()
466 fn = aw and aw.getFileName() or None 466 fn = aw and aw.getFileName() or None
467 if fn: 467 if fn:
468 self.changeCaption.emit(fn) 468 self.changeCaption.emit(fn)
593 593
594 @param row row number of the item clicked on 594 @param row row number of the item clicked on
595 @type int 595 @type int
596 """ 596 """
597 if row != -1: 597 if row != -1:
598 self._showView(self.editors[row].parent()) 598 self._showView(self.editors[row].getAssembly())
599 self._checkActions(self.editors[row]) 599 self._checkActions(self.editors[row])
600 600
601 def activeWindow(self): 601 def activeWindow(self):
602 """ 602 """
603 Public method to return the active (i.e. current) window. 603 Public method to return the active (i.e. current) window.

eric ide

mercurial