'Add tab'

def add_tab(self, widget, name, filename=''):

    self.clients.append(widget)
    index = self.tabwidget.addTab(widget, name)
    self.filenames.insert(index, filename)
    self.tabwidget.setCurrentIndex(index)
    if (self.dockwidget and (not self.ismaximized)):
        self.dockwidget.setVisible(True)
        self.dockwidget.raise_()
    self.activateWindow()
    widget.get_control().setFocus()
    self.update_tabs_text()
