def __init__(self, parent=None): ClosableTabWidget.__init__(self, parent) self.currentChanged.connect(self._tab_changed) self.known_server_widget = KnownServerWidget() self.addTab(self.known_server_widget, _("Known Servers"))
def closeAll(self): """ re-implement the base class method """ result = self.count() <= 1 if self.count() > 1: result = ClosableTabWidget.closeAll(self, _("End All Postgres Sessions and")) if result: self.addTab(self.known_server_widget, _("Known Servers")) LOGGER.debug("emitting end_pg_session signal") self.emit(QtCore.SIGNAL("end_pg_session")) return result
def closeAll(self): ''' re-implement the base class method ''' result = self.count() <= 1 if self.count() > 1: result = ClosableTabWidget.closeAll(self, _("End All Postgres Sessions and")) if result: self.addTab(self.known_server_widget, _("Known Servers")) LOGGER.debug("emitting end_pg_session signal") self.emit(QtCore.SIGNAL("end_pg_session")) return result
def addTab(self, *args): ClosableTabWidget.addTab(self, *args) self.setCurrentIndex(self.count()-1)
def addTab(self, *args): ClosableTabWidget.addTab(self, *args) self.setCurrentIndex(self.count() - 1)