SqlBrowser/SqlBrowserWidget.py

changeset 3020
542e97d4ecb3
parent 2993
4933ac9daa80
child 3034
7ce719013078
child 3058
0a02c433f52d
equal deleted inserted replaced
3019:7912530a33e2 3020:542e97d4ecb3
38 38
39 self.table.addAction(self.insertRowAction) 39 self.table.addAction(self.insertRowAction)
40 self.table.addAction(self.deleteRowAction) 40 self.table.addAction(self.deleteRowAction)
41 41
42 if len(QSqlDatabase.drivers()) == 0: 42 if len(QSqlDatabase.drivers()) == 0:
43 E5MessageBox.information(self, 43 E5MessageBox.information(
44 self,
44 self.trUtf8("No database drivers found"), 45 self.trUtf8("No database drivers found"),
45 self.trUtf8( 46 self.trUtf8(
46 """This tool requires at least one Qt database driver. """ 47 """This tool requires at least one Qt database driver. """
47 """Please check the Qt documentation how to build the """ 48 """Please check the Qt documentation how to build the """
48 """Qt SQL plugins.""")) 49 """Qt SQL plugins."""))
154 driver, dbName, user, password, host, port = dlg.getData() 155 driver, dbName, user, password, host, port = dlg.getData()
155 err = self.addConnection( 156 err = self.addConnection(
156 driver, dbName, user, password, host, port) 157 driver, dbName, user, password, host, port)
157 158
158 if err.type() != QSqlError.NoError: 159 if err.type() != QSqlError.NoError:
159 E5MessageBox.warning(self, 160 E5MessageBox.warning(
161 self,
160 self.trUtf8("Unable to open database"), 162 self.trUtf8("Unable to open database"),
161 self.trUtf8( 163 self.trUtf8(
162 """An error occurred while opening the connection.""")) 164 """An error occurred while opening the connection."""))
163 165
164 def showTable(self, table): 166 def showTable(self, table):

eric ide

mercurial