166 """ |
166 """ |
167 Public slot to add a database connection via an input dialog. |
167 Public slot to add a database connection via an input dialog. |
168 """ |
168 """ |
169 from .SqlConnectionDialog import SqlConnectionDialog |
169 from .SqlConnectionDialog import SqlConnectionDialog |
170 |
170 |
171 dlg = SqlConnectionDialog(self) |
171 dlg = SqlConnectionDialog(parent=self) |
172 if dlg.exec() == QDialog.DialogCode.Accepted: |
172 if dlg.exec() == QDialog.DialogCode.Accepted: |
173 driver, dbName, user, password, host, port = dlg.getData() |
173 driver, dbName, user, password, host, port = dlg.getData() |
174 err = self.addConnection(driver, dbName, user, password, host, port) |
174 err = self.addConnection(driver, dbName, user, password, host, port) |
175 |
175 |
176 if err.type() != QSqlError.ErrorType.NoError: |
176 if err.type() != QSqlError.ErrorType.NoError: |