diff -r ea526b78ee6c -r 6ba512d9f46a Plugins/ViewManagerPlugins/Tabview/Tabview.py --- a/Plugins/ViewManagerPlugins/Tabview/Tabview.py Tue Mar 07 18:53:18 2017 +0100 +++ b/Plugins/ViewManagerPlugins/Tabview/Tabview.py Tue Mar 07 19:46:57 2017 +0100 @@ -443,19 +443,19 @@ if fn: self.vm.editorLineChanged.emit(fn, lineno + 1) - def removeWidget(self, object): + def removeWidget(self, widget): """ Public method to remove a widget. - @param object object to be removed (QWidget) + @param widget widget to be removed (QWidget) """ - if isinstance(object, QScintilla.Editor.Editor): - object.cursorLineChanged.disconnect(self.__cursorLineChanged) - object.captionChanged.disconnect(self.__captionChange) - self.editors.remove(object) - index = self.indexOf(object.parent()) + if isinstance(widget, QScintilla.Editor.Editor): + widget.cursorLineChanged.disconnect(self.__cursorLineChanged) + widget.captionChanged.disconnect(self.__captionChange) + self.editors.remove(widget) + index = self.indexOf(widget.parent()) else: - index = self.indexOf(object) + index = self.indexOf(widget) if index > -1: self.removeTab(index) @@ -547,16 +547,16 @@ """ super(TabWidget, self).setCurrentWidget(assembly) - def indexOf(self, object): + def indexOf(self, widget): """ Public method to get the tab index of the given editor. - @param object object to get the index for (QLabel or Editor) + @param widget widget to get the index for (QLabel or Editor) @return tab index of the editor (integer) """ - if isinstance(object, QScintilla.Editor.Editor): - object = object.parent() - return super(TabWidget, self).indexOf(object) + if isinstance(widget, QScintilla.Editor.Editor): + widget = widget.parent() + return super(TabWidget, self).indexOf(widget) def hasEditor(self, editor): """ @@ -870,14 +870,14 @@ self.changeCaption.emit("") self.editorChangedEd.emit(aw) - def _addView(self, win, fn=None, noName="", next=False): + def _addView(self, win, fn=None, noName="", addNext=False): """ Protected method to add a view (i.e. window). @param win editor assembly to be added @param fn filename of this editor (string) @param noName name to be used for an unnamed editor (string) - @param next flag indicating to add the view next to the current + @param addNext flag indicating to add the view next to the current view (bool) """ editor = win.getEditor() @@ -885,7 +885,7 @@ if not noName: self.untitledCount += 1 noName = self.tr("Untitled {0}").format(self.untitledCount) - if next: + if addNext: index = self.currentTabWidget.currentIndex() + 1 self.currentTabWidget.insertWidget(index, win, noName) else: @@ -900,7 +900,7 @@ txt = "...{0}".format(txt[-self.maxFileNameChars:]) if not QFileInfo(fn).isWritable(): txt = self.tr("{0} (ro)").format(txt) - if next: + if addNext: index = self.currentTabWidget.currentIndex() + 1 self.currentTabWidget.insertWidget(index, win, txt) else: