Skip to content

Commit 6b4e734

Browse files
committed
[dbmanager] Fix inconsistent capitalization, HIG violations,
and unprofessional strings
1 parent c08e4c5 commit 6b4e734

13 files changed

+47
-47
lines changed

python/plugins/db_manager/db_manager.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ def setupUi(self):
430430

431431
self.actionRefresh = self.menuDb.addAction(QIcon(":/db_manager/actions/refresh"), self.tr("&Refresh"),
432432
self.refreshActionSlot, QKeySequence("F5"))
433-
self.actionSqlWindow = self.menuDb.addAction(QIcon(":/db_manager/actions/sql_window"), self.tr("&SQL window"),
433+
self.actionSqlWindow = self.menuDb.addAction(QIcon(":/db_manager/actions/sql_window"), self.tr("&SQL Window"),
434434
self.runSqlWindow, QKeySequence("F2"))
435435
self.menuDb.addSeparator()
436436
self.actionClose = self.menuDb.addAction(QIcon(), self.tr("&Exit"), self.close, QKeySequence("CTRL+Q"))
@@ -448,8 +448,8 @@ def setupUi(self):
448448
sep.setVisible(False)
449449

450450
self.actionImport = self.menuTable.addAction(QIcon(":/db_manager/actions/import"),
451-
self.tr("&Import layer/file"), self.importActionSlot)
452-
self.actionExport = self.menuTable.addAction(QIcon(":/db_manager/actions/export"), self.tr("&Export to file"),
451+
self.tr("&Import Layer/file"), self.importActionSlot)
452+
self.actionExport = self.menuTable.addAction(QIcon(":/db_manager/actions/export"), self.tr("&Export to File…"),
453453
self.exportActionSlot)
454454
self.menuTable.addSeparator()
455455
#self.actionShowSystemTables = self.menuTable.addAction(self.tr("Show system tables/views"), self.showSystemTables)

python/plugins/db_manager/db_manager_plugin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def initGui(self):
5252
else:
5353
self.iface.addPluginToMenu(QApplication.translate("DBManagerPlugin", "DB Manager"), self.action)
5454

55-
self.layerAction = QAction(QgsApplication.getThemeIcon('dbmanager.svg'), QApplication.translate("DBManagerPlugin", "Update Sql Layer"),
55+
self.layerAction = QAction(QgsApplication.getThemeIcon('dbmanager.svg'), QApplication.translate("DBManagerPlugin", "Update Sql Layer"),
5656
self.iface.mainWindow())
5757
self.layerAction.setObjectName("dbManagerUpdateSqlLayer")
5858
self.layerAction.triggered.connect(self.onUpdateSqlLayer)

python/plugins/db_manager/db_plugins/oracle/plugin.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -225,36 +225,36 @@ def registerDatabaseActions(self, mainWindow):
225225

226226
if self.schemas():
227227
action = QAction(QApplication.translate(
228-
"DBManagerPlugin", "&Create schema"), self)
228+
"DBManagerPlugin", "&Create Schema…"), self)
229229
mainWindow.registerAction(action, QApplication.translate(
230230
"DBManagerPlugin", "&Schema"), self.createSchemaActionSlot)
231231
action = QAction(QApplication.translate(
232-
"DBManagerPlugin", "&Delete (empty) schema"), self)
232+
"DBManagerPlugin", "&Delete (Empty) Schema…"), self)
233233
mainWindow.registerAction(action, QApplication.translate(
234234
"DBManagerPlugin", "&Schema"), self.deleteSchemaActionSlot)
235235

236236
action = QAction(QApplication.translate(
237-
"DBManagerPlugin", "Delete selected item"), self)
237+
"DBManagerPlugin", "Delete Selected Item"), self)
238238
mainWindow.registerAction(action, None, self.deleteActionSlot)
239239
action.setShortcuts(QKeySequence.Delete)
240240

241241
action = QAction(QIcon(":/db_manager/actions/create_table"),
242242
QApplication.translate(
243-
"DBManagerPlugin", "&Create table"), self)
243+
"DBManagerPlugin", "&Create Table…"), self)
244244
mainWindow.registerAction(action, QApplication.translate(
245245
"DBManagerPlugin", "&Table"), self.createTableActionSlot)
246246
action = QAction(QIcon(":/db_manager/actions/edit_table"),
247247
QApplication.translate(
248-
"DBManagerPlugin", "&Edit table"), self)
248+
"DBManagerPlugin", "&Edit Eable…"), self)
249249
mainWindow.registerAction(action, QApplication.translate(
250250
"DBManagerPlugin", "&Table"), self.editTableActionSlot)
251251
action = QAction(QIcon(":/db_manager/actions/del_table"),
252252
QApplication.translate(
253-
"DBManagerPlugin", "&Delete table/view"), self)
253+
"DBManagerPlugin", "&Delete Table/View…"), self)
254254
mainWindow.registerAction(action, QApplication.translate(
255255
"DBManagerPlugin", "&Table"), self.deleteTableActionSlot)
256256
action = QAction(QApplication.translate(
257-
"DBManagerPlugin", "&Empty table"), self)
257+
"DBManagerPlugin", "&Empty Table…"), self)
258258
mainWindow.registerAction(action, QApplication.translate(
259259
"DBManagerPlugin", "&Table"), self.emptyTableActionSlot)
260260

python/plugins/db_manager/db_plugins/plugin.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def addConnectionActionSlot(self, item, action, parent):
175175
def removeActionSlot(self, item, action, parent):
176176
QApplication.restoreOverrideCursor()
177177
try:
178-
res = QMessageBox.question(parent, QApplication.translate("DBManagerPlugin", "hey!"),
178+
res = QMessageBox.question(parent, QApplication.translate("DBManagerPlugin", "DB Manager"),
179179
QApplication.translate("DBManagerPlugin",
180180
"Really remove connection to {0}?").format(item.connectionName()),
181181
QMessageBox.Yes | QMessageBox.No)
@@ -308,34 +308,34 @@ def registerDatabaseActions(self, mainWindow):
308308
self.reconnectActionSlot)
309309

310310
if self.schemas() is not None:
311-
action = QAction(QApplication.translate("DBManagerPlugin", "&Create schema"), self)
311+
action = QAction(QApplication.translate("DBManagerPlugin", "&Create Schema…"), self)
312312
mainWindow.registerAction(action, QApplication.translate("DBManagerPlugin", "&Schema"),
313313
self.createSchemaActionSlot)
314-
action = QAction(QApplication.translate("DBManagerPlugin", "&Delete (empty) schema"), self)
314+
action = QAction(QApplication.translate("DBManagerPlugin", "&Delete (Empty) Schema"), self)
315315
mainWindow.registerAction(action, QApplication.translate("DBManagerPlugin", "&Schema"),
316316
self.deleteSchemaActionSlot)
317317

318-
action = QAction(QApplication.translate("DBManagerPlugin", "Delete selected item"), self)
318+
action = QAction(QApplication.translate("DBManagerPlugin", "Delete Selected Item"), self)
319319
mainWindow.registerAction(action, None, self.deleteActionSlot)
320320
action.setShortcuts(QKeySequence.Delete)
321321

322322
action = QAction(QIcon(":/db_manager/actions/create_table"),
323-
QApplication.translate("DBManagerPlugin", "&Create table"), self)
323+
QApplication.translate("DBManagerPlugin", "&Create Table…"), self)
324324
mainWindow.registerAction(action, QApplication.translate("DBManagerPlugin", "&Table"),
325325
self.createTableActionSlot)
326326
action = QAction(QIcon(":/db_manager/actions/edit_table"),
327-
QApplication.translate("DBManagerPlugin", "&Edit table"), self)
327+
QApplication.translate("DBManagerPlugin", "&Edit Table…"), self)
328328
mainWindow.registerAction(action, QApplication.translate("DBManagerPlugin", "&Table"), self.editTableActionSlot)
329329
action = QAction(QIcon(":/db_manager/actions/del_table"),
330-
QApplication.translate("DBManagerPlugin", "&Delete table/view"), self)
330+
QApplication.translate("DBManagerPlugin", "&Delete Table/view"), self)
331331
mainWindow.registerAction(action, QApplication.translate("DBManagerPlugin", "&Table"),
332332
self.deleteTableActionSlot)
333-
action = QAction(QApplication.translate("DBManagerPlugin", "&Empty table"), self)
333+
action = QAction(QApplication.translate("DBManagerPlugin", "&Empty Table…"), self)
334334
mainWindow.registerAction(action, QApplication.translate("DBManagerPlugin", "&Table"),
335335
self.emptyTableActionSlot)
336336

337337
if self.schemas() is not None:
338-
action = QAction(QApplication.translate("DBManagerPlugin", "&Move to schema"), self)
338+
action = QAction(QApplication.translate("DBManagerPlugin", "&Move to Schema"), self)
339339
action.setMenu(QMenu(mainWindow))
340340

341341
def invoke_callback():
@@ -385,7 +385,7 @@ def deleteSchemaActionSlot(self, item, action, parent):
385385
QApplication.translate("DBManagerPlugin", "Select an empty schema for deletion."),
386386
Qgis.Info, parent.iface.messageTimeout())
387387
return
388-
res = QMessageBox.question(parent, QApplication.translate("DBManagerPlugin", "hey!"),
388+
res = QMessageBox.question(parent, QApplication.translate("DBManagerPlugin", "DB Manager"),
389389
QApplication.translate("DBManagerPlugin",
390390
"Really delete schema {0}?").format(item.name),
391391
QMessageBox.Yes | QMessageBox.No)
@@ -442,7 +442,7 @@ def deleteTableActionSlot(self, item, action, parent):
442442
QApplication.translate("DBManagerPlugin", "Select a table/view for deletion."),
443443
Qgis.Info, parent.iface.messageTimeout())
444444
return
445-
res = QMessageBox.question(parent, QApplication.translate("DBManagerPlugin", "hey!"),
445+
res = QMessageBox.question(parent, QApplication.translate("DBManagerPlugin", "DB Manager"),
446446
QApplication.translate("DBManagerPlugin",
447447
"Really delete table/view {0}?").format(item.name),
448448
QMessageBox.Yes | QMessageBox.No)
@@ -460,7 +460,7 @@ def emptyTableActionSlot(self, item, action, parent):
460460
parent.infoBar.pushMessage(QApplication.translate("DBManagerPlugin", "Select a table to empty it."),
461461
Qgis.Info, parent.iface.messageTimeout())
462462
return
463-
res = QMessageBox.question(parent, QApplication.translate("DBManagerPlugin", "hey!"),
463+
res = QMessageBox.question(parent, QApplication.translate("DBManagerPlugin", "DB Manager"),
464464
QApplication.translate("DBManagerPlugin",
465465
"Really delete all items from table {0}?").format(item.name),
466466
QMessageBox.Yes | QMessageBox.No)

python/plugins/db_manager/db_plugins/postgis/plugins/versioning/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
def load(db, mainwindow):
3333
# add the action to the DBManager menu
34-
action = QAction(QIcon(), QApplication.translate("DBManagerPlugin", "&Change logging"), db)
34+
action = QAction(QIcon(), QApplication.translate("DBManagerPlugin", "&Change Logging…"), db)
3535
mainwindow.registerAction(action, QApplication.translate("DBManagerPlugin", "&Table"), run)
3636

3737

python/plugins/db_manager/db_plugins/postgis/plugins/versioning/dlg_versioning.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,5 +276,5 @@ def onOK(self):
276276
finally:
277277
QApplication.restoreOverrideCursor()
278278

279-
QMessageBox.information(self, "good!", "everything went fine!")
279+
QMessageBox.information(self, "DB Manager", "Versioning was successfully created.")
280280
self.accept()

python/plugins/db_manager/db_tree.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -125,20 +125,20 @@ def contextMenuEvent(self, ev):
125125
menu = QMenu(self)
126126

127127
if isinstance(item, (Table, Schema)):
128-
menu.addAction(self.tr("Rename"), self.rename)
129-
menu.addAction(self.tr("Delete"), self.delete)
128+
menu.addAction(self.tr("Rename"), self.rename)
129+
menu.addAction(self.tr("Delete"), self.delete)
130130

131131
if isinstance(item, Table) and item.canBeAddedToCanvas():
132132
menu.addSeparator()
133-
menu.addAction(self.tr("Add to canvas"), self.addLayer)
133+
menu.addAction(self.tr("Add to Canvas"), self.addLayer)
134134

135135
elif isinstance(item, DBPlugin):
136136
if item.database() is not None:
137137
menu.addAction(self.tr("Re-connect"), self.reconnect)
138138
menu.addAction(self.tr("Remove"), self.delete)
139139

140140
elif not index.parent().isValid() and item.typeName() in ("spatialite", "gpkg"):
141-
menu.addAction(self.tr("New Connection..."), self.newConnection)
141+
menu.addAction(self.tr("New Connection"), self.newConnection)
142142

143143
if not menu.isEmpty():
144144
menu.exec_(ev.globalPos())

python/plugins/db_manager/dlg_add_geometry_column.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __init__(self, parent=None, table=None, db=None):
4747
def createGeomColumn(self):
4848
""" first check whether everything's fine """
4949
if self.editName.text() == "":
50-
QMessageBox.critical(self, self.tr("DB Manager"), self.tr("field name must not be empty"))
50+
QMessageBox.critical(self, self.tr("DB Manager"), self.tr("Field name must not be empty."))
5151
return
5252

5353
name = self.editName.text()

python/plugins/db_manager/dlg_create_index.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def columnChanged(self):
5757
def createIndex(self):
5858
idx = self.getIndex()
5959
if idx.name == "":
60-
QMessageBox.critical(self, self.tr("Error"), self.tr("Please enter some name for the index"))
60+
QMessageBox.critical(self, self.tr("Error"), self.tr("Please enter a name for the index."))
6161
return
6262

6363
# now create the index

python/plugins/db_manager/dlg_create_table.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def deleteField(self):
212212
""" delete selected field """
213213
row = self.selectedField()
214214
if row is None:
215-
QMessageBox.information(self, self.tr("DB Manager"), self.tr("no field selected"))
215+
QMessageBox.information(self, self.tr("DB Manager"), self.tr("No field selected."))
216216
else:
217217
self.fields.model().removeRows(row, 1)
218218

@@ -222,10 +222,10 @@ def fieldUp(self):
222222
""" move selected field up """
223223
row = self.selectedField()
224224
if row is None:
225-
QMessageBox.information(self, self.tr("DB Manager"), self.tr("no field selected"))
225+
QMessageBox.information(self, self.tr("DB Manager"), self.tr("No field selected."))
226226
return
227227
if row == 0:
228-
QMessageBox.information(self, self.tr("DB Manager"), self.tr("field is at top already"))
228+
QMessageBox.information(self, self.tr("DB Manager"), self.tr("Field is already at the top."))
229229
return
230230

231231
# take row and reinsert it
@@ -242,10 +242,10 @@ def fieldDown(self):
242242
""" move selected field down """
243243
row = self.selectedField()
244244
if row is None:
245-
QMessageBox.information(self, self.tr("DB Manager"), self.tr("No field selected"))
245+
QMessageBox.information(self, self.tr("DB Manager"), self.tr("No field selected."))
246246
return
247247
if row == self.fields.model().rowCount() - 1:
248-
QMessageBox.information(self, self.tr("DB Manager"), self.tr("field is at bottom already"))
248+
QMessageBox.information(self, self.tr("DB Manager"), self.tr("Field is already at the bottom."))
249249
return
250250

251251
# take row and reinsert it
@@ -265,24 +265,24 @@ def createTable(self):
265265
else:
266266
schema = str(self.cboSchema.currentText())
267267
if len(schema) == 0:
268-
QMessageBox.information(self, self.tr("DB Manager"), self.tr("select schema!"))
268+
QMessageBox.information(self, self.tr("DB Manager"), self.tr("A valid schema must be selected first."))
269269
return
270270

271271
table = str(self.editName.text())
272272
if len(table) == 0:
273-
QMessageBox.information(self, self.tr("DB Manager"), self.tr("enter table name!"))
273+
QMessageBox.information(self, self.tr("DB Manager"), self.tr("A valid table name is required."))
274274
return
275275

276276
m = self.fields.model()
277277
if m.rowCount() == 0:
278-
QMessageBox.information(self, self.tr("DB Manager"), self.tr("add some fields!"))
278+
QMessageBox.information(self, self.tr("DB Manager"), self.tr("At least one field is required."))
279279
return
280280

281281
useGeomColumn = self.chkGeomColumn.isChecked()
282282
if useGeomColumn:
283283
geomColumn = str(self.editGeomColumn.text())
284284
if len(geomColumn) == 0:
285-
QMessageBox.information(self, self.tr("DB Manager"), self.tr("set geometry column name"))
285+
QMessageBox.information(self, self.tr("DB Manager"), self.tr("A name is required for the geometry column."))
286286
return
287287

288288
geomType = self.GEOM_TYPES[self.cboGeomType.currentIndex()]
@@ -311,4 +311,4 @@ def createTable(self):
311311
DlgDbError.showError(e, self)
312312
return
313313

314-
QMessageBox.information(self, self.tr("Good"), self.tr("everything went fine"))
314+
QMessageBox.information(self, self.tr("DB Manager"), self.tr("Table created successfully."))

python/plugins/db_manager/dlg_field_properties.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ def onOK(self):
7777
""" first check whether everything's fine """
7878
fld = self.getField(True) # don't change the original copy
7979
if fld.name == "":
80-
QMessageBox.critical(self, self.tr("DB Manager"), self.tr("field name must not be empty"))
80+
QMessageBox.critical(self, self.tr("DB Manager"), self.tr("Field name must not be empty."))
8181
return
8282
if fld.dataType == "":
83-
QMessageBox.critical(self, self.tr("DB Manager"), self.tr("field type must not be empty"))
83+
QMessageBox.critical(self, self.tr("DB Manager"), self.tr("Field type must not be empty."))
8484
return
8585

8686
self.accept()

python/plugins/db_manager/dlg_table_properties.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def currentColumn(self):
107107
sel = self.viewFields.selectionModel()
108108
indexes = sel.selectedRows()
109109
if len(indexes) == 0:
110-
QMessageBox.information(self, self.tr("DB Manager"), self.tr("nothing selected"))
110+
QMessageBox.information(self, self.tr("DB Manager"), self.tr("No columns were selected."))
111111
return -1
112112
return indexes[0].row()
113113

@@ -238,7 +238,7 @@ def currentConstraint(self):
238238
sel = self.viewConstraints.selectionModel()
239239
indexes = sel.selectedRows()
240240
if len(indexes) == 0:
241-
QMessageBox.information(self, self.tr("DB Manager"), self.tr("Nothing selected"))
241+
QMessageBox.information(self, self.tr("DB Manager"), self.tr("No constraints were selected"))
242242
return -1
243243
return indexes[0].row()
244244

@@ -296,7 +296,7 @@ def currentIndex(self):
296296
sel = self.viewIndexes.selectionModel()
297297
indexes = sel.selectedRows()
298298
if len(indexes) == 0:
299-
QMessageBox.information(self, self.tr("DB Manager"), self.tr("Nothing selected"))
299+
QMessageBox.information(self, self.tr("DB Manager"), self.tr("No indices were selected."))
300300
return -1
301301
return indexes[0].row()
302302

src/app/qgsapplayertreeviewmenuprovider.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
281281

282282
if ( layer && layer->type() == QgsMapLayer::VectorLayer && static_cast<QgsVectorLayer *>( layer )->providerType() == QLatin1String( "virtual" ) )
283283
{
284-
menu->addAction( tr( "Edit virtual layer settings" ), QgisApp::instance(), SLOT( addVirtualLayer() ) );
284+
menu->addAction( tr( "Edit Virtual Layer…" ), QgisApp::instance(), SLOT( addVirtualLayer() ) );
285285
}
286286
}
287287

0 commit comments

Comments
 (0)