diff -r e9e7eca7efee -r bf71ee032bb4 src/eric7/SqlBrowser/SqlConnectionDialog.py --- a/src/eric7/SqlBrowser/SqlConnectionDialog.py Wed Jul 13 11:16:20 2022 +0200 +++ b/src/eric7/SqlBrowser/SqlConnectionDialog.py Wed Jul 13 14:55:47 2022 +0200 @@ -20,22 +20,22 @@ """ Class implementing a dialog to enter the connection parameters. """ + def __init__(self, parent=None): """ Constructor - + @param parent reference to the parent widget (QWidget) """ super().__init__(parent) self.setupUi(self) - + self.databasePicker.setMode(EricPathPickerModes.OPEN_FILE_MODE) - - self.okButton = self.buttonBox.button( - QDialogButtonBox.StandardButton.Ok) - + + self.okButton = self.buttonBox.button(QDialogButtonBox.StandardButton.Ok) + drivers = QSqlDatabase.drivers() - + # remove compatibility names if "QMYSQL3" in drivers: drivers.remove("QMYSQL3") @@ -47,14 +47,14 @@ drivers.remove("QPSQL7") if "QTDS7" in drivers: drivers.remove("QTDS7") - + self.driverCombo.addItems(drivers) - + self.__updateDialog() - + msh = self.minimumSizeHint() self.resize(max(self.width(), msh.width()), msh.height()) - + def __updateDialog(self): """ Private slot to update the dialog depending on its contents. @@ -64,35 +64,35 @@ self.databasePicker.setPickerEnabled(True) else: self.databasePicker.setPickerEnabled(False) - + if self.databasePicker.text() == "" or driver == "": self.okButton.setEnabled(False) else: self.okButton.setEnabled(True) - + @pyqtSlot(int) def on_driverCombo_activated(self, index): """ Private slot handling the selection of a database driver. - + @param index index of the selected entry @type int """ self.__updateDialog() - + @pyqtSlot(str) def on_databasePicker_textChanged(self, txt): """ Private slot handling the change of the database name. - + @param txt text of the edit (string) """ self.__updateDialog() - + def getData(self): """ Public method to retrieve the connection data. - + @return tuple giving the driver name (string), the database name (string), the user name (string), the password (string), the host name (string) and the port (integer)