Use a more appropriate dialog title for message boxes

and capitalise first letters
This commit is contained in:
Harrissou Sant-anna 2017-10-25 05:57:56 +02:00
parent 2614ca1a96
commit f5025cc668
28 changed files with 90 additions and 88 deletions

View File

@ -72,11 +72,11 @@ class ManageConnectionsDialog(QDialog, BASE_CLASS):
label = self.tr('eXtensible Markup Language (*.xml *.XML)')
if self.mode == 0:
slabel = self.tr('Save connections')
slabel = self.tr('Save Connections')
self.filename, filter = QFileDialog.getSaveFileName(self, slabel,
'.', label)
else:
slabel = self.tr('Load connections')
slabel = self.tr('Load Connections')
self.filename, selected_filter = QFileDialog.getOpenFileName(self, slabel,
'.', label)

View File

@ -59,13 +59,13 @@ class NewConnectionDialog(QDialog, BASE_CLASS):
conn_password = self.lePassword.text().strip()
if any([conn_name == '', conn_url == '']):
QMessageBox.warning(self, self.tr('Save connection'),
self.tr('Both Name and URL must be provided'))
QMessageBox.warning(self, self.tr('Save Connection'),
self.tr('Both Name and URL must be provided.'))
return
if '/' in conn_name:
QMessageBox.warning(self, self.tr('Save connection'),
self.tr('Name cannot contain \'/\''))
QMessageBox.warning(self, self.tr('Save Connection'),
self.tr('Name cannot contain \'/\'.'))
return
if conn_name is not None:
@ -76,7 +76,7 @@ class NewConnectionDialog(QDialog, BASE_CLASS):
# warn if entry was renamed to an existing connection
if all([self.conn_name_orig != conn_name,
self.settings.contains(keyurl)]):
res = QMessageBox.warning(self, self.tr('Save connection'),
res = QMessageBox.warning(self, self.tr('Save Connection'),
self.tr('Overwrite {0}?').format(conn_name),
QMessageBox.Ok | QMessageBox.Cancel)
if res == QMessageBox.Cancel:

View File

@ -167,7 +167,8 @@ class DlgTableProperties(QDialog, Ui_Dialog):
m = self.viewFields.model()
fld = m.getObject(index)
res = QMessageBox.question(self, self.tr("Are you sure"), self.tr("Really delete column '{0}'?").format(fld.name),
res = QMessageBox.question(self, self.tr("Delete Column"),
self.tr("Are you sure you want to delete column '{0}'?").format(fld.name),
QMessageBox.Yes | QMessageBox.No)
if res != QMessageBox.Yes:
return
@ -218,8 +219,8 @@ class DlgTableProperties(QDialog, Ui_Dialog):
m = self.viewConstraints.model()
constr = m.getObject(index)
res = QMessageBox.question(self, self.tr("Are you sure"),
self.tr("Really delete constraint '{0}'?").format(constr.name),
res = QMessageBox.question(self, self.tr("Delete Constraint"),
self.tr("Are you sure you want to delete constraint '{0}'?").format(constr.name),
QMessageBox.Yes | QMessageBox.No)
if res != QMessageBox.Yes:
return
@ -274,7 +275,7 @@ class DlgTableProperties(QDialog, Ui_Dialog):
QMessageBox.information(self, self.tr("DB Manager"), self.tr("The selected table has no geometry"))
return
res = QMessageBox.question(self, self.tr("Create?"),
res = QMessageBox.question(self, self.tr("Create Spatial Index"),
self.tr("Create spatial index for field {0}?").format(self.table.geomColumn),
QMessageBox.Yes | QMessageBox.No)
if res != QMessageBox.Yes:
@ -308,7 +309,8 @@ class DlgTableProperties(QDialog, Ui_Dialog):
m = self.viewIndexes.model()
idx = m.getObject(index)
res = QMessageBox.question(self, self.tr("Are you sure"), self.tr("Really delete index '{0}'?").format(idx.name),
res = QMessageBox.question(self, self.tr("Delete Index"),
self.tr("Are you sure you want to delete index '{0}'?").format(idx.name),
QMessageBox.Yes | QMessageBox.No)
if res != QMessageBox.Yes:
return

View File

@ -142,7 +142,7 @@ class BatchPanel(BASE, WIDGET):
def load(self):
filename, selected_filter = QFileDialog.getOpenFileName(self,
self.tr('Open batch'), None,
self.tr('Open Batch'), None,
self.tr('JSON files (*.json)'))
if filename:
with open(filename) as f:
@ -216,7 +216,7 @@ class BatchPanel(BASE, WIDGET):
toSave.append({self.PARAMETERS: algParams, self.OUTPUTS: algOutputs})
filename, __ = QFileDialog.getSaveFileName(self,
self.tr('Save batch'),
self.tr('Save Batch'),
None,
self.tr('JSON files (*.json)'))
if filename:

View File

@ -194,7 +194,7 @@ void QgsBookmarks::deleteClicked()
return;
// make sure the user really wants to delete these bookmarks
if ( QMessageBox::Cancel == QMessageBox::information( this, tr( "Really Delete?" ),
if ( QMessageBox::Cancel == QMessageBox::information( this, tr( "Delete Bookmarks" ),
tr( "Are you sure you want to delete %n bookmark(s)?", "number of rows", rows.size() ),
QMessageBox::Ok | QMessageBox::Cancel ) )
return;
@ -236,7 +236,7 @@ void QgsBookmarks::zoomToBookmark()
rect = ct.transform( rect );
if ( rect.isEmpty() )
{
QMessageBox::warning( this, tr( "Empty extent" ), tr( "Reprojected extent is empty." ) );
QMessageBox::warning( this, tr( "Empty Extent" ), tr( "Reprojected extent is empty." ) );
return;
}
}
@ -326,7 +326,7 @@ void QgsBookmarks::exportToXml()
QgsSettings settings;
QString lastUsedDir = settings.value( QStringLiteral( "Windows/Bookmarks/LastUsedDirectory" ), QDir::homePath() ).toString();
QString fileName = QFileDialog::getSaveFileName( this, tr( "Export bookmarks" ), lastUsedDir,
QString fileName = QFileDialog::getSaveFileName( this, tr( "Export Bookmarks" ), lastUsedDir,
tr( "XML files (*.xml *.XML)" ) );
if ( fileName.isEmpty() )
{

View File

@ -166,7 +166,7 @@ void QgsLoadStyleFromDBDialog::deleteStyleFromDB()
QString msgError;
QString opInfo = QObject::tr( "Delete style %1 from %2" ).arg( mSelectedStyleName, mLayer->providerType() );
if ( QMessageBox::question( nullptr, QObject::tr( "Delete style" ),
if ( QMessageBox::question( nullptr, QObject::tr( "Delete Style" ),
QObject::tr( "Are you sure you want to delete the style %1?" ).arg( mSelectedStyleName ),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) != QMessageBox::Yes )
return;

View File

@ -133,7 +133,7 @@ void QgsMapThemes::replaceTriggered()
if ( !actionPreset )
return;
int res = QMessageBox::question( mMenu, tr( "Replace theme" ),
int res = QMessageBox::question( mMenu, tr( "Replace Theme" ),
trUtf8( "Are you sure you want to replace the existing theme “%1”?" ).arg( actionPreset->text() ),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No );
if ( res != QMessageBox::Yes )

View File

@ -1732,7 +1732,7 @@ QStringList QgsOptions::i18nList()
void QgsOptions::restoreDefaultWindowState()
{
// richard
if ( QMessageBox::warning( this, tr( "Restore UI defaults" ), tr( "Are you sure to reset the UI to default (needs restart)?" ), QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
if ( QMessageBox::warning( this, tr( "Restore UI Defaults" ), tr( "Are you sure to reset the UI to default (needs restart)?" ), QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
return;
mSettings->setValue( QStringLiteral( "/qgis/restoreDefaultWindowState" ), true );
}

View File

@ -1581,9 +1581,9 @@ void QgsVectorLayerProperties::onAuxiliaryLayerClear()
if ( !alayer )
return;
const QString msg = tr( "Are you sure you want to clear auxiliary data for %1" ).arg( mLayer->name() );
const QString msg = tr( "Are you sure you want to clear auxiliary data for %1?" ).arg( mLayer->name() );
QMessageBox::StandardButton reply;
reply = QMessageBox::question( this, "Clear auxiliary data", msg, QMessageBox::Yes | QMessageBox::No );
reply = QMessageBox::question( this, "Clear Auxiliary Data", msg, QMessageBox::Yes | QMessageBox::No );
if ( reply == QMessageBox::Yes )
{
@ -1601,9 +1601,9 @@ void QgsVectorLayerProperties::onAuxiliaryLayerDelete()
if ( !alayer )
return;
const QString msg = tr( "Are you sure you want to delete auxiliary storage for %1" ).arg( mLayer->name() );
const QString msg = tr( "Are you sure you want to delete auxiliary storage for %1?" ).arg( mLayer->name() );
QMessageBox::StandardButton reply;
reply = QMessageBox::question( this, "Delete auxiliary storage", msg, QMessageBox::Yes | QMessageBox::No );
reply = QMessageBox::question( this, "Delete Auxiliary Storage", msg, QMessageBox::Yes | QMessageBox::No );
if ( reply == QMessageBox::Yes )
{
@ -1662,10 +1662,10 @@ void QgsVectorLayerProperties::onAuxiliaryLayerDeleteField()
return;
// should be only 1 field
const QString msg = tr( "Are you sure you want to delete auxiliary field %1 for %2" ).arg( item->text( 1 ), item->text( 0 ) );
const QString msg = tr( "Are you sure you want to delete auxiliary field %1 for %2?" ).arg( item->text( 1 ), item->text( 0 ) );
QMessageBox::StandardButton reply;
reply = QMessageBox::question( this, "Delete auxiliary field", msg, QMessageBox::Yes | QMessageBox::No );
reply = QMessageBox::question( this, "Delete Auxiliary Field", msg, QMessageBox::Yes | QMessageBox::No );
if ( reply == QMessageBox::Yes )
{

View File

@ -116,7 +116,7 @@ void QgsNewOgrConnection::accept()
if ( ( mOriginalConnName.isNull() || mOriginalConnName != txtName->text() ) &&
settings.contains( baseKey + txtName->text() + "/host" ) &&
QMessageBox::question( this,
tr( "Save connection" ),
tr( "Save Connection" ),
tr( "Should the existing connection %1 be overwritten?" ).arg( txtName->text() ),
QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
{

View File

@ -77,7 +77,7 @@ void QgsManageConnectionsDialog::doExportImport()
QList<QListWidgetItem *> selection = listConnections->selectedItems();
if ( selection.isEmpty() )
{
QMessageBox::warning( this, tr( "Export/import error" ),
QMessageBox::warning( this, tr( "Export/Import Error" ),
tr( "You should select at least one connection from list." ) );
return;
}
@ -91,7 +91,7 @@ void QgsManageConnectionsDialog::doExportImport()
if ( mDialogMode == Export )
{
QString fileName = QFileDialog::getSaveFileName( this, tr( "Save connections" ), QDir::homePath(),
QString fileName = QFileDialog::getSaveFileName( this, tr( "Save Connections" ), QDir::homePath(),
tr( "XML files (*.xml *.XML)" ) );
if ( fileName.isEmpty() )
{
@ -138,7 +138,7 @@ void QgsManageConnectionsDialog::doExportImport()
QFile file( mFileName );
if ( !file.open( QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate ) )
{
QMessageBox::warning( this, tr( "Saving connections" ),
QMessageBox::warning( this, tr( "Saving Connections" ),
tr( "Cannot write file %1:\n%2." )
.arg( mFileName,
file.errorString() ) );
@ -153,7 +153,7 @@ void QgsManageConnectionsDialog::doExportImport()
QFile file( mFileName );
if ( !file.open( QIODevice::ReadOnly | QIODevice::Text ) )
{
QMessageBox::warning( this, tr( "Loading connections" ),
QMessageBox::warning( this, tr( "Loading Connections" ),
tr( "Cannot read file %1:\n%2." )
.arg( mFileName,
file.errorString() ) );
@ -167,7 +167,7 @@ void QgsManageConnectionsDialog::doExportImport()
if ( !doc.setContent( &file, true, &errorStr, &errorLine, &errorColumn ) )
{
QMessageBox::warning( this, tr( "Loading connections" ),
QMessageBox::warning( this, tr( "Loading Connections" ),
tr( "Parse error at line %1, column %2:\n%3" )
.arg( errorLine )
.arg( errorColumn )
@ -260,7 +260,7 @@ bool QgsManageConnectionsDialog::populateConnections()
QFile file( mFileName );
if ( !file.open( QIODevice::ReadOnly | QIODevice::Text ) )
{
QMessageBox::warning( this, tr( "Loading connections" ),
QMessageBox::warning( this, tr( "Loading Connections" ),
tr( "Cannot read file %1:\n%2." )
.arg( mFileName,
file.errorString() ) );
@ -274,7 +274,7 @@ bool QgsManageConnectionsDialog::populateConnections()
if ( !doc.setContent( &file, true, &errorStr, &errorLine, &errorColumn ) )
{
QMessageBox::warning( this, tr( "Loading connections" ),
QMessageBox::warning( this, tr( "Loading Connections" ),
tr( "Parse error at line %1, column %2:\n%3" )
.arg( errorLine )
.arg( errorColumn )
@ -288,7 +288,7 @@ bool QgsManageConnectionsDialog::populateConnections()
case WMS:
if ( root.tagName() != QLatin1String( "qgsWMSConnections" ) )
{
QMessageBox::information( this, tr( "Loading connections" ),
QMessageBox::information( this, tr( "Loading Connections" ),
tr( "The file is not a WMS connections exchange file." ) );
return false;
}
@ -297,7 +297,7 @@ bool QgsManageConnectionsDialog::populateConnections()
case WFS:
if ( root.tagName() != QLatin1String( "qgsWFSConnections" ) )
{
QMessageBox::information( this, tr( "Loading connections" ),
QMessageBox::information( this, tr( "Loading Cnnections" ),
tr( "The file is not a WFS connections exchange file." ) );
return false;
}
@ -306,7 +306,7 @@ bool QgsManageConnectionsDialog::populateConnections()
case WCS:
if ( root.tagName() != QLatin1String( "qgsWCSConnections" ) )
{
QMessageBox::information( this, tr( "Loading connections" ),
QMessageBox::information( this, tr( "Loading Connections" ),
tr( "The file is not a WCS connections exchange file." ) );
return false;
}
@ -315,7 +315,7 @@ bool QgsManageConnectionsDialog::populateConnections()
case PostGIS:
if ( root.tagName() != QLatin1String( "qgsPgConnections" ) )
{
QMessageBox::information( this, tr( "Loading connections" ),
QMessageBox::information( this, tr( "Loading Connections" ),
tr( "The file is not a PostGIS connections exchange file." ) );
return false;
}
@ -324,7 +324,7 @@ bool QgsManageConnectionsDialog::populateConnections()
case MSSQL:
if ( root.tagName() != QLatin1String( "qgsMssqlConnections" ) )
{
QMessageBox::information( this, tr( "Loading connections" ),
QMessageBox::information( this, tr( "Loading Connections" ),
tr( "The file is not a MSSQL connections exchange file." ) );
return false;
}
@ -332,7 +332,7 @@ bool QgsManageConnectionsDialog::populateConnections()
case Oracle:
if ( root.tagName() != QLatin1String( "qgsOracleConnections" ) )
{
QMessageBox::information( this, tr( "Loading connections" ),
QMessageBox::information( this, tr( "Loading Connections" ),
tr( "The file is not an Oracle connections exchange file." ) );
return false;
}
@ -340,7 +340,7 @@ bool QgsManageConnectionsDialog::populateConnections()
case DB2:
if ( root.tagName() != QLatin1String( "qgsDb2Connections" ) )
{
QMessageBox::information( this, tr( "Loading connections" ),
QMessageBox::information( this, tr( "Loading Connections" ),
tr( "The file is not a DB2 connections exchange file." ) );
return false;
}
@ -348,7 +348,7 @@ bool QgsManageConnectionsDialog::populateConnections()
case GeoNode:
if ( root.tagName() != QLatin1String( "qgsGeoNodeConnections" ) )
{
QMessageBox::information( this, tr( "Loading connections" ),
QMessageBox::information( this, tr( "Loading Connections" ),
tr( "The file is not a GeoNode connections exchange file." ) );
return false;
}
@ -627,7 +627,7 @@ void QgsManageConnectionsDialog::loadOWSConnections( const QDomDocument &doc, co
QDomElement root = doc.documentElement();
if ( root.tagName() != "qgs" + service.toUpper() + "Connections" )
{
QMessageBox::information( this, tr( "Loading connections" ),
QMessageBox::information( this, tr( "Loading Connections" ),
tr( "The file is not a %1 connections exchange file." ).arg( service ) );
return;
}
@ -654,7 +654,7 @@ void QgsManageConnectionsDialog::loadOWSConnections( const QDomDocument &doc, co
if ( keys.contains( connectionName ) && prompt )
{
int res = QMessageBox::warning( this,
tr( "Loading connections" ),
tr( "Loading Connections" ),
tr( "Connection with name '%1' already exists. Overwrite?" )
.arg( connectionName ),
QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::NoToAll | QMessageBox::Cancel );
@ -714,7 +714,7 @@ void QgsManageConnectionsDialog::loadWfsConnections( const QDomDocument &doc, co
QDomElement root = doc.documentElement();
if ( root.tagName() != QLatin1String( "qgsWFSConnections" ) )
{
QMessageBox::information( this, tr( "Loading connections" ),
QMessageBox::information( this, tr( "Loading Connections" ),
tr( "The file is not a WFS connections exchange file." ) );
return;
}
@ -741,7 +741,7 @@ void QgsManageConnectionsDialog::loadWfsConnections( const QDomDocument &doc, co
if ( keys.contains( connectionName ) && prompt )
{
int res = QMessageBox::warning( this,
tr( "Loading connections" ),
tr( "Loading Connections" ),
tr( "Connection with name '%1' already exists. Overwrite?" )
.arg( connectionName ),
QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::NoToAll | QMessageBox::Cancel );
@ -796,7 +796,7 @@ void QgsManageConnectionsDialog::loadPgConnections( const QDomDocument &doc, con
if ( root.tagName() != QLatin1String( "qgsPgConnections" ) )
{
QMessageBox::information( this,
tr( "Loading connections" ),
tr( "Loading Connections" ),
tr( "The file is not a PostGIS connections exchange file." ) );
return;
}
@ -823,7 +823,7 @@ void QgsManageConnectionsDialog::loadPgConnections( const QDomDocument &doc, con
if ( keys.contains( connectionName ) && prompt )
{
int res = QMessageBox::warning( this,
tr( "Loading connections" ),
tr( "Loading Connections" ),
tr( "Connection with name '%1' already exists. Overwrite?" )
.arg( connectionName ),
QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::NoToAll | QMessageBox::Cancel );
@ -886,7 +886,7 @@ void QgsManageConnectionsDialog::loadMssqlConnections( const QDomDocument &doc,
if ( root.tagName() != QLatin1String( "qgsMssqlConnections" ) )
{
QMessageBox::information( this,
tr( "Loading connections" ),
tr( "Loading Connections" ),
tr( "The file is not a MSSQL connections exchange file." ) );
return;
}
@ -913,7 +913,7 @@ void QgsManageConnectionsDialog::loadMssqlConnections( const QDomDocument &doc,
if ( keys.contains( connectionName ) && prompt )
{
int res = QMessageBox::warning( this,
tr( "Loading connections" ),
tr( "Loading Connections" ),
tr( "Connection with name '%1' already exists. Overwrite?" )
.arg( connectionName ),
QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::NoToAll | QMessageBox::Cancel );
@ -976,7 +976,7 @@ void QgsManageConnectionsDialog::loadOracleConnections( const QDomDocument &doc,
if ( root.tagName() != QLatin1String( "qgsOracleConnections" ) )
{
QMessageBox::information( this,
tr( "Loading connections" ),
tr( "Loading Connections" ),
tr( "The file is not an Oracle connections exchange file." ) );
return;
}
@ -1003,7 +1003,7 @@ void QgsManageConnectionsDialog::loadOracleConnections( const QDomDocument &doc,
if ( keys.contains( connectionName ) && prompt )
{
int res = QMessageBox::warning( this,
tr( "Loading connections" ),
tr( "Loading Connections" ),
tr( "Connection with name '%1' already exists. Overwrite?" )
.arg( connectionName ),
QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::NoToAll | QMessageBox::Cancel );
@ -1062,7 +1062,7 @@ void QgsManageConnectionsDialog::loadDb2Connections( const QDomDocument &doc, co
if ( root.tagName() != QLatin1String( "qgsDb2Connections" ) )
{
QMessageBox::information( this,
tr( "Loading connections" ),
tr( "Loading Connections" ),
tr( "The file is not a DB2 connections exchange file." ) );
return;
}
@ -1089,7 +1089,7 @@ void QgsManageConnectionsDialog::loadDb2Connections( const QDomDocument &doc, co
if ( keys.contains( connectionName ) && prompt )
{
int res = QMessageBox::warning( this,
tr( "Loading connections" ),
tr( "Loading Connections" ),
tr( "Connection with name '%1' already exists. Overwrite?" )
.arg( connectionName ),
QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::NoToAll | QMessageBox::Cancel );
@ -1151,7 +1151,7 @@ void QgsManageConnectionsDialog::loadGeonodeConnections( const QDomDocument &doc
QDomElement root = doc.documentElement();
if ( root.tagName() != QLatin1String( "qgsGeoNodeConnections" ) )
{
QMessageBox::information( this, tr( "Loading connections" ),
QMessageBox::information( this, tr( "Loading Connections" ),
tr( "The file is not a GeoNode connections exchange file." ) );
return;
}
@ -1178,7 +1178,7 @@ void QgsManageConnectionsDialog::loadGeonodeConnections( const QDomDocument &doc
if ( keys.contains( connectionName ) && prompt )
{
int res = QMessageBox::warning( this,
tr( "Loading connections" ),
tr( "Loading Connections" ),
tr( "Connection with name '%1' already exists. Overwrite?" )
.arg( connectionName ),
QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::NoToAll | QMessageBox::Cancel );

View File

@ -173,7 +173,7 @@ bool QgsNewHttpConnection::validate()
if ( ( mOriginalConnName.isNull() || mOriginalConnName.compare( txtName->text(), Qt::CaseInsensitive ) != 0 ) &&
settings.contains( key + "/url" ) &&
QMessageBox::question( this,
tr( "Save connection" ),
tr( "Save Connection" ),
tr( "Should the existing connection %1 be overwritten?" ).arg( txtName->text() ),
QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
{
@ -182,7 +182,7 @@ bool QgsNewHttpConnection::validate()
if ( ! mAuthSettings->password().isEmpty() &&
QMessageBox::question( this,
tr( "Saving passwords" ),
tr( "Saving Passwords" ),
trUtf8( "WARNING: You have entered a password. It will be stored in unsecured plain text in your project files and your home directory (Unix-like OS) or user profile (Windows). If you want to avoid this, press Cancel and either:\n\na) Don't provide a password in the connection settings — it will be requested interactively when needed;\nb) Use the Configuration tab to add your credentials in an HTTP Basic Authentication method and store them in an encrypted database." ),
QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
{

View File

@ -307,7 +307,7 @@ void QgsOWSSourceSelect::mSaveButton_clicked()
void QgsOWSSourceSelect::mLoadButton_clicked()
{
QString fileName = QFileDialog::getOpenFileName( this, tr( "Load connections" ), QDir::homePath(),
QString fileName = QFileDialog::getOpenFileName( this, tr( "Load Connections" ), QDir::homePath(),
tr( "XML files (*.xml *XML)" ) );
if ( fileName.isEmpty() )
{

View File

@ -212,13 +212,13 @@ void QgsSQLComposerDialog::accept()
if ( !mSQLValidatorCallback->isValid( sql(), errorMsg, warningMsg ) )
{
if ( errorMsg.isEmpty() )
errorMsg = tr( "An error occurred during evaluation of the SQL statement" );
QMessageBox::critical( this, tr( "SQL error" ), errorMsg );
errorMsg = tr( "An error occurred during evaluation of the SQL statement." );
QMessageBox::critical( this, tr( "SQL Error" ), errorMsg );
return;
}
if ( !warningMsg.isEmpty() )
{
QMessageBox::warning( this, tr( "SQL warning" ), warningMsg );
QMessageBox::warning( this, tr( "SQL Warning" ), warningMsg );
}
}
QDialog::accept();

View File

@ -875,12 +875,12 @@ void QgsCategorizedSymbolRendererWidget::matchToSymbolsFromLibrary()
int matched = matchToSymbols( QgsStyle::defaultStyle() );
if ( matched > 0 )
{
QMessageBox::information( this, tr( "Matched symbols" ),
QMessageBox::information( this, tr( "Matched Symbols" ),
tr( "Matched %1 categories to symbols." ).arg( matched ) );
}
else
{
QMessageBox::warning( this, tr( "Matched symbols" ),
QMessageBox::warning( this, tr( "Matched Symbols" ),
tr( "No categories could be matched to symbols in library." ) );
}
}
@ -926,20 +926,20 @@ void QgsCategorizedSymbolRendererWidget::matchToSymbolsFromXml()
QgsStyle importedStyle;
if ( !importedStyle.importXml( fileName ) )
{
QMessageBox::warning( this, tr( "Matching error" ),
tr( "An error occurred reading file:\n%1" ).arg( importedStyle.errorString() ) );
QMessageBox::warning( this, tr( "Matching Error" ),
tr( "An error occurred while reading file:\n%1" ).arg( importedStyle.errorString() ) );
return;
}
int matched = matchToSymbols( &importedStyle );
if ( matched > 0 )
{
QMessageBox::information( this, tr( "Matched symbols" ),
QMessageBox::information( this, tr( "Matched Symbols" ),
tr( "Matched %1 categories to symbols from file." ).arg( matched ) );
}
else
{
QMessageBox::warning( this, tr( "Matched symbols" ),
QMessageBox::warning( this, tr( "Matched Symbols" ),
tr( "No categories could be matched to symbols in file." ) );
}
}

View File

@ -180,7 +180,7 @@ bool QgsStyleExportImportDialog::populateStyles( QgsStyle *style )
// NOTE mTempStyle is style here
if ( !style->importXml( mFileName ) )
{
QMessageBox::warning( this, tr( "Import error" ),
QMessageBox::warning( this, tr( "Import Error" ),
tr( "An error occurred during import:\n%1" ).arg( style->errorString() ) );
return false;
}
@ -278,7 +278,7 @@ void QgsStyleExportImportDialog::moveStyles( QModelIndexList *selection, QgsStyl
{
if ( dst->symbolNames().contains( symbolName ) && prompt )
{
int res = QMessageBox::warning( this, tr( "Duplicate names" ),
int res = QMessageBox::warning( this, tr( "Duplicate Names" ),
tr( "Symbol with name '%1' already exists.\nOverwrite?" )
.arg( symbolName ),
QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::NoToAll | QMessageBox::Cancel );
@ -322,7 +322,7 @@ void QgsStyleExportImportDialog::moveStyles( QModelIndexList *selection, QgsStyl
{
if ( dst->colorRampNames().contains( symbolName ) && prompt )
{
int res = QMessageBox::warning( this, tr( "Duplicate names" ),
int res = QMessageBox::warning( this, tr( "Duplicate Names" ),
tr( "Color ramp with name '%1' already exists.\nOverwrite?" )
.arg( symbolName ),
QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::NoToAll | QMessageBox::Cancel );

View File

@ -53,7 +53,7 @@ void QgsGPSDeviceDialog::pbnNewDevice_clicked()
void QgsGPSDeviceDialog::pbnDeleteDevice_clicked()
{
if ( QMessageBox::warning( this, tr( "Are you sure?" ),
if ( QMessageBox::warning( this, tr( "Delete Device" ),
tr( "Are you sure that you want to delete this device?" ),
QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Ok )
{

View File

@ -82,7 +82,7 @@ void QgsDb2NewConnection::accept()
QgsDebugMsg( QString( "hasAuthConfigID: %1" ).arg( hasAuthConfigID ) );
if ( !hasAuthConfigID && mAuthSettings->storePasswordIsChecked( ) &&
QMessageBox::question( this,
tr( "Saving passwords" ),
tr( "Saving Passwords" ),
tr( "WARNING: You have opted to save your password. It will be stored in plain text in your project files and in your home directory on Unix-like systems, or in your user profile on Windows. If you do not want this to happen, please press the Cancel button.\n" ),
QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
{
@ -94,7 +94,7 @@ void QgsDb2NewConnection::accept()
( settings.contains( baseKey + txtName->text() + "/service" ) ||
settings.contains( baseKey + txtName->text() + "/host" ) ) &&
QMessageBox::question( this,
tr( "Save connection" ),
tr( "Save Connection" ),
tr( "Should the existing connection %1 be overwritten?" ).arg( txtName->text() ),
QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
{

View File

@ -262,7 +262,7 @@ void QgsDb2SourceSelect::btnSave_clicked()
void QgsDb2SourceSelect::btnLoad_clicked()
{
QString fileName = QFileDialog::getOpenFileName( this, tr( "Load connections" ), QStringLiteral( "." ),
QString fileName = QFileDialog::getOpenFileName( this, tr( "Load Connections" ), QStringLiteral( "." ),
tr( "XML files (*.xml *XML)" ) );
if ( fileName.isEmpty() )
{

View File

@ -91,7 +91,7 @@ void QgsGeoNodeSourceSelect::addConnectionsEntryList()
void QgsGeoNodeSourceSelect::modifyConnectionsEntryList()
{
QgsGeoNodeNewConnection nc( this, cmbConnections->currentText() );
nc.setWindowTitle( tr( "Modify GeoNode connection" ) );
nc.setWindowTitle( tr( "Modify GeoNode Connection" ) );
if ( nc.exec() )
{
@ -300,7 +300,7 @@ void QgsGeoNodeSourceSelect::saveGeonodeConnection()
void QgsGeoNodeSourceSelect::loadGeonodeConnection()
{
QString fileName = QFileDialog::getOpenFileName( this, tr( "Load connections" ), QDir::homePath(),
QString fileName = QFileDialog::getOpenFileName( this, tr( "Load Connections" ), QDir::homePath(),
tr( "XML files (*.xml *.XML)" ) );
if ( fileName.isEmpty() )
{

View File

@ -82,7 +82,7 @@ void QgsMssqlNewConnection::accept()
( settings.contains( baseKey + txtName->text() + "/service" ) ||
settings.contains( baseKey + txtName->text() + "/host" ) ) &&
QMessageBox::question( this,
tr( "Save connection" ),
tr( "Save Connection" ),
tr( "Should the existing connection %1 be overwritten?" ).arg( txtName->text() ),
QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
{

View File

@ -265,7 +265,7 @@ void QgsMssqlSourceSelect::btnSave_clicked()
void QgsMssqlSourceSelect::btnLoad_clicked()
{
QString fileName = QFileDialog::getOpenFileName( this, tr( "Load connections" ), QDir::homePath(),
QString fileName = QFileDialog::getOpenFileName( this, tr( "Load Connections" ), QDir::homePath(),
tr( "XML files (*.xml *XML)" ) );
if ( fileName.isEmpty() )
{

View File

@ -92,7 +92,7 @@ void QgsOracleNewConnection::accept()
if ( chkStorePassword->isChecked() &&
QMessageBox::question( this,
tr( "Saving passwords" ),
tr( "Saving Passwords" ),
tr( "WARNING: You have opted to save your password. It will be stored in plain text in your project files and in your home directory on Unix-like systems, or in your user profile on Windows. If you do not want this to happen, please press the Cancel button.\n" ),
QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
{
@ -104,7 +104,7 @@ void QgsOracleNewConnection::accept()
( settings.contains( baseKey + txtName->text() + "/service" ) ||
settings.contains( baseKey + txtName->text() + "/host" ) ) &&
QMessageBox::question( this,
tr( "Save connection" ),
tr( "Save Connection" ),
tr( "Should the existing connection %1 be overwritten?" ).arg( txtName->text() ),
QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
{

View File

@ -285,7 +285,7 @@ void QgsOracleSourceSelect::on_btnSave_clicked()
void QgsOracleSourceSelect::on_btnLoad_clicked()
{
QString fileName = QFileDialog::getOpenFileName( this, tr( "Load connections" ), ".",
QString fileName = QFileDialog::getOpenFileName( this, tr( "Load Connections" ), ".",
tr( "XML files (*.xml *XML)" ) );
if ( fileName.isEmpty() )
{

View File

@ -114,7 +114,7 @@ void QgsPgNewConnection::accept()
if ( !hasAuthConfigID && mAuthSettings->storePasswordIsChecked( ) &&
QMessageBox::question( this,
tr( "Saving passwords" ),
tr( "Saving Passwords" ),
trUtf8( "WARNING: You have opted to save your password. It will be stored in unsecured plain text in your project files and in your home directory (Unix-like OS) or user profile (Windows). If you want to avoid this, press Cancel and either:\n\na) Don't save a password in the connection settings — it will be requested interactively when needed;\nb) Use the Configuration tab to add your credentials in an HTTP Basic Authentication method and store them in an encrypted database." ),
QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
{
@ -126,7 +126,7 @@ void QgsPgNewConnection::accept()
( settings.contains( baseKey + txtName->text() + "/service" ) ||
settings.contains( baseKey + txtName->text() + "/host" ) ) &&
QMessageBox::question( this,
tr( "Save connection" ),
tr( "Save Connection" ),
tr( "Should the existing connection %1 be overwritten?" ).arg( txtName->text() ),
QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
{

View File

@ -320,7 +320,7 @@ void QgsPgSourceSelect::btnSave_clicked()
void QgsPgSourceSelect::btnLoad_clicked()
{
QString fileName = QFileDialog::getOpenFileName( this, tr( "Load connections" ), QDir::homePath(),
QString fileName = QFileDialog::getOpenFileName( this, tr( "Load Connections" ), QDir::homePath(),
tr( "XML files (*.xml *XML)" ) );
if ( fileName.isEmpty() )
{

View File

@ -708,7 +708,7 @@ void QgsWFSSourceSelect::btnSave_clicked()
void QgsWFSSourceSelect::btnLoad_clicked()
{
QString fileName = QFileDialog::getOpenFileName( this, tr( "Load connections" ), QDir::homePath(),
QString fileName = QFileDialog::getOpenFileName( this, tr( "Load Connections" ), QDir::homePath(),
tr( "XML files (*.xml *XML)" ) );
if ( fileName.isEmpty() )
{

View File

@ -220,7 +220,7 @@ void QgsWMSSourceSelect::btnSave_clicked()
void QgsWMSSourceSelect::btnLoad_clicked()
{
QString fileName = QFileDialog::getOpenFileName( this, tr( "Load connections" ), QDir::homePath(),
QString fileName = QFileDialog::getOpenFileName( this, tr( "Load Connections" ), QDir::homePath(),
tr( "XML files (*.xml *XML)" ) );
if ( fileName.isEmpty() )
{
@ -402,7 +402,7 @@ bool QgsWMSSourceSelect::populateLayerList( const QgsWmsCapabilities &capabiliti
{
QTableWidgetItem *item = lstTilesets->item( row, i );
item->setFlags( item->flags() & ~Qt::ItemIsEnabled );
item->setToolTip( tr( "encoding %1 not supported." ).arg( format ) );
item->setToolTip( tr( "Encoding %1 not supported." ).arg( format ) );
}
}