def acceptdlg(self): ''' On user clicking the login button ''' isValid = self.validateInput() if isValid: #Capture DB connection properties host = self.txtHost.text() port = self.txtPort.text() database = self.txtDatabase.text() dbconfig = DatabaseConfig() self.dbconn = DatabaseConnection(host, port, database) #Write DB conn object to the registry dbconfig.write(self.dbconn) self.accept()
def acceptdlg(self): ''' On user clicking the login button ''' isValid = self.validateInput() if isValid: #Capture DB connection properties host = self.txtHost.text() port = self.txtPort.text() database = self.txtDatabase.text() dbconfig = DatabaseConfig() self.dbconn = DatabaseConnection(host,port,database) #Write DB conn object to the registry dbconfig.write(self.dbconn) self.accept()
def acceptdlg(self): ''' On user clicking the login button ''' isValid = self.validateInput() if isValid: #Capture DB connection properties host = self.txtHost.text() port = self.txtPort.text() database = self.txtDatabase.text() dbconfig = DatabaseConfig() try: self.dbconn = DatabaseConnection(host,port,database) #Write DB conn object to the registry dbconfig.write(self.dbconn) except Exception as ex: QMessageBox.critical(self, QApplication.translate("DbConnectionDialog","Error saving settings"), QApplication.translate("DbConnectionDialog",unicode(ex.message))) self.accept()