def newConnection(self, explorer): dlg = NewPgConnectionDialog(explorer) dlg.exec_() if dlg.conn is not None: item = PgConnectionItem(dlg.conn) if dlg.conn.isValid: item.populate() else: wrongConnectionIcon = QtGui.QIcon(os.path.dirname(__file__) + "/../images/wrong.gif") item.setIcon(0, wrongConnectionIcon) self.addChild(item)
def newConnection(self, explorer): dlg = NewPgConnectionDialog(explorer) dlg.exec_() if dlg.conn is not None: self.databases.append(dlg.conn) item = PgConnectionItem(dlg.conn) if dlg.conn.isValid: item.populate() else: wrongConnectionIcon = QtGui.QIcon( os.path.dirname(__file__) + "/../images/wrong.gif") item.setIcon(0, wrongConnectionIcon) self.addChild(item)
def editConnection(self, explorer): dlg = NewPgConnectionDialog(explorer, self.element) dlg.exec_() if dlg.conn is not None: self.parent().refreshContent(explorer)