152 """ |
152 """ |
153 Public slot to add a database connection via an input dialog. |
153 Public slot to add a database connection via an input dialog. |
154 """ |
154 """ |
155 from .SqlConnectionDialog import SqlConnectionDialog |
155 from .SqlConnectionDialog import SqlConnectionDialog |
156 dlg = SqlConnectionDialog(self) |
156 dlg = SqlConnectionDialog(self) |
157 if dlg.exec_() == QDialog.Accepted: |
157 if dlg.exec() == QDialog.Accepted: |
158 driver, dbName, user, password, host, port = dlg.getData() |
158 driver, dbName, user, password, host, port = dlg.getData() |
159 err = self.addConnection( |
159 err = self.addConnection( |
160 driver, dbName, user, password, host, port) |
160 driver, dbName, user, password, host, port) |
161 |
161 |
162 if err.type() != QSqlError.NoError: |
162 if err.type() != QSqlError.NoError: |