Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
dbManager - remove more 'Sorry' strings
  • Loading branch information
nyalldawson committed Sep 25, 2014
1 parent cb414f5 commit a9c4136
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion python/plugins/db_manager/dlg_add_geometry_column.py
Expand Up @@ -46,7 +46,7 @@ def __init__(self, parent=None, table=None, db=None):
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()
Expand Down
18 changes: 9 additions & 9 deletions python/plugins/db_manager/dlg_create_table.py
Expand Up @@ -206,7 +206,7 @@ def deleteField(self):
""" 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)

Expand All @@ -216,10 +216,10 @@ def fieldUp(self):
""" 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
Expand All @@ -236,10 +236,10 @@ def fieldDown(self):
""" 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
Expand All @@ -259,24 +259,24 @@ def createTable(self):
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() ]
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/db_manager/dlg_field_properties.py
Expand Up @@ -77,10 +77,10 @@ def onOK(self):
""" 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()
Expand Down
18 changes: 9 additions & 9 deletions python/plugins/db_manager/dlg_sql_window.py
Expand Up @@ -167,16 +167,16 @@ def loadSqlLayer(self):
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))

Expand Down Expand Up @@ -220,11 +220,11 @@ def fillColumnCombos(self):
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
Expand All @@ -244,7 +244,7 @@ def fillColumnCombos(self):
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'])
Expand All @@ -261,14 +261,14 @@ def fillColumnCombos(self):

# 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):
Expand Down
8 changes: 4 additions & 4 deletions python/plugins/db_manager/dlg_table_properties.py
Expand Up @@ -102,7 +102,7 @@ def currentColumn(self):
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()

Expand Down Expand Up @@ -242,7 +242,7 @@ def currentConstraint(self):
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()

Expand Down Expand Up @@ -277,7 +277,7 @@ def createIndex(self):
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)
Expand All @@ -302,7 +302,7 @@ def currentIndex(self):
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()

Expand Down

0 comments on commit a9c4136

Please sign in to comment.