mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-13 00:03:09 -04:00
[dbmanager] Fix inconsistent capitalization, HIG violations,
and unprofessional strings
This commit is contained in:
parent
c08e4c53a9
commit
6b4e734d95
@ -430,7 +430,7 @@ class DBManager(QMainWindow):
|
||||
|
||||
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"))
|
||||
@ -448,8 +448,8 @@ class DBManager(QMainWindow):
|
||||
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)
|
||||
|
@ -52,7 +52,7 @@ class DBManagerPlugin(object):
|
||||
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)
|
||||
|
@ -225,36 +225,36 @@ class ORDatabase(Database):
|
||||
|
||||
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)
|
||||
|
||||
|
@ -175,7 +175,7 @@ class DBPlugin(QObject):
|
||||
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)
|
||||
@ -308,34 +308,34 @@ class Database(DbItemObject):
|
||||
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():
|
||||
@ -385,7 +385,7 @@ class Database(DbItemObject):
|
||||
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)
|
||||
@ -442,7 +442,7 @@ class Database(DbItemObject):
|
||||
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)
|
||||
@ -460,7 +460,7 @@ class Database(DbItemObject):
|
||||
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)
|
||||
|
@ -31,7 +31,7 @@ from qgis.PyQt.QtGui import QIcon
|
||||
|
||||
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)
|
||||
|
||||
|
||||
|
@ -276,5 +276,5 @@ CREATE OR REPLACE RULE "_UPDATE" AS ON UPDATE TO %(view)s DO INSTEAD
|
||||
finally:
|
||||
QApplication.restoreOverrideCursor()
|
||||
|
||||
QMessageBox.information(self, "good!", "everything went fine!")
|
||||
QMessageBox.information(self, "DB Manager", "Versioning was successfully created.")
|
||||
self.accept()
|
||||
|
@ -125,12 +125,12 @@ class DBTree(QTreeView):
|
||||
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:
|
||||
@ -138,7 +138,7 @@ class DBTree(QTreeView):
|
||||
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())
|
||||
|
@ -47,7 +47,7 @@ class DlgAddGeometryColumn(QDialog, Ui_Dialog):
|
||||
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()
|
||||
|
@ -57,7 +57,7 @@ class DlgCreateIndex(QDialog, Ui_Dialog):
|
||||
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
|
||||
|
@ -212,7 +212,7 @@ class DlgCreateTable(QDialog, Ui_Dialog):
|
||||
""" 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)
|
||||
|
||||
@ -222,10 +222,10 @@ class DlgCreateTable(QDialog, Ui_Dialog):
|
||||
""" 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
|
||||
@ -242,10 +242,10 @@ class DlgCreateTable(QDialog, Ui_Dialog):
|
||||
""" 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
|
||||
@ -265,24 +265,24 @@ class DlgCreateTable(QDialog, Ui_Dialog):
|
||||
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()]
|
||||
@ -311,4 +311,4 @@ class DlgCreateTable(QDialog, Ui_Dialog):
|
||||
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."))
|
||||
|
@ -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("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()
|
||||
|
@ -107,7 +107,7 @@ class DlgTableProperties(QDialog, Ui_Dialog):
|
||||
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()
|
||||
|
||||
@ -238,7 +238,7 @@ class DlgTableProperties(QDialog, Ui_Dialog):
|
||||
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()
|
||||
|
||||
@ -296,7 +296,7 @@ class DlgTableProperties(QDialog, Ui_Dialog):
|
||||
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()
|
||||
|
||||
|
@ -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() ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user