Skip to content

Commit

Permalink
[dbmanager] Fix inconsistent capitalization, HIG violations,
Browse files Browse the repository at this point in the history
and unprofessional strings
  • Loading branch information
nyalldawson committed Feb 13, 2018
1 parent c08e4c5 commit 6b4e734
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 47 deletions.
6 changes: 3 additions & 3 deletions python/plugins/db_manager/db_manager.py
Expand Up @@ -430,7 +430,7 @@ def setupUi(self):

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

self.actionImport = self.menuTable.addAction(QIcon(":/db_manager/actions/import"),
self.tr("&Import layer/file"), self.importActionSlot)
self.actionExport = self.menuTable.addAction(QIcon(":/db_manager/actions/export"), self.tr("&Export to file"),
self.tr("&Import Layer/file"), self.importActionSlot)
self.actionExport = self.menuTable.addAction(QIcon(":/db_manager/actions/export"), self.tr("&Export to File…"),
self.exportActionSlot)
self.menuTable.addSeparator()
#self.actionShowSystemTables = self.menuTable.addAction(self.tr("Show system tables/views"), self.showSystemTables)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/db_manager/db_manager_plugin.py
Expand Up @@ -52,7 +52,7 @@ def initGui(self):
else:
self.iface.addPluginToMenu(QApplication.translate("DBManagerPlugin", "DB Manager"), self.action)

self.layerAction = QAction(QgsApplication.getThemeIcon('dbmanager.svg'), QApplication.translate("DBManagerPlugin", "Update Sql Layer"),
self.layerAction = QAction(QgsApplication.getThemeIcon('dbmanager.svg'), QApplication.translate("DBManagerPlugin", "Update Sql Layer"),
self.iface.mainWindow())
self.layerAction.setObjectName("dbManagerUpdateSqlLayer")
self.layerAction.triggered.connect(self.onUpdateSqlLayer)
Expand Down
14 changes: 7 additions & 7 deletions python/plugins/db_manager/db_plugins/oracle/plugin.py
Expand Up @@ -225,36 +225,36 @@ def registerDatabaseActions(self, mainWindow):

if self.schemas():
action = QAction(QApplication.translate(
"DBManagerPlugin", "&Create schema"), self)
"DBManagerPlugin", "&Create Schema…"), self)
mainWindow.registerAction(action, QApplication.translate(
"DBManagerPlugin", "&Schema"), self.createSchemaActionSlot)
action = QAction(QApplication.translate(
"DBManagerPlugin", "&Delete (empty) schema"), self)
"DBManagerPlugin", "&Delete (Empty) Schema…"), self)
mainWindow.registerAction(action, QApplication.translate(
"DBManagerPlugin", "&Schema"), self.deleteSchemaActionSlot)

action = QAction(QApplication.translate(
"DBManagerPlugin", "Delete selected item"), self)
"DBManagerPlugin", "Delete Selected Item"), self)
mainWindow.registerAction(action, None, self.deleteActionSlot)
action.setShortcuts(QKeySequence.Delete)

action = QAction(QIcon(":/db_manager/actions/create_table"),
QApplication.translate(
"DBManagerPlugin", "&Create table"), self)
"DBManagerPlugin", "&Create Table…"), self)
mainWindow.registerAction(action, QApplication.translate(
"DBManagerPlugin", "&Table"), self.createTableActionSlot)
action = QAction(QIcon(":/db_manager/actions/edit_table"),
QApplication.translate(
"DBManagerPlugin", "&Edit table"), self)
"DBManagerPlugin", "&Edit Eable…"), self)
mainWindow.registerAction(action, QApplication.translate(
"DBManagerPlugin", "&Table"), self.editTableActionSlot)
action = QAction(QIcon(":/db_manager/actions/del_table"),
QApplication.translate(
"DBManagerPlugin", "&Delete table/view"), self)
"DBManagerPlugin", "&Delete Table/View…"), self)
mainWindow.registerAction(action, QApplication.translate(
"DBManagerPlugin", "&Table"), self.deleteTableActionSlot)
action = QAction(QApplication.translate(
"DBManagerPlugin", "&Empty table"), self)
"DBManagerPlugin", "&Empty Table…"), self)
mainWindow.registerAction(action, QApplication.translate(
"DBManagerPlugin", "&Table"), self.emptyTableActionSlot)

Expand Down
24 changes: 12 additions & 12 deletions python/plugins/db_manager/db_plugins/plugin.py
Expand Up @@ -175,7 +175,7 @@ def addConnectionActionSlot(self, item, action, parent):
def removeActionSlot(self, item, action, parent):
QApplication.restoreOverrideCursor()
try:
res = QMessageBox.question(parent, QApplication.translate("DBManagerPlugin", "hey!"),
res = QMessageBox.question(parent, QApplication.translate("DBManagerPlugin", "DB Manager"),
QApplication.translate("DBManagerPlugin",
"Really remove connection to {0}?").format(item.connectionName()),
QMessageBox.Yes | QMessageBox.No)
Expand Down Expand Up @@ -308,34 +308,34 @@ def registerDatabaseActions(self, mainWindow):
self.reconnectActionSlot)

if self.schemas() is not None:
action = QAction(QApplication.translate("DBManagerPlugin", "&Create schema"), self)
action = QAction(QApplication.translate("DBManagerPlugin", "&Create Schema…"), self)
mainWindow.registerAction(action, QApplication.translate("DBManagerPlugin", "&Schema"),
self.createSchemaActionSlot)
action = QAction(QApplication.translate("DBManagerPlugin", "&Delete (empty) schema"), self)
action = QAction(QApplication.translate("DBManagerPlugin", "&Delete (Empty) Schema"), self)
mainWindow.registerAction(action, QApplication.translate("DBManagerPlugin", "&Schema"),
self.deleteSchemaActionSlot)

action = QAction(QApplication.translate("DBManagerPlugin", "Delete selected item"), self)
action = QAction(QApplication.translate("DBManagerPlugin", "Delete Selected Item"), self)
mainWindow.registerAction(action, None, self.deleteActionSlot)
action.setShortcuts(QKeySequence.Delete)

action = QAction(QIcon(":/db_manager/actions/create_table"),
QApplication.translate("DBManagerPlugin", "&Create table"), self)
QApplication.translate("DBManagerPlugin", "&Create Table…"), self)
mainWindow.registerAction(action, QApplication.translate("DBManagerPlugin", "&Table"),
self.createTableActionSlot)
action = QAction(QIcon(":/db_manager/actions/edit_table"),
QApplication.translate("DBManagerPlugin", "&Edit table"), self)
QApplication.translate("DBManagerPlugin", "&Edit Table…"), self)
mainWindow.registerAction(action, QApplication.translate("DBManagerPlugin", "&Table"), self.editTableActionSlot)
action = QAction(QIcon(":/db_manager/actions/del_table"),
QApplication.translate("DBManagerPlugin", "&Delete table/view"), self)
QApplication.translate("DBManagerPlugin", "&Delete Table/view"), self)
mainWindow.registerAction(action, QApplication.translate("DBManagerPlugin", "&Table"),
self.deleteTableActionSlot)
action = QAction(QApplication.translate("DBManagerPlugin", "&Empty table"), self)
action = QAction(QApplication.translate("DBManagerPlugin", "&Empty Table…"), self)
mainWindow.registerAction(action, QApplication.translate("DBManagerPlugin", "&Table"),
self.emptyTableActionSlot)

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

def invoke_callback():
Expand Down Expand Up @@ -385,7 +385,7 @@ def deleteSchemaActionSlot(self, item, action, parent):
QApplication.translate("DBManagerPlugin", "Select an empty schema for deletion."),
Qgis.Info, parent.iface.messageTimeout())
return
res = QMessageBox.question(parent, QApplication.translate("DBManagerPlugin", "hey!"),
res = QMessageBox.question(parent, QApplication.translate("DBManagerPlugin", "DB Manager"),
QApplication.translate("DBManagerPlugin",
"Really delete schema {0}?").format(item.name),
QMessageBox.Yes | QMessageBox.No)
Expand Down Expand Up @@ -442,7 +442,7 @@ def deleteTableActionSlot(self, item, action, parent):
QApplication.translate("DBManagerPlugin", "Select a table/view for deletion."),
Qgis.Info, parent.iface.messageTimeout())
return
res = QMessageBox.question(parent, QApplication.translate("DBManagerPlugin", "hey!"),
res = QMessageBox.question(parent, QApplication.translate("DBManagerPlugin", "DB Manager"),
QApplication.translate("DBManagerPlugin",
"Really delete table/view {0}?").format(item.name),
QMessageBox.Yes | QMessageBox.No)
Expand All @@ -460,7 +460,7 @@ def emptyTableActionSlot(self, item, action, parent):
parent.infoBar.pushMessage(QApplication.translate("DBManagerPlugin", "Select a table to empty it."),
Qgis.Info, parent.iface.messageTimeout())
return
res = QMessageBox.question(parent, QApplication.translate("DBManagerPlugin", "hey!"),
res = QMessageBox.question(parent, QApplication.translate("DBManagerPlugin", "DB Manager"),
QApplication.translate("DBManagerPlugin",
"Really delete all items from table {0}?").format(item.name),
QMessageBox.Yes | QMessageBox.No)
Expand Down
Expand Up @@ -31,7 +31,7 @@

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


Expand Down
Expand Up @@ -276,5 +276,5 @@ def onOK(self):
finally:
QApplication.restoreOverrideCursor()

QMessageBox.information(self, "good!", "everything went fine!")
QMessageBox.information(self, "DB Manager", "Versioning was successfully created.")
self.accept()
8 changes: 4 additions & 4 deletions python/plugins/db_manager/db_tree.py
Expand Up @@ -125,20 +125,20 @@ def contextMenuEvent(self, ev):
menu = QMenu(self)

if isinstance(item, (Table, Schema)):
menu.addAction(self.tr("Rename"), self.rename)
menu.addAction(self.tr("Delete"), self.delete)
menu.addAction(self.tr("Rename"), self.rename)
menu.addAction(self.tr("Delete"), self.delete)

if isinstance(item, Table) and item.canBeAddedToCanvas():
menu.addSeparator()
menu.addAction(self.tr("Add to canvas"), self.addLayer)
menu.addAction(self.tr("Add to Canvas"), self.addLayer)

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

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

if not menu.isEmpty():
menu.exec_(ev.globalPos())
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/db_manager/dlg_add_geometry_column.py
Expand Up @@ -47,7 +47,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("DB Manager"), 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
2 changes: 1 addition & 1 deletion python/plugins/db_manager/dlg_create_index.py
Expand Up @@ -57,7 +57,7 @@ def columnChanged(self):
def createIndex(self):
idx = self.getIndex()
if idx.name == "":
QMessageBox.critical(self, self.tr("Error"), self.tr("Please enter some name for the index"))
QMessageBox.critical(self, self.tr("Error"), self.tr("Please enter a name for the index."))
return

# now create the index
Expand Down
20 changes: 10 additions & 10 deletions python/plugins/db_manager/dlg_create_table.py
Expand Up @@ -212,7 +212,7 @@ def deleteField(self):
""" delete selected field """
row = self.selectedField()
if row is None:
QMessageBox.information(self, self.tr("DB Manager"), 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 @@ -222,10 +222,10 @@ def fieldUp(self):
""" move selected field up """
row = self.selectedField()
if row is None:
QMessageBox.information(self, self.tr("DB Manager"), 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("DB Manager"), self.tr("field is at top already"))
QMessageBox.information(self, self.tr("DB Manager"), self.tr("Field is already at the top."))
return

# take row and reinsert it
Expand All @@ -242,10 +242,10 @@ def fieldDown(self):
""" move selected field down """
row = self.selectedField()
if row is None:
QMessageBox.information(self, self.tr("DB Manager"), 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("DB Manager"), self.tr("field is at bottom already"))
QMessageBox.information(self, self.tr("DB Manager"), self.tr("Field is already at the bottom."))
return

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

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

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

useGeomColumn = self.chkGeomColumn.isChecked()
if useGeomColumn:
geomColumn = str(self.editGeomColumn.text())
if len(geomColumn) == 0:
QMessageBox.information(self, self.tr("DB Manager"), self.tr("set geometry column name"))
QMessageBox.information(self, self.tr("DB Manager"), self.tr("A name is required for the geometry column."))
return

geomType = self.GEOM_TYPES[self.cboGeomType.currentIndex()]
Expand Down Expand Up @@ -311,4 +311,4 @@ def createTable(self):
DlgDbError.showError(e, self)
return

QMessageBox.information(self, self.tr("Good"), self.tr("everything went fine"))
QMessageBox.information(self, self.tr("DB Manager"), self.tr("Table created successfully."))
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("DB Manager"), 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("DB Manager"), 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()
6 changes: 3 additions & 3 deletions python/plugins/db_manager/dlg_table_properties.py
Expand Up @@ -107,7 +107,7 @@ def currentColumn(self):
sel = self.viewFields.selectionModel()
indexes = sel.selectedRows()
if len(indexes) == 0:
QMessageBox.information(self, self.tr("DB Manager"), self.tr("nothing selected"))
QMessageBox.information(self, self.tr("DB Manager"), self.tr("No columns were selected."))
return -1
return indexes[0].row()

Expand Down Expand Up @@ -238,7 +238,7 @@ def currentConstraint(self):
sel = self.viewConstraints.selectionModel()
indexes = sel.selectedRows()
if len(indexes) == 0:
QMessageBox.information(self, self.tr("DB Manager"), self.tr("Nothing selected"))
QMessageBox.information(self, self.tr("DB Manager"), self.tr("No constraints were selected"))
return -1
return indexes[0].row()

Expand Down Expand Up @@ -296,7 +296,7 @@ def currentIndex(self):
sel = self.viewIndexes.selectionModel()
indexes = sel.selectedRows()
if len(indexes) == 0:
QMessageBox.information(self, self.tr("DB Manager"), self.tr("Nothing selected"))
QMessageBox.information(self, self.tr("DB Manager"), self.tr("No indices were selected."))
return -1
return indexes[0].row()

Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsapplayertreeviewmenuprovider.cpp
Expand Up @@ -281,7 +281,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()

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

Expand Down

0 comments on commit 6b4e734

Please sign in to comment.