Example #1
0
 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()
Example #2
0
 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()
Example #3
0
    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()