mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
dbManager - remove more 'Sorry' strings
This commit is contained in:
parent
cb414f5d2c
commit
a9c4136aa9
@ -46,7 +46,7 @@ class DlgAddGeometryColumn(QDialog, Ui_Dialog):
|
||||
def createGeomColumn(self):
|
||||
""" first check whether everything's fine """
|
||||
if self.editName.text() == "":
|
||||
QMessageBox.critical(self, self.tr("Sorry"), self.tr("field name must not be empty"))
|
||||
QMessageBox.critical(self, self.tr("DB Manager"), self.tr("field name must not be empty"))
|
||||
return
|
||||
|
||||
name = self.editName.text()
|
||||
|
@ -206,7 +206,7 @@ class DlgCreateTable(QDialog, Ui_Dialog):
|
||||
""" delete selected field """
|
||||
row = self.selectedField()
|
||||
if row is None:
|
||||
QMessageBox.information(self, self.tr("Sorry"), self.tr("no field selected"))
|
||||
QMessageBox.information(self, self.tr("DB Manager"), self.tr("no field selected"))
|
||||
else:
|
||||
self.fields.model().removeRows(row,1)
|
||||
|
||||
@ -216,10 +216,10 @@ class DlgCreateTable(QDialog, Ui_Dialog):
|
||||
""" move selected field up """
|
||||
row = self.selectedField()
|
||||
if row is None:
|
||||
QMessageBox.information(self, self.tr("Sorry"), self.tr("no field selected"))
|
||||
QMessageBox.information(self, self.tr("DB Manager"), self.tr("no field selected"))
|
||||
return
|
||||
if row == 0:
|
||||
QMessageBox.information(self, self.tr("Sorry"), self.tr("field is at top already"))
|
||||
QMessageBox.information(self, self.tr("DB Manager"), self.tr("field is at top already"))
|
||||
return
|
||||
|
||||
# take row and reinsert it
|
||||
@ -236,10 +236,10 @@ class DlgCreateTable(QDialog, Ui_Dialog):
|
||||
""" move selected field down """
|
||||
row = self.selectedField()
|
||||
if row is None:
|
||||
QMessageBox.information(self, self.tr("Sorry"), self.tr("No field selected"))
|
||||
QMessageBox.information(self, self.tr("DB Manager"), self.tr("No field selected"))
|
||||
return
|
||||
if row == self.fields.model().rowCount()-1:
|
||||
QMessageBox.information(self, self.tr("Sorry"), self.tr("field is at bottom already"))
|
||||
QMessageBox.information(self, self.tr("DB Manager"), self.tr("field is at bottom already"))
|
||||
return
|
||||
|
||||
# take row and reinsert it
|
||||
@ -259,24 +259,24 @@ class DlgCreateTable(QDialog, Ui_Dialog):
|
||||
else:
|
||||
schema = unicode(self.cboSchema.currentText())
|
||||
if len(schema) == 0:
|
||||
QMessageBox.information(self, self.tr("Sorry"), self.tr("select schema!"))
|
||||
QMessageBox.information(self, self.tr("DB Manager"), self.tr("select schema!"))
|
||||
return
|
||||
|
||||
table = unicode(self.editName.text())
|
||||
if len(table) == 0:
|
||||
QMessageBox.information(self, self.tr("Sorry"), self.tr("enter table name!"))
|
||||
QMessageBox.information(self, self.tr("DB Manager"), self.tr("enter table name!"))
|
||||
return
|
||||
|
||||
m = self.fields.model()
|
||||
if m.rowCount() == 0:
|
||||
QMessageBox.information(self, self.tr("Sorry"), self.tr("add some fields!"))
|
||||
QMessageBox.information(self, self.tr("DB Manager"), self.tr("add some fields!"))
|
||||
return
|
||||
|
||||
useGeomColumn = self.chkGeomColumn.isChecked()
|
||||
if useGeomColumn:
|
||||
geomColumn = unicode(self.editGeomColumn.text())
|
||||
if len(geomColumn) == 0:
|
||||
QMessageBox.information(self, self.tr("Sorry"), self.tr("set geometry column name"))
|
||||
QMessageBox.information(self, self.tr("DB Manager"), self.tr("set geometry column name"))
|
||||
return
|
||||
|
||||
geomType = self.GEOM_TYPES[ self.cboGeomType.currentIndex() ]
|
||||
|
@ -77,10 +77,10 @@ class DlgFieldProperties(QDialog, Ui_Dialog):
|
||||
""" first check whether everything's fine """
|
||||
fld = self.getField(True) # don't change the original copy
|
||||
if fld.name == "":
|
||||
QMessageBox.critical(self, self.tr("Sorry"), self.tr("field name must not be empty"))
|
||||
QMessageBox.critical(self, self.tr("DB Manager"), self.tr("field name must not be empty"))
|
||||
return
|
||||
if fld.dataType == "":
|
||||
QMessageBox.critical(self, self.tr("Sorry"), self.tr("field type must not be empty"))
|
||||
QMessageBox.critical(self, self.tr("DB Manager"), self.tr("field type must not be empty"))
|
||||
return
|
||||
|
||||
self.accept()
|
||||
|
@ -167,16 +167,16 @@ class DlgSqlWindow(QDialog, Ui_Dialog):
|
||||
geomFieldName = self.geomCombo.currentText()
|
||||
|
||||
if geomFieldName == "" or uniqueFieldName == "":
|
||||
QMessageBox.warning(self, self.tr( "Sorry" ), self.tr( "You must fill the required fields: \ngeometry column - column with unique integer values" ) )
|
||||
QMessageBox.warning(self, self.tr( "DB Manager" ), self.tr( "You must fill the required fields: \ngeometry column - column with unique integer values" ) )
|
||||
return
|
||||
|
||||
query = self.editSql.text()
|
||||
if query == "":
|
||||
return
|
||||
|
||||
|
||||
# remove a trailing ';' from query if present
|
||||
if query.strip().endswith(';'):
|
||||
query = query.strip()[:-1]
|
||||
query = query.strip()[:-1]
|
||||
|
||||
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
|
||||
|
||||
@ -220,11 +220,11 @@ class DlgSqlWindow(QDialog, Ui_Dialog):
|
||||
if not escaped.search(query):
|
||||
break
|
||||
aliasIndex += 1
|
||||
|
||||
|
||||
# remove a trailing ';' from query if present
|
||||
if query.strip().endswith(';'):
|
||||
query = query.strip()[:-1]
|
||||
|
||||
|
||||
# get all the columns
|
||||
cols = []
|
||||
connector = self.db.connector
|
||||
@ -244,7 +244,7 @@ class DlgSqlWindow(QDialog, Ui_Dialog):
|
||||
if c:
|
||||
c.close()
|
||||
del c
|
||||
|
||||
|
||||
# get sensible default columns. do this before sorting in case there's hints in the column order (eg, id is more likely to be first)
|
||||
try:
|
||||
defaultGeomCol = next(col for col in cols if col in ['geom','geometry','the_geom'])
|
||||
@ -261,14 +261,14 @@ class DlgSqlWindow(QDialog, Ui_Dialog):
|
||||
|
||||
# set sensible default columns
|
||||
try:
|
||||
self.geomCombo.setCurrentIndex( cols.index(defaultGeomCol) )
|
||||
self.geomCombo.setCurrentIndex( cols.index(defaultGeomCol) )
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
self.uniqueCombo.setCurrentIndex( cols.index(defaultUniqueCol) )
|
||||
self.uniqueCombo.setCurrentIndex( cols.index(defaultUniqueCol) )
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
QApplication.restoreOverrideCursor()
|
||||
|
||||
def copySelectedResults(self):
|
||||
|
@ -102,7 +102,7 @@ class DlgTableProperties(QDialog, Ui_Dialog):
|
||||
sel = self.viewFields.selectionModel()
|
||||
indexes = sel.selectedRows()
|
||||
if len(indexes) == 0:
|
||||
QMessageBox.information(self, self.tr("Sorry"), self.tr("nothing selected"))
|
||||
QMessageBox.information(self, self.tr("DB Manager"), self.tr("nothing selected"))
|
||||
return -1
|
||||
return indexes[0].row()
|
||||
|
||||
@ -242,7 +242,7 @@ class DlgTableProperties(QDialog, Ui_Dialog):
|
||||
sel = self.viewConstraints.selectionModel()
|
||||
indexes = sel.selectedRows()
|
||||
if len(indexes) == 0:
|
||||
QMessageBox.information(self, self.tr("Sorry"), self.tr("nothing selected"))
|
||||
QMessageBox.information(self, self.tr("DB Manager"), self.tr("nothing selected"))
|
||||
return -1
|
||||
return indexes[0].row()
|
||||
|
||||
@ -277,7 +277,7 @@ class DlgTableProperties(QDialog, Ui_Dialog):
|
||||
def createSpatialIndex(self):
|
||||
""" create spatial index for the geometry column """
|
||||
if self.table.type != self.table.VectorType:
|
||||
QMessageBox.information(self, self.tr("Sorry"), self.tr("The selected table has no geometry"))
|
||||
QMessageBox.information(self, self.tr("DB Manager"), self.tr("The selected table has no geometry"))
|
||||
return
|
||||
|
||||
res = QMessageBox.question(self, self.tr("Create?"), self.tr("Create spatial index for field %s?") % self.table.geomColumn, QMessageBox.Yes | QMessageBox.No)
|
||||
@ -302,7 +302,7 @@ class DlgTableProperties(QDialog, Ui_Dialog):
|
||||
sel = self.viewIndexes.selectionModel()
|
||||
indexes = sel.selectedRows()
|
||||
if len(indexes) == 0:
|
||||
QMessageBox.information(self, self.tr("Sorry"), self.tr("Nothing selected"))
|
||||
QMessageBox.information(self, self.tr("DB Manager"), self.tr("Nothing selected"))
|
||||
return -1
|
||||
return indexes[0].row()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user