Merge pull request #5508 from DelazJ/message_spacing

Fixing messages displayed in GUI
This commit is contained in:
Nyall Dawson 2017-11-02 08:13:25 +11:00 committed by GitHub
commit 7dc48f3a17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
61 changed files with 238 additions and 238 deletions

View File

@ -72,11 +72,11 @@ class ManageConnectionsDialog(QDialog, BASE_CLASS):
label = self.tr('eXtensible Markup Language (*.xml *.XML)') label = self.tr('eXtensible Markup Language (*.xml *.XML)')
if self.mode == 0: if self.mode == 0:
slabel = self.tr('Save connections') slabel = self.tr('Save Connections')
self.filename, filter = QFileDialog.getSaveFileName(self, slabel, self.filename, filter = QFileDialog.getSaveFileName(self, slabel,
'.', label) '.', label)
else: else:
slabel = self.tr('Load connections') slabel = self.tr('Load Connections')
self.filename, selected_filter = QFileDialog.getOpenFileName(self, slabel, self.filename, selected_filter = QFileDialog.getOpenFileName(self, slabel,
'.', label) '.', label)
@ -134,7 +134,7 @@ class ManageConnectionsDialog(QDialog, BASE_CLASS):
with open(self.filename, 'w') as fileobj: with open(self.filename, 'w') as fileobj:
fileobj.write(prettify_xml(etree.tostring(doc))) fileobj.write(prettify_xml(etree.tostring(doc)))
QMessageBox.information(self, self.tr('Save Connections'), QMessageBox.information(self, self.tr('Save Connections'),
self.tr('Saved to {0}').format(self.filename)) self.tr('Saved to {0}.').format(self.filename))
self.reject() self.reject()
def load(self, items): def load(self, items):

View File

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

View File

@ -167,7 +167,8 @@ class DlgTableProperties(QDialog, Ui_Dialog):
m = self.viewFields.model() m = self.viewFields.model()
fld = m.getObject(index) 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) QMessageBox.Yes | QMessageBox.No)
if res != QMessageBox.Yes: if res != QMessageBox.Yes:
return return
@ -218,8 +219,8 @@ class DlgTableProperties(QDialog, Ui_Dialog):
m = self.viewConstraints.model() m = self.viewConstraints.model()
constr = m.getObject(index) constr = m.getObject(index)
res = QMessageBox.question(self, self.tr("Are you sure"), res = QMessageBox.question(self, self.tr("Delete Constraint"),
self.tr("Really delete constraint '{0}'?").format(constr.name), self.tr("Are you sure you want to delete constraint '{0}'?").format(constr.name),
QMessageBox.Yes | QMessageBox.No) QMessageBox.Yes | QMessageBox.No)
if res != QMessageBox.Yes: if res != QMessageBox.Yes:
return return
@ -271,10 +272,10 @@ class DlgTableProperties(QDialog, Ui_Dialog):
def createSpatialIndex(self): def createSpatialIndex(self):
""" create spatial index for the geometry column """ """ create spatial index for the geometry column """
if self.table.type != self.table.VectorType: if self.table.type != self.table.VectorType:
QMessageBox.information(self, self.tr("DB Manager"), self.tr("The selected table has no geometry")) QMessageBox.information(self, self.tr("DB Manager"), self.tr("The selected table has no geometry."))
return 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), self.tr("Create spatial index for field {0}?").format(self.table.geomColumn),
QMessageBox.Yes | QMessageBox.No) QMessageBox.Yes | QMessageBox.No)
if res != QMessageBox.Yes: if res != QMessageBox.Yes:
@ -308,7 +309,8 @@ class DlgTableProperties(QDialog, Ui_Dialog):
m = self.viewIndexes.model() m = self.viewIndexes.model()
idx = m.getObject(index) 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) QMessageBox.Yes | QMessageBox.No)
if res != QMessageBox.Yes: if res != QMessageBox.Yes:
return return

View File

@ -27,7 +27,7 @@
<item> <item>
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="label_3">
<property name="text"> <property name="text">
<string>An error occurred:</string> <string>An error occurred</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -51,7 +51,7 @@
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">
<string>An error occurred when executing a query:</string> <string>An error occurred when executing a query</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -68,7 +68,7 @@
<item> <item>
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="text"> <property name="text">
<string>Query:</string> <string>Query</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

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

View File

@ -33,7 +33,7 @@
<item row="2" column="0" > <item row="2" column="0" >
<widget class="QLabel" name="label1" > <widget class="QLabel" name="label1" >
<property name="text" > <property name="text" >
<string>Overall progress:</string> <string>Overall progress</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -101,7 +101,7 @@ bool QgsDwgImporter::exec( const QString &sql, bool logError )
if ( logError ) if ( logError )
{ {
LOG( QObject::tr( "SQL statement failed\nDatabase:%1\nSQL:%2\nError:%3" ) LOG( QObject::tr( "SQL statement failed\nDatabase: %1\nSQL: %2\nError: %3" )
.arg( mDatabase, sql, QString::fromUtf8( CPLGetLastErrorMsg() ) ) ); .arg( mDatabase, sql, QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
} }
return false; return false;
@ -127,7 +127,7 @@ OGRLayerH QgsDwgImporter::query( const QString &sql )
if ( CPLGetLastErrorType() == CE_None ) if ( CPLGetLastErrorType() == CE_None )
return layer; return layer;
LOG( QObject::tr( "SQL statement failed\nDatabase:%1\nSQL:%2\nError:%3" ) LOG( QObject::tr( "SQL statement failed\nDatabase: %1\nSQL: %2\nError: %3" )
.arg( mDatabase, sql, QString::fromUtf8( CPLGetLastErrorMsg() ) ) ); .arg( mDatabase, sql, QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
OGR_DS_ReleaseResultSet( mDs.get(), layer ); OGR_DS_ReleaseResultSet( mDs.get(), layer );
@ -143,7 +143,7 @@ void QgsDwgImporter::startTransaction()
mInTransaction = GDALDatasetStartTransaction( mDs.get(), 0 ) == OGRERR_NONE; mInTransaction = GDALDatasetStartTransaction( mDs.get(), 0 ) == OGRERR_NONE;
if ( !mInTransaction ) if ( !mInTransaction )
{ {
LOG( QObject::tr( "Could not start transaction\nDatabase:%1\nError:%2" ) LOG( QObject::tr( "Could not start transaction\nDatabase: %1\nError: %2" )
.arg( mDatabase, QString::fromUtf8( CPLGetLastErrorMsg() ) ) ); .arg( mDatabase, QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
} }
} }
@ -154,7 +154,7 @@ void QgsDwgImporter::commitTransaction()
if ( mInTransaction && GDALDatasetCommitTransaction( mDs.get() ) != OGRERR_NONE ) if ( mInTransaction && GDALDatasetCommitTransaction( mDs.get() ) != OGRERR_NONE )
{ {
LOG( QObject::tr( "Could not commit transaction\nDatabase:%1\nError:%2" ) LOG( QObject::tr( "Could not commit transaction\nDatabase: %1\nError: %2" )
.arg( mDatabase, QString::fromUtf8( CPLGetLastErrorMsg() ) ) ); .arg( mDatabase, QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
} }
mInTransaction = false; mInTransaction = false;
@ -2672,7 +2672,7 @@ bool QgsDwgImporter::expandInserts( QString &error )
{ {
if ( errors < 1000 ) if ( errors < 1000 )
{ {
QgsMessageLog::logMessage( QObject::tr( "Could not copy feature of block %2 from layer %1 [Errors:%3]" ) QgsMessageLog::logMessage( QObject::tr( "Could not copy feature of block %2 from layer %1 [Errors: %3]" )
.arg( name ).arg( handle ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ), .arg( name ).arg( handle ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ),
QObject::tr( "DWG/DXF import" ) ); QObject::tr( "DWG/DXF import" ) );
} }

View File

@ -302,7 +302,7 @@ void qgisCrash( int signal )
#endif #endif
if ( len < 0 ) if ( len < 0 )
{ {
myPrint( "Could not read link (%d:%s)\n", errno, strerror( errno ) ); myPrint( "Could not read link (%d: %s)\n", errno, strerror( errno ) );
} }
else else
{ {
@ -327,7 +327,7 @@ void qgisCrash( int signal )
} }
else else
{ {
myPrint( "Cannot fork (%d:%s)\n", errno, strerror( errno ) ); myPrint( "Cannot fork (%d: %s)\n", errno, strerror( errno ) );
dumpBacktrace( 256 ); dumpBacktrace( 256 );
} }
} }

View File

@ -4047,7 +4047,7 @@ void QgisApp::about()
#ifdef HAVE_POSTGRESQL #ifdef HAVE_POSTGRESQL
versionString += PG_VERSION; versionString += PG_VERSION;
#else #else
versionString += tr( "No support." ); versionString += tr( "No support" );
#endif #endif
versionString += QLatin1String( "</td>" ); versionString += QLatin1String( "</td>" );
@ -4205,14 +4205,14 @@ bool QgisApp::addVectorLayers( const QStringList &layerQStringList, const QStrin
} }
else else
{ {
QString msg = tr( "%1 doesn't have any layers" ).arg( src ); QString msg = tr( "%1 doesn't have any layers." ).arg( src );
messageBar()->pushMessage( tr( "Invalid Data Source" ), msg, QgsMessageBar::CRITICAL, messageTimeout() ); messageBar()->pushMessage( tr( "Invalid Data Source" ), msg, QgsMessageBar::CRITICAL, messageTimeout() );
delete layer; delete layer;
} }
} }
else else
{ {
QString msg = tr( "%1 is not a valid or recognized data source" ).arg( src ); QString msg = tr( "%1 is not a valid or recognized data source." ).arg( src );
messageBar()->pushMessage( tr( "Invalid Data Source" ), msg, QgsMessageBar::CRITICAL, messageTimeout() ); messageBar()->pushMessage( tr( "Invalid Data Source" ), msg, QgsMessageBar::CRITICAL, messageTimeout() );
// since the layer is bad, stomp on it // since the layer is bad, stomp on it
@ -7606,7 +7606,7 @@ void QgisApp::mergeAttributesOfSelectedFeatures()
{ {
messageBar()->pushMessage( messageBar()->pushMessage(
tr( "Not enough features selected" ), tr( "Not enough features selected" ),
tr( "The merge tool requires at least two selected features" ), tr( "The merge tool requires at least two selected features." ),
QgsMessageBar::WARNING ); QgsMessageBar::WARNING );
return; return;
} }
@ -7761,7 +7761,7 @@ void QgisApp::mergeSelectedFeatures()
{ {
messageBar()->pushMessage( messageBar()->pushMessage(
tr( "Merge failed" ), tr( "Merge failed" ),
tr( "An error occurred during the merge operation" ), tr( "An error occurred during the merge operation." ),
QgsMessageBar::CRITICAL ); QgsMessageBar::CRITICAL );
} }
return; return;
@ -7797,7 +7797,7 @@ void QgisApp::mergeSelectedFeatures()
{ {
messageBar()->pushMessage( messageBar()->pushMessage(
tr( "Merge failed" ), tr( "Merge failed" ),
tr( "An error occurred during the merge operation" ), tr( "An error occurred during the merge operation." ),
QgsMessageBar::CRITICAL ); QgsMessageBar::CRITICAL );
} }
return; return;
@ -7823,7 +7823,7 @@ void QgisApp::mergeSelectedFeatures()
{ {
messageBar()->pushMessage( messageBar()->pushMessage(
tr( "Invalid result" ), tr( "Invalid result" ),
tr( "Could not store value '%1' in field of type %2" ).arg( attrs.at( i ).toString(), vl->fields().at( i ).typeName() ), tr( "Could not store value '%1' in field of type %2." ).arg( attrs.at( i ).toString(), vl->fields().at( i ).typeName() ),
QgsMessageBar::WARNING ); QgsMessageBar::WARNING );
} }
attrs[i] = val; attrs[i] = val;
@ -7953,7 +7953,7 @@ void QgisApp::selectAll()
{ {
messageBar()->pushMessage( messageBar()->pushMessage(
tr( "No active vector layer" ), tr( "No active vector layer" ),
tr( "To select all, choose a vector layer in the legend" ), tr( "To select all, choose a vector layer in the legend." ),
QgsMessageBar::INFO, QgsMessageBar::INFO,
messageTimeout() ); messageTimeout() );
return; return;
@ -7977,7 +7977,7 @@ void QgisApp::selectByExpression()
{ {
messageBar()->pushMessage( messageBar()->pushMessage(
tr( "No active vector layer" ), tr( "No active vector layer" ),
tr( "To select features, choose a vector layer in the legend" ), tr( "To select features, choose a vector layer in the legend." ),
QgsMessageBar::INFO, QgsMessageBar::INFO,
messageTimeout() ); messageTimeout() );
return; return;
@ -7997,7 +7997,7 @@ void QgisApp::selectByForm()
{ {
messageBar()->pushMessage( messageBar()->pushMessage(
tr( "No active vector layer" ), tr( "No active vector layer" ),
tr( "To select features, choose a vector layer in the legend" ), tr( "To select features, choose a vector layer in the legend." ),
QgsMessageBar::INFO, QgsMessageBar::INFO,
messageTimeout() ); messageTimeout() );
return; return;

View File

@ -173,7 +173,7 @@ void QgsBookmarks::addClicked()
} }
else else
{ {
QMessageBox::warning( this, tr( "Error" ), tr( "Unable to create the bookmark.\nDriver:%1\nDatabase:%2" ) QMessageBox::warning( this, tr( "Error" ), tr( "Unable to create the bookmark.\nDriver: %1\nDatabase: %2" )
.arg( query.lastError().driverText(), .arg( query.lastError().driverText(),
query.lastError().databaseText() ) ); query.lastError().databaseText() ) );
} }
@ -194,7 +194,7 @@ void QgsBookmarks::deleteClicked()
return; return;
// make sure the user really wants to delete these bookmarks // 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() ), tr( "Are you sure you want to delete %n bookmark(s)?", "number of rows", rows.size() ),
QMessageBox::Ok | QMessageBox::Cancel ) ) QMessageBox::Ok | QMessageBox::Cancel ) )
return; return;
@ -236,7 +236,7 @@ void QgsBookmarks::zoomToBookmark()
rect = ct.transform( rect ); rect = ct.transform( rect );
if ( rect.isEmpty() ) 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; return;
} }
} }
@ -326,7 +326,7 @@ void QgsBookmarks::exportToXml()
QgsSettings settings; QgsSettings settings;
QString lastUsedDir = settings.value( QStringLiteral( "Windows/Bookmarks/LastUsedDirectory" ), QDir::homePath() ).toString(); 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)" ) ); tr( "XML files (*.xml *.XML)" ) );
if ( fileName.isEmpty() ) if ( fileName.isEmpty() )
{ {

View File

@ -166,7 +166,7 @@ void QgsLoadStyleFromDBDialog::deleteStyleFromDB()
QString msgError; QString msgError;
QString opInfo = QObject::tr( "Delete style %1 from %2" ).arg( mSelectedStyleName, mLayer->providerType() ); 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 ), QObject::tr( "Are you sure you want to delete the style %1?" ).arg( mSelectedStyleName ),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) != QMessageBox::Yes ) QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) != QMessageBox::Yes )
return; return;
@ -192,7 +192,7 @@ void QgsLoadStyleFromDBDialog::deleteStyleFromDB()
int sectionLimit = mLayer->listStylesInDatabase( ids, names, descriptions, errorMsg ); int sectionLimit = mLayer->listStylesInDatabase( ids, names, descriptions, errorMsg );
if ( !errorMsg.isNull() ) if ( !errorMsg.isNull() )
{ {
QgisApp::instance()->messageBar()->pushMessage( tr( "Error occurred retrieving styles from database" ), errorMsg, QgsMessageBar::WARNING, QgisApp::instance()->messageTimeout() ); QgisApp::instance()->messageBar()->pushMessage( tr( "Error occurred while retrieving styles from database" ), errorMsg, QgsMessageBar::WARNING, QgisApp::instance()->messageTimeout() );
} }
else else
{ {

View File

@ -110,7 +110,7 @@ void QgsMapThemes::addPreset()
dlg.setWindowTitle( tr( "Map Themes" ) ); dlg.setWindowTitle( tr( "Map Themes" ) );
dlg.setHintString( tr( "Name of the new theme" ) ); dlg.setHintString( tr( "Name of the new theme" ) );
dlg.setOverwriteEnabled( false ); dlg.setOverwriteEnabled( false );
dlg.setConflictingNameWarning( tr( "A theme with this name already exists" ) ); dlg.setConflictingNameWarning( tr( "A theme with this name already exists." ) );
if ( dlg.exec() != QDialog::Accepted || dlg.name().isEmpty() ) if ( dlg.exec() != QDialog::Accepted || dlg.name().isEmpty() )
return; return;
@ -133,7 +133,7 @@ void QgsMapThemes::replaceTriggered()
if ( !actionPreset ) if ( !actionPreset )
return; 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() ), trUtf8( "Are you sure you want to replace the existing theme “%1”?" ).arg( actionPreset->text() ),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No ); QMessageBox::Yes | QMessageBox::No, QMessageBox::No );
if ( res != QMessageBox::Yes ) if ( res != QMessageBox::Yes )

View File

@ -65,7 +65,7 @@ void QgsMapToolAddRing::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
else if ( error == 2 ) else if ( error == 2 )
{ {
//problem with coordinate transformation //problem with coordinate transformation
emit messageEmitted( tr( "Cannot transform the point to the layers coordinate system" ), QgsMessageBar::WARNING ); emit messageEmitted( tr( "Cannot transform the point to the layers coordinate system." ), QgsMessageBar::WARNING );
return; return;
} }
@ -126,7 +126,7 @@ void QgsMapToolAddRing::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
{ {
errorMessage = tr( "an unknown error occurred" ); errorMessage = tr( "an unknown error occurred" );
} }
emit messageEmitted( tr( "could not add ring since %1." ).arg( errorMessage ), QgsMessageBar::CRITICAL ); emit messageEmitted( tr( "Could not add ring since %1." ).arg( errorMessage ), QgsMessageBar::CRITICAL );
vlayer->destroyEditCommand(); vlayer->destroyEditCommand();
} }
else else

View File

@ -1738,7 +1738,7 @@ QStringList QgsOptions::i18nList()
void QgsOptions::restoreDefaultWindowState() void QgsOptions::restoreDefaultWindowState()
{ {
// richard // 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; return;
mSettings->setValue( QStringLiteral( "/qgis/restoreDefaultWindowState" ), true ); mSettings->setValue( QStringLiteral( "/qgis/restoreDefaultWindowState" ), true );
} }

View File

@ -1128,7 +1128,7 @@ void QgsVectorLayerProperties::showListOfStylesFromDatabase()
int sectionLimit = mLayer->listStylesInDatabase( ids, names, descriptions, errorMsg ); int sectionLimit = mLayer->listStylesInDatabase( ids, names, descriptions, errorMsg );
if ( !errorMsg.isNull() ) if ( !errorMsg.isNull() )
{ {
QMessageBox::warning( this, tr( "Error occurred retrieving styles from database" ), errorMsg ); QMessageBox::warning( this, tr( "Error occurred while retrieving styles from database" ), errorMsg );
return; return;
} }
@ -1143,7 +1143,7 @@ void QgsVectorLayerProperties::showListOfStylesFromDatabase()
QString qmlStyle = mLayer->getStyleFromDatabase( selectedStyleId, errorMsg ); QString qmlStyle = mLayer->getStyleFromDatabase( selectedStyleId, errorMsg );
if ( !errorMsg.isNull() ) if ( !errorMsg.isNull() )
{ {
QMessageBox::warning( this, tr( "Error occurred retrieving styles from database" ), errorMsg ); QMessageBox::warning( this, tr( "Error occurred while retrieving styles from database" ), errorMsg );
return; return;
} }
@ -1156,7 +1156,7 @@ void QgsVectorLayerProperties::showListOfStylesFromDatabase()
} }
else else
{ {
QMessageBox::warning( this, tr( "Error occurred retrieving styles from database" ), QMessageBox::warning( this, tr( "Error occurred while retrieving styles from database" ),
tr( "The retrieved style is not a valid named style. Error message: %1" ) tr( "The retrieved style is not a valid named style. Error message: %1" )
.arg( errorMsg ) ); .arg( errorMsg ) );
} }
@ -1581,9 +1581,9 @@ void QgsVectorLayerProperties::onAuxiliaryLayerClear()
if ( !alayer ) if ( !alayer )
return; 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; 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 ) if ( reply == QMessageBox::Yes )
{ {
@ -1601,9 +1601,9 @@ void QgsVectorLayerProperties::onAuxiliaryLayerDelete()
if ( !alayer ) if ( !alayer )
return; 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; 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 ) if ( reply == QMessageBox::Yes )
{ {
@ -1662,10 +1662,10 @@ void QgsVectorLayerProperties::onAuxiliaryLayerDeleteField()
return; return;
// should be only 1 field // 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; 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 ) if ( reply == QMessageBox::Yes )
{ {

View File

@ -1114,7 +1114,7 @@ QString QgsExpressionNodeLiteral::dump() const
case QVariant::Bool: case QVariant::Bool:
return mValue.toBool() ? QStringLiteral( "TRUE" ) : QStringLiteral( "FALSE" ); return mValue.toBool() ? QStringLiteral( "TRUE" ) : QStringLiteral( "FALSE" );
default: default:
return tr( "[unsupported type;%1; value:%2]" ).arg( mValue.typeName(), mValue.toString() ); return tr( "[unsupported type: %1; value: %2]" ).arg( mValue.typeName(), mValue.toString() );
} }
} }

View File

@ -235,7 +235,7 @@ void QgsGeoNodeRequest::replyFinished()
if ( mHttpGeoNodeResponse.isEmpty() ) if ( mHttpGeoNodeResponse.isEmpty() )
{ {
mError = tr( "empty of capabilities: %1" ).arg( mGeoNodeReply->errorString() ); mError = tr( "Empty of capabilities: %1" ).arg( mGeoNodeReply->errorString() );
} }
} }
} }

View File

@ -513,7 +513,7 @@ QString QgsProcessingUtils::formatHelpMapAsHtml( const QVariantMap &map, const Q
return QString(); return QString();
}; };
QString s = QObject::tr( "<html><body><h2>Algorithm description</h2>\n " ); QString s = QObject::tr( "<html><body><h2>Algorithm description</h2>\n" );
s += QStringLiteral( "<p>" ) + getText( QStringLiteral( "ALG_DESC" ) ) + QStringLiteral( "</p>\n" ); s += QStringLiteral( "<p>" ) + getText( QStringLiteral( "ALG_DESC" ) ) + QStringLiteral( "</p>\n" );
s += QObject::tr( "<h2>Input parameters</h2>\n" ); s += QObject::tr( "<h2>Input parameters</h2>\n" );

View File

@ -222,7 +222,7 @@ void QgsGeometryValidator::run()
GEOSContextHandle_t handle = QgsGeometry::getGEOSHandler(); GEOSContextHandle_t handle = QgsGeometry::getGEOSHandler();
if ( !g0 ) if ( !g0 )
{ {
emit errorFound( QgsGeometry::Error( QObject::tr( "GEOS error:could not produce geometry for GEOS (check log window)" ) ) ); emit errorFound( QgsGeometry::Error( QObject::tr( "GEOS error: could not produce geometry for GEOS (check log window)" ) ) );
} }
else else
{ {
@ -240,7 +240,7 @@ void QgsGeometryValidator::run()
double x, y; double x, y;
GEOSCoordSeq_getX_r( handle, cs, 0, &x ); GEOSCoordSeq_getX_r( handle, cs, 0, &x );
GEOSCoordSeq_getY_r( handle, cs, 0, &y ); GEOSCoordSeq_getY_r( handle, cs, 0, &y );
emit errorFound( QgsGeometry::Error( QObject::tr( "GEOS error:%1" ).arg( r ), QgsPointXY( x, y ) ) ); emit errorFound( QgsGeometry::Error( QObject::tr( "GEOS error: %1" ).arg( r ), QgsPointXY( x, y ) ) );
mErrorCount++; mErrorCount++;
} }
@ -248,7 +248,7 @@ void QgsGeometryValidator::run()
} }
else else
{ {
emit errorFound( QgsGeometry::Error( QObject::tr( "GEOS error:%1" ).arg( r ) ) ); emit errorFound( QgsGeometry::Error( QObject::tr( "GEOS error: %1" ).arg( r ) ) );
mErrorCount++; mErrorCount++;
} }

View File

@ -462,7 +462,7 @@ QString QgsSQLStatement::NodeLiteral::dump() const
case QVariant::Bool: case QVariant::Bool:
return mValue.toBool() ? "TRUE" : "FALSE"; return mValue.toBool() ? "TRUE" : "FALSE";
default: default:
return tr( "[unsupported type;%1; value:%2]" ).arg( mValue.typeName(), mValue.toString() ); return tr( "[unsupported type: %1; value: %2]" ).arg( mValue.typeName(), mValue.toString() );
} }
} }

View File

@ -281,10 +281,10 @@ void QgsVectorFileWriter::init( QString vectorFileName,
{ {
mError = ErrCreateDataSource; mError = ErrCreateDataSource;
if ( action == CreateOrOverwriteFile ) if ( action == CreateOrOverwriteFile )
mErrorMessage = QObject::tr( "creation of data source failed (OGR error:%1)" ) mErrorMessage = QObject::tr( "Creation of data source failed (OGR error: %1)" )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ); .arg( QString::fromUtf8( CPLGetLastErrorMsg() ) );
else else
mErrorMessage = QObject::tr( "opening of data source in update mode failed (OGR error:%1)" ) mErrorMessage = QObject::tr( "Opening of data source in update mode failed (OGR error: %1)" )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ); .arg( QString::fromUtf8( CPLGetLastErrorMsg() ) );
return; return;
} }
@ -304,7 +304,7 @@ void QgsVectorFileWriter::init( QString vectorFileName,
if ( OGR_DS_DeleteLayer( mDS.get(), i ) != OGRERR_NONE ) if ( OGR_DS_DeleteLayer( mDS.get(), i ) != OGRERR_NONE )
{ {
mError = ErrCreateLayer; mError = ErrCreateLayer;
mErrorMessage = QObject::tr( "overwriting of existing layer failed (OGR error:%1)" ) mErrorMessage = QObject::tr( "Overwriting of existing layer failed (OGR error: %1)" )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ); .arg( QString::fromUtf8( CPLGetLastErrorMsg() ) );
return; return;
} }
@ -420,10 +420,10 @@ void QgsVectorFileWriter::init( QString vectorFileName,
if ( !mLayer ) if ( !mLayer )
{ {
if ( action == CreateOrOverwriteFile || action == CreateOrOverwriteLayer ) if ( action == CreateOrOverwriteFile || action == CreateOrOverwriteLayer )
mErrorMessage = QObject::tr( "creation of layer failed (OGR error:%1)" ) mErrorMessage = QObject::tr( "Creation of layer failed (OGR error: %1)" )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ); .arg( QString::fromUtf8( CPLGetLastErrorMsg() ) );
else else
mErrorMessage = QObject::tr( "opening of layer failed (OGR error:%1)" ) mErrorMessage = QObject::tr( "Opening of layer failed (OGR error: %1)" )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ); .arg( QString::fromUtf8( CPLGetLastErrorMsg() ) );
mError = ErrCreateLayer; mError = ErrCreateLayer;
return; return;
@ -530,7 +530,7 @@ void QgsVectorFileWriter::init( QString vectorFileName,
default: default:
//assert(0 && "invalid variant type!"); //assert(0 && "invalid variant type!");
mErrorMessage = QObject::tr( "unsupported type for field %1" ) mErrorMessage = QObject::tr( "Unsupported type for field %1" )
.arg( attrField.name() ); .arg( attrField.name() );
mError = ErrAttributeTypeUnsupported; mError = ErrAttributeTypeUnsupported;
return; return;
@ -553,7 +553,7 @@ void QgsVectorFileWriter::init( QString vectorFileName,
if ( i == 10 ) if ( i == 10 )
{ {
mErrorMessage = QObject::tr( "no available replacement for internal fieldname ogc_fid found" ).arg( attrField.name() ); mErrorMessage = QObject::tr( "No available replacement for internal fieldname ogc_fid found" ).arg( attrField.name() );
mError = ErrAttributeCreationFailed; mError = ErrAttributeCreationFailed;
return; return;
} }
@ -581,7 +581,7 @@ void QgsVectorFileWriter::init( QString vectorFileName,
if ( OGR_L_CreateField( mLayer, fld.get(), true ) != OGRERR_NONE ) if ( OGR_L_CreateField( mLayer, fld.get(), true ) != OGRERR_NONE )
{ {
QgsDebugMsg( "error creating field " + attrField.name() ); QgsDebugMsg( "error creating field " + attrField.name() );
mErrorMessage = QObject::tr( "creation of field %1 failed (OGR error: %2)" ) mErrorMessage = QObject::tr( "Creation of field %1 failed (OGR error: %2)" )
.arg( attrField.name(), .arg( attrField.name(),
QString::fromUtf8( CPLGetLastErrorMsg() ) ); QString::fromUtf8( CPLGetLastErrorMsg() ) );
mError = ErrAttributeCreationFailed; mError = ErrAttributeCreationFailed;
@ -598,7 +598,7 @@ void QgsVectorFileWriter::init( QString vectorFileName,
if ( ogrIdx < 0 ) if ( ogrIdx < 0 )
{ {
QgsDebugMsg( "error creating field " + attrField.name() ); QgsDebugMsg( "error creating field " + attrField.name() );
mErrorMessage = QObject::tr( "created field %1 not found (OGR error: %2)" ) mErrorMessage = QObject::tr( "Created field %1 not found (OGR error: %2)" )
.arg( attrField.name(), .arg( attrField.name(),
QString::fromUtf8( CPLGetLastErrorMsg() ) ); QString::fromUtf8( CPLGetLastErrorMsg() ) );
mError = ErrAttributeCreationFailed; mError = ErrAttributeCreationFailed;
@ -690,7 +690,7 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
datasetOptions.insert( QStringLiteral( "NB_IDS" ), new SetOption( datasetOptions.insert( QStringLiteral( "NB_IDS" ), new SetOption(
QObject::tr( "BNA records may contain from 2 to 4 identifiers per record. " QObject::tr( "BNA records may contain from 2 to 4 identifiers per record. "
"Some software packages only support a precise number of identifiers. " "Some software packages only support a precise number of identifiers. "
"You can override the default value (2) by a precise value" ), "You can override the default value (2) by a precise value." ),
QStringList() QStringList()
<< QStringLiteral( "2" ) << QStringLiteral( "2" )
<< QStringLiteral( "3" ) << QStringLiteral( "3" )
@ -837,7 +837,7 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
// as we set encoding for shapefiles based on "fileEncoding" parameter passed to the writer // as we set encoding for shapefiles based on "fileEncoding" parameter passed to the writer
#if 0 #if 0
layerOptions.insert( "ENCODING", new SetOption( layerOptions.insert( "ENCODING", new SetOption(
QObject::tr( "set the encoding value in the DBF file. " QObject::tr( "Set the encoding value in the DBF file. "
"The default value is LDID/87. It is not clear " "The default value is LDID/87. It is not clear "
"what other values may be appropriate." ), "what other values may be appropriate." ),
QStringList() QStringList()
@ -962,7 +962,7 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
datasetOptions.insert( QStringLiteral( "HEADER" ), new StringOption( datasetOptions.insert( QStringLiteral( "HEADER" ), new StringOption(
QObject::tr( "XML content that will be put between the <channel> element and the " QObject::tr( "XML content that will be put between the <channel> element and the "
"first <item> element for a RSS document, or between the xml tag and " "first <item> element for a RSS document, or between the xml tag and "
"the first <entry> element for an Atom document. " ), "the first <entry> element for an Atom document." ),
QLatin1String( "" ) // Default value QLatin1String( "" ) // Default value
) ); ) );
@ -1068,9 +1068,9 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
) ); ) );
datasetOptions.insert( QStringLiteral( "GML3_LONGSRS" ), new BoolOption( datasetOptions.insert( QStringLiteral( "GML3_LONGSRS" ), new BoolOption(
QObject::tr( "only valid when FORMAT=GML3/GML3Degree/GML3.2) Default to YES. " QObject::tr( "Only valid when FORMAT=GML3/GML3Degree/GML3.2. Default to YES. " //needs review here
"If YES, SRS with EPSG authority will be written with the " "If YES, SRS with EPSG authority will be written with the "
"'urn:ogc:def:crs:EPSG::' prefix. In the case, if the SRS is a " "'urn:ogc:def:crs:EPSG::' prefix. In the case the SRS is a "
"geographic SRS without explicit AXIS order, but that the same " "geographic SRS without explicit AXIS order, but that the same "
"SRS authority code imported with ImportFromEPSGA() should be " "SRS authority code imported with ImportFromEPSGA() should be "
"treated as lat/long, then the function will take care of coordinate " "treated as lat/long, then the function will take care of coordinate "
@ -1260,7 +1260,7 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
layerOptions.clear(); layerOptions.clear();
datasetOptions.insert( QStringLiteral( "NameField" ), new StringOption( datasetOptions.insert( QStringLiteral( "NameField" ), new StringOption(
QObject::tr( "Allows you to specify the field to use for the KML <name> element. " ), QObject::tr( "Allows you to specify the field to use for the KML <name> element." ),
QStringLiteral( "Name" ) // Default value QStringLiteral( "Name" ) // Default value
) ); ) );
@ -1423,7 +1423,7 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
layerOptions.clear(); layerOptions.clear();
datasetOptions.insert( QStringLiteral( "UPDATES" ), new SetOption( datasetOptions.insert( QStringLiteral( "UPDATES" ), new SetOption(
QObject::tr( "Should update files be incorporated into the base data on the fly. " ), QObject::tr( "Should update files be incorporated into the base data on the fly." ),
QStringList() QStringList()
<< QStringLiteral( "APPLY" ) << QStringLiteral( "APPLY" )
<< QStringLiteral( "IGNORE" ), << QStringLiteral( "IGNORE" ),
@ -1440,7 +1440,7 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
datasetOptions.insert( QStringLiteral( "ADD_SOUNDG_DEPTH" ), new BoolOption( datasetOptions.insert( QStringLiteral( "ADD_SOUNDG_DEPTH" ), new BoolOption(
QObject::tr( "Should a DEPTH attribute be added on SOUNDG features and assign the depth " QObject::tr( "Should a DEPTH attribute be added on SOUNDG features and assign the depth "
"of the sounding. This should only be enabled with SPLIT_MULTIPOINT is " "of the sounding. This should only be enabled when SPLIT_MULTIPOINT is "
"also enabled." ), "also enabled." ),
false // Default value false // Default value
) ); ) );
@ -1622,7 +1622,7 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
layerOptions.insert( QStringLiteral( "COMPRESS_GEOM" ), new BoolOption( layerOptions.insert( QStringLiteral( "COMPRESS_GEOM" ), new BoolOption(
QObject::tr( "If the format of the geometry BLOB is of the SpatiaLite flavor, " QObject::tr( "If the format of the geometry BLOB is of the SpatiaLite flavor, "
"this option can be used to control if the compressed format for " "this option can be used to control if the compressed format for "
"geometries (LINESTRINGs, POLYGONs) must be used" ), "geometries (LINESTRINGs, POLYGONs) must be used." ),
false // Default value false // Default value
) ); ) );
@ -1700,14 +1700,14 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
) ); ) );
datasetOptions.insert( QStringLiteral( "CONFIG" ), new StringOption( datasetOptions.insert( QStringLiteral( "CONFIG" ), new StringOption(
QObject::tr( "path to the GCT : the GCT file describe the GeoConcept types definitions: " QObject::tr( "Path to the GCT: the GCT file describes the GeoConcept types definitions: "
"In this file, every line must start with //# followed by a keyword. " "In this file, every line must start with //# followed by a keyword. "
"Lines starting with // are comments." ), "Lines starting with // are comments." ),
QLatin1String( "" ) // Default value QLatin1String( "" ) // Default value
) ); ) );
datasetOptions.insert( QStringLiteral( "FEATURETYPE" ), new StringOption( datasetOptions.insert( QStringLiteral( "FEATURETYPE" ), new StringOption(
QObject::tr( "defines the feature to be created. The TYPE corresponds to one of the Name " QObject::tr( "Defines the feature to be created. The TYPE corresponds to one of the Name "
"found in the GCT file for a type section. The SUBTYPE corresponds to one of " "found in the GCT file for a type section. The SUBTYPE corresponds to one of "
"the Name found in the GCT file for a sub-type section within the previous " "the Name found in the GCT file for a sub-type section within the previous "
"type section." ), "type section." ),
@ -1774,7 +1774,7 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
layerOptions.insert( QStringLiteral( "OGR_XLSX_HEADERS" ), new SetOption( layerOptions.insert( QStringLiteral( "OGR_XLSX_HEADERS" ), new SetOption(
QObject::tr( "By default, the driver will read the first lines of each sheet to detect " QObject::tr( "By default, the driver will read the first lines of each sheet to detect "
"if the first line might be the name of columns. If set to FORCE, the driver " "if the first line might be the name of columns. If set to FORCE, the driver "
"will consider the first line will be taken as the header line. If set to " "will consider the first line as the header line. If set to "
"DISABLE, it will be considered as the first feature. Otherwise " "DISABLE, it will be considered as the first feature. Otherwise "
"auto-detection will occur." ), "auto-detection will occur." ),
QStringList() QStringList()
@ -1814,7 +1814,7 @@ QMap<QString, QgsVectorFileWriter::MetaData> QgsVectorFileWriter::initMetaData()
layerOptions.insert( QStringLiteral( "OGR_ODS_HEADERS" ), new SetOption( layerOptions.insert( QStringLiteral( "OGR_ODS_HEADERS" ), new SetOption(
QObject::tr( "By default, the driver will read the first lines of each sheet to detect " QObject::tr( "By default, the driver will read the first lines of each sheet to detect "
"if the first line might be the name of columns. If set to FORCE, the driver " "if the first line might be the name of columns. If set to FORCE, the driver "
"will consider the first line will be taken as the header line. If set to " "will consider the first line as the header line. If set to "
"DISABLE, it will be considered as the first feature. Otherwise " "DISABLE, it will be considered as the first feature. Otherwise "
"auto-detection will occur." ), "auto-detection will occur." ),
QStringList() QStringList()

View File

@ -515,7 +515,7 @@ void QgsAuthAuthoritiesEditor::btnRemoveCa_clicked()
if ( cert.isNull() ) if ( cert.isNull() )
{ {
messageBar()->pushMessage( tr( "Certificate could not found in database for id %1:" ).arg( digest ), messageBar()->pushMessage( tr( "Certificate could not be found in database for id %1:" ).arg( digest ),
QgsMessageBar::WARNING ); QgsMessageBar::WARNING );
return; return;
} }
@ -641,7 +641,7 @@ void QgsAuthAuthoritiesEditor::defaultTrustPolicyChanged( QgsAuthCertUtils::Cert
{ {
if ( !QgsApplication::authManager()->setDefaultCertTrustPolicy( trustpolicy ) ) if ( !QgsApplication::authManager()->setDefaultCertTrustPolicy( trustpolicy ) )
{ {
authMessageOut( QObject::tr( "Could not store default trust policy" ), authMessageOut( QObject::tr( "Could not store default trust policy." ),
QObject::tr( "Authorities Manager" ), QObject::tr( "Authorities Manager" ),
QgsAuthManager::CRITICAL ); QgsAuthManager::CRITICAL );
} }
@ -671,14 +671,14 @@ void QgsAuthAuthoritiesEditor::btnCaFile_clicked()
if ( !QgsApplication::authManager()->storeAuthSetting( QStringLiteral( "cafile" ), QVariant( fn ) ) ) if ( !QgsApplication::authManager()->storeAuthSetting( QStringLiteral( "cafile" ), QVariant( fn ) ) )
{ {
authMessageOut( QObject::tr( "Could not store 'CA file path' in authentication database" ), authMessageOut( QObject::tr( "Could not store 'CA file path' in authentication database." ),
QObject::tr( "Authorities Manager" ), QObject::tr( "Authorities Manager" ),
QgsAuthManager::WARNING ); QgsAuthManager::WARNING );
} }
if ( !QgsApplication::authManager()->storeAuthSetting( QStringLiteral( "cafileallowinvalid" ), if ( !QgsApplication::authManager()->storeAuthSetting( QStringLiteral( "cafileallowinvalid" ),
QVariant( dlg->allowInvalidCerts() ) ) ) QVariant( dlg->allowInvalidCerts() ) ) )
{ {
authMessageOut( QObject::tr( "Could not store 'CA file allow invalids' setting in authentication database" ), authMessageOut( QObject::tr( "Could not store 'CA file allow invalids' setting in authentication database." ),
QObject::tr( "Authorities Manager" ), QObject::tr( "Authorities Manager" ),
QgsAuthManager::WARNING ); QgsAuthManager::WARNING );
} }
@ -692,7 +692,7 @@ void QgsAuthAuthoritiesEditor::btnCaFile_clicked()
{ {
if ( !QgsApplication::authManager()->storeCertTrustPolicy( cert, dlg->certTrustPolicy() ) ) if ( !QgsApplication::authManager()->storeCertTrustPolicy( cert, dlg->certTrustPolicy() ) )
{ {
authMessageOut( QObject::tr( "Could not set trust policy for imported certificates" ), authMessageOut( QObject::tr( "Could not set trust policy for imported certificates." ),
QObject::tr( "Authorities Manager" ), QObject::tr( "Authorities Manager" ),
QgsAuthManager::WARNING ); QgsAuthManager::WARNING );
} }
@ -713,14 +713,14 @@ void QgsAuthAuthoritiesEditor::btnCaFileClear_clicked()
{ {
if ( !QgsApplication::authManager()->removeAuthSetting( QStringLiteral( "cafile" ) ) ) if ( !QgsApplication::authManager()->removeAuthSetting( QStringLiteral( "cafile" ) ) )
{ {
authMessageOut( QObject::tr( "Could not remove 'CA file path' from authentication database" ), authMessageOut( QObject::tr( "Could not remove 'CA file path' from authentication database." ),
QObject::tr( "Authorities Manager" ), QObject::tr( "Authorities Manager" ),
QgsAuthManager::WARNING ); QgsAuthManager::WARNING );
return; return;
} }
if ( !QgsApplication::authManager()->removeAuthSetting( QStringLiteral( "cafileallowinvalid" ) ) ) if ( !QgsApplication::authManager()->removeAuthSetting( QStringLiteral( "cafileallowinvalid" ) ) )
{ {
authMessageOut( QObject::tr( "Could not remove 'CA file allow invalids' setting from authentication database" ), authMessageOut( QObject::tr( "Could not remove 'CA file allow invalids' setting from authentication database." ),
QObject::tr( "Authorities Manager" ), QObject::tr( "Authorities Manager" ),
QgsAuthManager::WARNING ); QgsAuthManager::WARNING );
return; return;
@ -737,7 +737,7 @@ void QgsAuthAuthoritiesEditor::btnCaFileClear_clicked()
{ {
if ( !QgsApplication::authManager()->removeCertTrustPolicies( certs ) ) if ( !QgsApplication::authManager()->removeCertTrustPolicies( certs ) )
{ {
messageBar()->pushMessage( tr( "ERROR removing cert(s) trust policy from authentication database" ), messageBar()->pushMessage( tr( "ERROR removing cert(s) trust policy from authentication database." ),
QgsMessageBar::CRITICAL ); QgsMessageBar::CRITICAL );
return; return;
} }

View File

@ -83,7 +83,7 @@ void QgsAuthGuiUtils::setMasterPassword( QgsMessageBar *msgbar, int timeout )
if ( QgsApplication::authManager()->masterPasswordIsSet() ) if ( QgsApplication::authManager()->masterPasswordIsSet() )
{ {
msgbar->pushMessage( QgsApplication::authManager()->authManTag(), msgbar->pushMessage( QgsApplication::authManager()->authManTag(),
QObject::tr( "Master password already set" ), QObject::tr( "Master password already set." ),
QgsMessageBar::INFO, timeout ); QgsMessageBar::INFO, timeout );
return; return;
} }
@ -95,16 +95,16 @@ void QgsAuthGuiUtils::clearCachedMasterPassword( QgsMessageBar *msgbar, int time
if ( QgsAuthGuiUtils::isDisabled( msgbar, timeout ) ) if ( QgsAuthGuiUtils::isDisabled( msgbar, timeout ) )
return; return;
QString msg( QObject::tr( "Master password not cleared because it is not set" ) ); QString msg( QObject::tr( "Master password not cleared because it is not set." ) );
QgsMessageBar::MessageLevel level( QgsMessageBar::INFO ); QgsMessageBar::MessageLevel level( QgsMessageBar::INFO );
if ( QgsApplication::authManager()->masterPasswordIsSet() ) if ( QgsApplication::authManager()->masterPasswordIsSet() )
{ {
QgsApplication::authManager()->clearMasterPassword(); QgsApplication::authManager()->clearMasterPassword();
msg = QObject::tr( "Master password cleared (NOTE: network connections may be cached)" ); msg = QObject::tr( "Master password cleared (NOTE: network connections may be cached)." );
if ( QgsApplication::authManager()->masterPasswordIsSet() ) if ( QgsApplication::authManager()->masterPasswordIsSet() )
{ {
msg = QObject::tr( "Master password FAILED to be cleared" ); msg = QObject::tr( "Master password FAILED to be cleared." );
level = QgsMessageBar::WARNING; level = QgsMessageBar::WARNING;
} }
} }
@ -181,12 +181,12 @@ void QgsAuthGuiUtils::removeAuthenticationConfigs( QgsMessageBar *msgbar, int ti
return; return;
} }
QString msg( QObject::tr( "Authentication configurations removed" ) ); QString msg( QObject::tr( "Authentication configurations removed." ) );
QgsMessageBar::MessageLevel level( QgsMessageBar::INFO ); QgsMessageBar::MessageLevel level( QgsMessageBar::INFO );
if ( !QgsApplication::authManager()->removeAllAuthenticationConfigs() ) if ( !QgsApplication::authManager()->removeAllAuthenticationConfigs() )
{ {
msg = QObject::tr( "Authentication configurations FAILED to be removed" ); msg = QObject::tr( "Authentication configurations FAILED to be removed." );
level = QgsMessageBar::WARNING; level = QgsMessageBar::WARNING;
} }
@ -214,13 +214,13 @@ void QgsAuthGuiUtils::eraseAuthenticationDatabase( QgsMessageBar *msgbar, int ti
return; return;
} }
QString msg( QObject::tr( "Active authentication database erased" ) ); QString msg( QObject::tr( "Active authentication database erased." ) );
QgsMessageBar::MessageLevel level( QgsMessageBar::WARNING ); QgsMessageBar::MessageLevel level( QgsMessageBar::WARNING );
QString backuppath; QString backuppath;
if ( !QgsApplication::authManager()->eraseAuthenticationDatabase( true, &backuppath ) ) if ( !QgsApplication::authManager()->eraseAuthenticationDatabase( true, &backuppath ) )
{ {
msg = QObject::tr( "Authentication database FAILED to be erased" ); msg = QObject::tr( "Authentication database FAILED to be erased." );
level = QgsMessageBar::WARNING; level = QgsMessageBar::WARNING;
} }
else else
@ -296,7 +296,7 @@ void QgsAuthGuiUtils::passwordHelperSync( QgsMessageBar *msgbar, int timeout )
QgsMessageBar::MessageLevel level; QgsMessageBar::MessageLevel level;
if ( ! QgsApplication::authManager()->masterPasswordIsSet() ) if ( ! QgsApplication::authManager()->masterPasswordIsSet() )
{ {
msg = QObject::tr( "Master password is not set and cannot be stored in your %1" ) msg = QObject::tr( "Master password is not set and cannot be stored in your %1." )
.arg( QgsAuthManager::AUTH_PASSWORD_HELPER_DISPLAY_NAME ); .arg( QgsAuthManager::AUTH_PASSWORD_HELPER_DISPLAY_NAME );
level = QgsMessageBar::WARNING; level = QgsMessageBar::WARNING;
} }
@ -307,7 +307,7 @@ void QgsAuthGuiUtils::passwordHelperSync( QgsMessageBar *msgbar, int timeout )
} }
else else
{ {
msg = QObject::tr( "Master password has been successfully stored in your %1" ) msg = QObject::tr( "Master password has been successfully stored in your %1." )
.arg( QgsAuthManager::AUTH_PASSWORD_HELPER_DISPLAY_NAME ); .arg( QgsAuthManager::AUTH_PASSWORD_HELPER_DISPLAY_NAME );
level = QgsMessageBar::INFO; level = QgsMessageBar::INFO;

View File

@ -302,7 +302,7 @@ void QgsAuthIdentitiesEditor::btnAddIdentity_clicked()
const QPair<QSslCertificate, QSslKey> &bundle( dlg->certBundleToImport() ); const QPair<QSslCertificate, QSslKey> &bundle( dlg->certBundleToImport() );
if ( !QgsApplication::authManager()->storeCertIdentity( bundle.first, bundle.second ) ) if ( !QgsApplication::authManager()->storeCertIdentity( bundle.first, bundle.second ) )
{ {
messageBar()->pushMessage( tr( "ERROR storing identity bundle in authentication database" ), messageBar()->pushMessage( tr( "ERROR storing identity bundle in authentication database." ),
QgsMessageBar::CRITICAL ); QgsMessageBar::CRITICAL );
} }
populateIdentitiesView(); populateIdentitiesView();
@ -326,7 +326,7 @@ void QgsAuthIdentitiesEditor::btnRemoveIdentity_clicked()
if ( digest.isEmpty() ) if ( digest.isEmpty() )
{ {
messageBar()->pushMessage( tr( "Certificate id missing" ), messageBar()->pushMessage( tr( "Certificate id missing." ),
QgsMessageBar::WARNING ); QgsMessageBar::WARNING );
return; return;
} }
@ -372,7 +372,7 @@ void QgsAuthIdentitiesEditor::btnGroupByOrg_toggled( bool checked )
{ {
if ( !QgsApplication::authManager()->storeAuthSetting( QStringLiteral( "identitiessortby" ), QVariant( checked ) ) ) if ( !QgsApplication::authManager()->storeAuthSetting( QStringLiteral( "identitiessortby" ), QVariant( checked ) ) )
{ {
authMessageOut( QObject::tr( "Could not store sort by preference" ), authMessageOut( QObject::tr( "Could not store sort by preference." ),
QObject::tr( "Authentication Identities" ), QObject::tr( "Authentication Identities" ),
QgsAuthManager::WARNING ); QgsAuthManager::WARNING );
} }

View File

@ -353,13 +353,13 @@ void QgsAuthServersEditor::btnEditServer_clicked()
if ( digest.isEmpty() ) if ( digest.isEmpty() )
{ {
messageBar()->pushMessage( tr( "SSL custom config id missing" ), messageBar()->pushMessage( tr( "SSL custom config id missing." ),
QgsMessageBar::WARNING ); QgsMessageBar::WARNING );
return; return;
} }
if ( hostport.isEmpty() ) if ( hostport.isEmpty() )
{ {
messageBar()->pushMessage( tr( "SSL custom config host:port missing" ), messageBar()->pushMessage( tr( "SSL custom config host:port missing." ),
QgsMessageBar::WARNING ); QgsMessageBar::WARNING );
return; return;
} }
@ -388,7 +388,7 @@ void QgsAuthServersEditor::btnGroupByOrg_toggled( bool checked )
{ {
if ( !QgsApplication::authManager()->storeAuthSetting( QStringLiteral( "serverssortby" ), QVariant( checked ) ) ) if ( !QgsApplication::authManager()->storeAuthSetting( QStringLiteral( "serverssortby" ), QVariant( checked ) ) )
{ {
authMessageOut( QObject::tr( "Could not store sort by preference" ), authMessageOut( QObject::tr( "Could not store sort by preference." ),
QObject::tr( "Authentication SSL Configs" ), QObject::tr( "Authentication SSL Configs" ),
QgsAuthManager::WARNING ); QgsAuthManager::WARNING );
} }

View File

@ -159,7 +159,7 @@ void QgsAuthSslImportDialog::updateEnabledState()
bool connected = mSocket && mSocket->state() == QAbstractSocket::ConnectedState; bool connected = mSocket && mSocket->state() == QAbstractSocket::ConnectedState;
if ( connected && !mSocket->peerName().isEmpty() ) if ( connected && !mSocket->peerName().isEmpty() )
{ {
appendString( tr( "Connected to %1:%2" ).arg( mSocket->peerName() ).arg( mSocket->peerPort() ) ); appendString( tr( "Connected to %1: %2" ).arg( mSocket->peerName() ).arg( mSocket->peerPort() ) );
} }
} }

View File

@ -201,7 +201,7 @@ void QgsValueMapConfigDlg::loadFromCSVButtonPushed()
{ {
QMessageBox::information( nullptr, QMessageBox::information( nullptr,
tr( "Error" ), tr( "Error" ),
tr( "Could not open file %1\nError was:%2" ).arg( fileName, f.errorString() ), tr( "Could not open file %1\nError was: %2" ).arg( fileName, f.errorString() ),
QMessageBox::Cancel ); QMessageBox::Cancel );
return; return;
} }

View File

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

View File

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

View File

@ -304,7 +304,7 @@ bool QgsNewGeoPackageLayerDialog::apply()
hDS.reset( OGR_Dr_CreateDataSource( hGpkgDriver, fileName.toUtf8().constData(), nullptr ) ); hDS.reset( OGR_Dr_CreateDataSource( hGpkgDriver, fileName.toUtf8().constData(), nullptr ) );
if ( !hDS ) if ( !hDS )
{ {
QString msg( tr( "Creation of database failed (OGR error:%1)" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) ); QString msg( tr( "Creation of database failed (OGR error: %1)" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
if ( !property( "hideDialogs" ).toBool() ) if ( !property( "hideDialogs" ).toBool() )
QMessageBox::critical( this, tr( "Layer creation failed" ), msg ); QMessageBox::critical( this, tr( "Layer creation failed" ), msg );
return false; return false;
@ -316,7 +316,7 @@ bool QgsNewGeoPackageLayerDialog::apply()
hDS.reset( OGROpen( fileName.toUtf8().constData(), true, &hDriver ) ); hDS.reset( OGROpen( fileName.toUtf8().constData(), true, &hDriver ) );
if ( !hDS ) if ( !hDS )
{ {
QString msg( tr( "Opening of database failed (OGR error:%1)" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) ); QString msg( tr( "Opening of database failed (OGR error: %1)" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
if ( !property( "hideDialogs" ).toBool() ) if ( !property( "hideDialogs" ).toBool() )
QMessageBox::critical( this, tr( "Layer creation failed" ), msg ); QMessageBox::critical( this, tr( "Layer creation failed" ), msg );
return false; return false;
@ -401,7 +401,7 @@ bool QgsNewGeoPackageLayerDialog::apply()
OSRRelease( hSRS ); OSRRelease( hSRS );
if ( !hLayer ) if ( !hLayer )
{ {
QString msg( tr( "Creation of layer failed (OGR error:%1)" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) ); QString msg( tr( "Creation of layer failed (OGR error: %1)" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
if ( !property( "hideDialogs" ).toBool() ) if ( !property( "hideDialogs" ).toBool() )
QMessageBox::critical( this, tr( "Layer creation failed" ), msg ); QMessageBox::critical( this, tr( "Layer creation failed" ), msg );
return false; return false;
@ -453,7 +453,7 @@ bool QgsNewGeoPackageLayerDialog::apply()
OGR_L_ResetReading( hLayer ); OGR_L_ResetReading( hLayer );
if ( CPLGetLastErrorType() != CE_None ) if ( CPLGetLastErrorType() != CE_None )
{ {
QString msg( tr( "Creation of layer failed (OGR error:%1)" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) ); QString msg( tr( "Creation of layer failed (OGR error: %1)" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
if ( !property( "hideDialogs" ).toBool() ) if ( !property( "hideDialogs" ).toBool() )
QMessageBox::critical( this, tr( "Layer creation failed" ), msg ); QMessageBox::critical( this, tr( "Layer creation failed" ), msg );
return false; return false;

View File

@ -173,7 +173,7 @@ bool QgsNewHttpConnection::validate()
if ( ( mOriginalConnName.isNull() || mOriginalConnName.compare( txtName->text(), Qt::CaseInsensitive ) != 0 ) && if ( ( mOriginalConnName.isNull() || mOriginalConnName.compare( txtName->text(), Qt::CaseInsensitive ) != 0 ) &&
settings.contains( key + "/url" ) && settings.contains( key + "/url" ) &&
QMessageBox::question( this, QMessageBox::question( this,
tr( "Save connection" ), tr( "Save Connection" ),
tr( "Should the existing connection %1 be overwritten?" ).arg( txtName->text() ), tr( "Should the existing connection %1 be overwritten?" ).arg( txtName->text() ),
QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel ) QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
{ {
@ -182,7 +182,7 @@ bool QgsNewHttpConnection::validate()
if ( ! mAuthSettings->password().isEmpty() && if ( ! mAuthSettings->password().isEmpty() &&
QMessageBox::question( this, 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." ), 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 ) QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
{ {

View File

@ -307,7 +307,7 @@ void QgsOWSSourceSelect::mSaveButton_clicked()
void QgsOWSSourceSelect::mLoadButton_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)" ) ); tr( "XML files (*.xml *XML)" ) );
if ( fileName.isEmpty() ) if ( fileName.isEmpty() )
{ {

View File

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

View File

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

View File

@ -194,7 +194,7 @@ void QgsSmartGroupEditorDialog::buttonBox_accepted()
{ {
if ( mNameLineEdit->text().isEmpty() ) if ( mNameLineEdit->text().isEmpty() )
{ {
QMessageBox::critical( this, tr( "Invalid name" ), tr( "The smart group name field is empty. Kindly provide a name" ) ); QMessageBox::critical( this, tr( "Invalid name" ), tr( "The smart group name field is empty. Kindly provide a name." ) );
return; return;
} }
accept(); accept();

View File

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

View File

@ -53,7 +53,7 @@ void QgsGPSDeviceDialog::pbnNewDevice_clicked()
void QgsGPSDeviceDialog::pbnDeleteDevice_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?" ), tr( "Are you sure that you want to delete this device?" ),
QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Ok ) QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Ok )
{ {

View File

@ -82,7 +82,7 @@ void QgsDb2NewConnection::accept()
QgsDebugMsg( QString( "hasAuthConfigID: %1" ).arg( hasAuthConfigID ) ); QgsDebugMsg( QString( "hasAuthConfigID: %1" ).arg( hasAuthConfigID ) );
if ( !hasAuthConfigID && mAuthSettings->storePasswordIsChecked( ) && if ( !hasAuthConfigID && mAuthSettings->storePasswordIsChecked( ) &&
QMessageBox::question( this, 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" ), 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 ) QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
{ {
@ -94,7 +94,7 @@ void QgsDb2NewConnection::accept()
( settings.contains( baseKey + txtName->text() + "/service" ) || ( settings.contains( baseKey + txtName->text() + "/service" ) ||
settings.contains( baseKey + txtName->text() + "/host" ) ) && settings.contains( baseKey + txtName->text() + "/host" ) ) &&
QMessageBox::question( this, QMessageBox::question( this,
tr( "Save connection" ), tr( "Save Connection" ),
tr( "Should the existing connection %1 be overwritten?" ).arg( txtName->text() ), tr( "Should the existing connection %1 be overwritten?" ).arg( txtName->text() ),
QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel ) QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
{ {
@ -176,7 +176,7 @@ bool QgsDb2NewConnection::testConnection()
if ( errMsg.isEmpty() ) if ( errMsg.isEmpty() )
{ {
QgsDebugMsg( "connection open succeeded " + connInfo ); QgsDebugMsg( "connection open succeeded " + connInfo );
bar->pushMessage( tr( "Connection to %1 was successful" ).arg( txtDatabase->text() ), bar->pushMessage( tr( "Connection to %1 was successful." ).arg( txtDatabase->text() ),
QgsMessageBar::INFO ); QgsMessageBar::INFO );
return true; return true;
} }

View File

@ -262,7 +262,7 @@ void QgsDb2SourceSelect::btnSave_clicked()
void QgsDb2SourceSelect::btnLoad_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)" ) ); tr( "XML files (*.xml *XML)" ) );
if ( fileName.isEmpty() ) if ( fileName.isEmpty() )
{ {

View File

@ -755,9 +755,8 @@ void QgsGdalProvider::readBlock( int bandNo, QgsRectangle const &extent, int pi
if ( !myWarpOptions->pTransformerArg ) if ( !myWarpOptions->pTransformerArg )
{ {
QMessageBox::warning( 0, QObject::tr( "Warning" ), QMessageBox::warning( 0, QObject::tr( "Warning" ),
QObject::tr( "Cannot GDALCreateGenImgProjTransformer: " ) QObject::tr( "Cannot GDALCreateGenImgProjTransformer: %1" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ); // missing word?
+ QString::fromUtf8( CPLGetLastErrorMsg() ) ); return;
return;
} }
@ -786,9 +785,8 @@ void QgsGdalProvider::readBlock( int bandNo, QgsRectangle const &extent, int pi
if ( myOperation.Initialize( myWarpOptions ) != CE_None ) if ( myOperation.Initialize( myWarpOptions ) != CE_None )
{ {
QMessageBox::warning( 0, QObject::tr( "Warning" ), QMessageBox::warning( 0, QObject::tr( "Warning" ),
QObject::tr( "Cannot inittialize GDALWarpOperation : " ) QObject::tr( "Cannot initialize GDAL Warp operation : %1" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) );
+ QString::fromUtf8( CPLGetLastErrorMsg() ) ); return;
return;
} }
CPLErrorReset(); CPLErrorReset();
@ -797,7 +795,7 @@ void QgsGdalProvider::readBlock( int bandNo, QgsRectangle const &extent, int pi
if ( myErr != CPLE_None ) if ( myErr != CPLE_None )
{ {
QMessageBox::warning( 0, QObject::tr( "Warning" ), QMessageBox::warning( 0, QObject::tr( "Warning" ),
QObject::tr( "Cannot ChunkAndWarpImage: %1" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) ); QObject::tr( "Cannot chunk and warp image: %1" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
return; return;
} }

View File

@ -91,7 +91,7 @@ void QgsGeoNodeSourceSelect::addConnectionsEntryList()
void QgsGeoNodeSourceSelect::modifyConnectionsEntryList() void QgsGeoNodeSourceSelect::modifyConnectionsEntryList()
{ {
QgsGeoNodeNewConnection nc( this, cmbConnections->currentText() ); QgsGeoNodeNewConnection nc( this, cmbConnections->currentText() );
nc.setWindowTitle( tr( "Modify GeoNode connection" ) ); nc.setWindowTitle( tr( "Modify GeoNode Connection" ) );
if ( nc.exec() ) if ( nc.exec() )
{ {
@ -272,7 +272,7 @@ void QgsGeoNodeSourceSelect::connectToGeonodeConnection()
else else
{ {
QMessageBox::critical( this, tr( "Connect to GeoNode" ), tr( "Cannot get any feature services" ) ); QMessageBox::critical( this, tr( "Connect to GeoNode" ), tr( "Cannot get any feature services." ) );
} }
treeView->resizeColumnToContents( MODEL_IDX_TITLE ); treeView->resizeColumnToContents( MODEL_IDX_TITLE );
@ -300,7 +300,7 @@ void QgsGeoNodeSourceSelect::saveGeonodeConnection()
void QgsGeoNodeSourceSelect::loadGeonodeConnection() 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)" ) ); tr( "XML files (*.xml *.XML)" ) );
if ( fileName.isEmpty() ) if ( fileName.isEmpty() )
{ {

View File

@ -2258,7 +2258,7 @@ QMap<QString, QString> QgsGrass::query( const QString &gisdbase, const QString &
} }
catch ( QgsGrass::Exception &e ) catch ( QgsGrass::Exception &e )
{ {
warning( tr( "Cannot query raster " ) + "\n" + e.what() ); warning( tr( "Cannot query raster\n%1" ).arg( e.what() ) );
} }
return result; return result;
} }
@ -2321,7 +2321,7 @@ bool QgsGrass::deleteObject( const QgsGrassObject &object )
} }
catch ( QgsGrass::Exception &e ) catch ( QgsGrass::Exception &e )
{ {
warning( tr( "Cannot delete" ) + " " + object.elementName() + " " + object.name() + ": " + e.what() ); warning( tr( "Cannot delete %1 %2: %3" ).arg( object.elementName(), object.name(), e.what() ) );
return false; return false;
} }
return true; return true;
@ -2412,7 +2412,7 @@ void QgsGrass::createTable( dbDriver *driver, const QString &tableName, const Qg
db_free_string( &dbstr ); db_free_string( &dbstr );
if ( result != DB_OK ) if ( result != DB_OK )
{ {
throw QgsGrass::Exception( QObject::tr( "Cannot create table" ) + ": " + QString::fromLatin1( db_get_error_msg() ) ); throw QgsGrass::Exception( QObject::tr( "Cannot create table: %1" ).arg( QString::fromLatin1( db_get_error_msg() ) ) );
} }
} }

View File

@ -82,7 +82,7 @@ void QgsMssqlNewConnection::accept()
( settings.contains( baseKey + txtName->text() + "/service" ) || ( settings.contains( baseKey + txtName->text() + "/service" ) ||
settings.contains( baseKey + txtName->text() + "/host" ) ) && settings.contains( baseKey + txtName->text() + "/host" ) ) &&
QMessageBox::question( this, QMessageBox::question( this,
tr( "Save connection" ), tr( "Save Connection" ),
tr( "Should the existing connection %1 be overwritten?" ).arg( txtName->text() ), tr( "Should the existing connection %1 be overwritten?" ).arg( txtName->text() ),
QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel ) QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
{ {
@ -155,7 +155,7 @@ bool QgsMssqlNewConnection::testConnection( const QString &testDatabase )
if ( txtService->text().isEmpty() && txtHost->text().isEmpty() ) if ( txtService->text().isEmpty() && txtHost->text().isEmpty() )
{ {
bar->clearWidgets(); bar->clearWidgets();
bar->pushWarning( tr( "Connection Failed" ), tr( "Host name hasn't been specified" ) ); bar->pushWarning( tr( "Connection Failed" ), tr( "Host name hasn't been specified." ) );
return false; return false;
} }

View File

@ -265,7 +265,7 @@ void QgsMssqlSourceSelect::btnSave_clicked()
void QgsMssqlSourceSelect::btnLoad_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)" ) ); tr( "XML files (*.xml *XML)" ) );
if ( fileName.isEmpty() ) if ( fileName.isEmpty() )
{ {

View File

@ -226,7 +226,7 @@ QStringList QgsOracleConn::pkCandidates( QString ownerName, QString viewName )
if ( !exec( qry, QString( "SELECT column_name FROM all_tab_columns WHERE owner=? AND table_name=? ORDER BY column_id" ), if ( !exec( qry, QString( "SELECT column_name FROM all_tab_columns WHERE owner=? AND table_name=? ORDER BY column_id" ),
QVariantList() << ownerName << viewName ) ) QVariantList() << ownerName << viewName ) )
{ {
QgsMessageLog::logMessage( tr( "SQL:%1 [owner:%2 table_name:%3]\nerror:%4\n" ).arg( qry.lastQuery(), qry.lastError().text(), ownerName, viewName ), tr( "Oracle" ) ); QgsMessageLog::logMessage( tr( "SQL: %1 [owner: %2 table_name: %3]\nerror: %4\n" ).arg( qry.lastQuery(), qry.lastError().text(), ownerName, viewName ), tr( "Oracle" ) );
return cols; return cols;
} }
@ -275,7 +275,7 @@ bool QgsOracleConn::tableInfo( bool geometryColumnsOnly, bool userTablesOnly, bo
QSqlQuery qry( mDatabase ); QSqlQuery qry( mDatabase );
if ( !exec( qry, sql, QVariantList() ) ) if ( !exec( qry, sql, QVariantList() ) )
{ {
QgsMessageLog::logMessage( tr( "Querying available tables failed.\nSQL:%1\nerror:%2\n" ).arg( qry.lastQuery() ).arg( qry.lastError().text() ), tr( "Oracle" ) ); QgsMessageLog::logMessage( tr( "Querying available tables failed.\nSQL: %1\nerror: %2\n" ).arg( qry.lastQuery() ).arg( qry.lastError().text() ), tr( "Oracle" ) );
return false; return false;
} }
@ -484,7 +484,7 @@ void QgsOracleConn::retrieveLayerTypes( QgsOracleLayerProperty &layerProperty, b
.arg( table ) .arg( table )
.arg( where.isEmpty() ? "" : QString( " AND (%1)" ).arg( where ) ), QVariantList() ) ) .arg( where.isEmpty() ? "" : QString( " AND (%1)" ).arg( where ) ), QVariantList() ) )
{ {
QgsMessageLog::logMessage( tr( "SQL:%1\nerror:%2\n" ) QgsMessageLog::logMessage( tr( "SQL: %1\nerror: %2\n" )
.arg( qry.lastQuery() ) .arg( qry.lastQuery() )
.arg( qry.lastError().text() ), .arg( qry.lastError().text() ),
tr( "Oracle" ) ); tr( "Oracle" ) );

View File

@ -264,7 +264,7 @@ bool QgsOracleFeatureIterator::fetchFeature( QgsFeature &feature )
mRewind = false; mRewind = false;
if ( !QgsOracleProvider::exec( mQry, mSql, mArgs ) ) if ( !QgsOracleProvider::exec( mQry, mSql, mArgs ) )
{ {
QgsMessageLog::logMessage( QObject::tr( "Fetching features failed.\nSQL:%1\nError: %2" ) QgsMessageLog::logMessage( QObject::tr( "Fetching features failed.\nSQL: %1\nError: %2" )
.arg( mQry.lastQuery() ) .arg( mQry.lastQuery() )
.arg( mQry.lastError().text() ), .arg( mQry.lastError().text() ),
QObject::tr( "Oracle" ) ); QObject::tr( "Oracle" ) );
@ -498,7 +498,7 @@ bool QgsOracleFeatureIterator::openQuery( QString whereClause, QVariantList args
{ {
if ( showLog ) if ( showLog )
{ {
QgsMessageLog::logMessage( QObject::tr( "Fetching features failed.\nSQL:%1\nError: %2" ) QgsMessageLog::logMessage( QObject::tr( "Fetching features failed.\nSQL: %1\nError: %2" )
.arg( mQry.lastQuery() ) .arg( mQry.lastQuery() )
.arg( mQry.lastError().text() ), .arg( mQry.lastError().text() ),
QObject::tr( "Oracle" ) ); QObject::tr( "Oracle" ) );

View File

@ -92,7 +92,7 @@ void QgsOracleNewConnection::accept()
if ( chkStorePassword->isChecked() && if ( chkStorePassword->isChecked() &&
QMessageBox::question( this, 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" ), 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 ) QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
{ {
@ -104,7 +104,7 @@ void QgsOracleNewConnection::accept()
( settings.contains( baseKey + txtName->text() + "/service" ) || ( settings.contains( baseKey + txtName->text() + "/service" ) ||
settings.contains( baseKey + txtName->text() + "/host" ) ) && settings.contains( baseKey + txtName->text() + "/host" ) ) &&
QMessageBox::question( this, QMessageBox::question( this,
tr( "Save connection" ), tr( "Save Connection" ),
tr( "Should the existing connection %1 be overwritten?" ).arg( txtName->text() ), tr( "Should the existing connection %1 be overwritten?" ).arg( txtName->text() ),
QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel ) QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
{ {
@ -152,7 +152,7 @@ void QgsOracleNewConnection::on_btnConnect_clicked()
if ( conn ) if ( conn )
{ {
// Database successfully opened; we can now issue SQL commands. // Database successfully opened; we can now issue SQL commands.
bar->pushMessage( tr( "Connection to %1 was successful" ).arg( txtDatabase->text() ), bar->pushMessage( tr( "Connection to %1 was successful." ).arg( txtDatabase->text() ),
QgsMessageBar::INFO ); QgsMessageBar::INFO );
// free connection resources // free connection resources
QgsOracleConnPool::instance()->releaseConnection( conn ); QgsOracleConnPool::instance()->releaseConnection( conn );

View File

@ -2459,7 +2459,7 @@ bool QgsOracleProvider::createSpatialIndex()
QVariantList() << r.xMinimum() << r.xMaximum() << r.yMinimum() << r.yMaximum() << mTableName << mGeometryColumn ) QVariantList() << r.xMinimum() << r.xMaximum() << r.yMinimum() << r.yMaximum() << mTableName << mGeometryColumn )
) )
{ {
QgsMessageLog::logMessage( tr( "Could not update metadata for %1.%2.\nSQL:%3\nError: %4" ) QgsMessageLog::logMessage( tr( "Could not update metadata for %1.%2.\nSQL: %3\nError: %4" )
.arg( mTableName ) .arg( mTableName )
.arg( mGeometryColumn ) .arg( mGeometryColumn )
.arg( qry.lastQuery() ) .arg( qry.lastQuery() )
@ -2478,7 +2478,7 @@ bool QgsOracleProvider::createSpatialIndex()
<< r.xMinimum() << r.xMaximum() << r.yMinimum() << r.yMaximum() ) << r.xMinimum() << r.xMaximum() << r.yMinimum() << r.yMaximum() )
) )
{ {
QgsMessageLog::logMessage( tr( "Could not insert metadata for %1.%2.\nSQL:%3\nError: %4" ) QgsMessageLog::logMessage( tr( "Could not insert metadata for %1.%2.\nSQL: %3\nError: %4" )
.arg( quotedValue( mTableName ) ) .arg( quotedValue( mTableName ) )
.arg( quotedValue( mGeometryColumn ) ) .arg( quotedValue( mGeometryColumn ) )
.arg( qry.lastQuery() ) .arg( qry.lastQuery() )
@ -2508,7 +2508,7 @@ bool QgsOracleProvider::createSpatialIndex()
.arg( quotedIdentifier( mTableName ) ) .arg( quotedIdentifier( mTableName ) )
.arg( quotedIdentifier( mGeometryColumn ) ), QVariantList() ) ) .arg( quotedIdentifier( mGeometryColumn ) ), QVariantList() ) )
{ {
QgsMessageLog::logMessage( tr( "Creation spatial index failed.\nSQL:%1\nError: %2" ) QgsMessageLog::logMessage( tr( "Creation spatial index failed.\nSQL: %1\nError: %2" )
.arg( qry.lastQuery() ) .arg( qry.lastQuery() )
.arg( qry.lastError().text() ), .arg( qry.lastError().text() ),
tr( "Oracle" ) ); tr( "Oracle" ) );
@ -2521,7 +2521,7 @@ bool QgsOracleProvider::createSpatialIndex()
{ {
if ( !exec( qry, QString( "ALTER INDEX %1 REBUILD" ).arg( mSpatialIndexName ), QVariantList() ) ) if ( !exec( qry, QString( "ALTER INDEX %1 REBUILD" ).arg( mSpatialIndexName ), QVariantList() ) )
{ {
QgsMessageLog::logMessage( tr( "Rebuild of spatial index failed.\nSQL:%1\nError: %2" ) QgsMessageLog::logMessage( tr( "Rebuild of spatial index failed.\nSQL: %1\nError: %2" )
.arg( qry.lastQuery() ) .arg( qry.lastQuery() )
.arg( qry.lastError().text() ), .arg( qry.lastError().text() ),
tr( "Oracle" ) ); tr( "Oracle" ) );
@ -2819,7 +2819,7 @@ QgsVectorLayerExporter::ExportError QgsOracleProvider::createEmptyLayer(
{ {
if ( !exec( qry, QString( "DROP TABLE %1" ).arg( ownerTableName ), QVariantList() ) ) if ( !exec( qry, QString( "DROP TABLE %1" ).arg( ownerTableName ), QVariantList() ) )
{ {
QgsMessageLog::logMessage( tr( "Drop created table %1 failed.\nSQL:%2\nError: %3" ) QgsMessageLog::logMessage( tr( "Drop created table %1 failed.\nSQL: %2\nError: %3" )
.arg( qry.lastQuery() ) .arg( qry.lastQuery() )
.arg( qry.lastError().text() ), tr( "Oracle" ) ); .arg( qry.lastError().text() ), tr( "Oracle" ) );
} }
@ -2985,7 +2985,7 @@ QgsCoordinateReferenceSystem QgsOracleProvider::crs() const
} }
else else
{ {
QgsMessageLog::logMessage( tr( "Lookup of Oracle SRID %1 failed.\nSQL:%2\nError:%3" ) QgsMessageLog::logMessage( tr( "Lookup of Oracle SRID %1 failed.\nSQL: %2\nError: %3" )
.arg( mSrid ) .arg( mSrid )
.arg( qry.lastQuery() ) .arg( qry.lastQuery() )
.arg( qry.lastError().text() ), .arg( qry.lastError().text() ),

View File

@ -285,7 +285,7 @@ void QgsOracleSourceSelect::on_btnSave_clicked()
void QgsOracleSourceSelect::on_btnLoad_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)" ) ); tr( "XML files (*.xml *XML)" ) );
if ( fileName.isEmpty() ) if ( fileName.isEmpty() )
{ {

View File

@ -114,7 +114,7 @@ void QgsPgNewConnection::accept()
if ( !hasAuthConfigID && mAuthSettings->storePasswordIsChecked( ) && if ( !hasAuthConfigID && mAuthSettings->storePasswordIsChecked( ) &&
QMessageBox::question( this, 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." ), 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 ) QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
{ {
@ -126,7 +126,7 @@ void QgsPgNewConnection::accept()
( settings.contains( baseKey + txtName->text() + "/service" ) || ( settings.contains( baseKey + txtName->text() + "/service" ) ||
settings.contains( baseKey + txtName->text() + "/host" ) ) && settings.contains( baseKey + txtName->text() + "/host" ) ) &&
QMessageBox::question( this, QMessageBox::question( this,
tr( "Save connection" ), tr( "Save Connection" ),
tr( "Should the existing connection %1 be overwritten?" ).arg( txtName->text() ), tr( "Should the existing connection %1 be overwritten?" ).arg( txtName->text() ),
QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel ) QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
{ {
@ -201,7 +201,7 @@ void QgsPgNewConnection::testConnection()
if ( conn ) if ( conn )
{ {
// Database successfully opened; we can now issue SQL commands. // Database successfully opened; we can now issue SQL commands.
bar->pushMessage( tr( "Connection to %1 was successful" ).arg( txtDatabase->text() ), bar->pushMessage( tr( "Connection to %1 was successful." ).arg( txtDatabase->text() ),
QgsMessageBar::INFO ); QgsMessageBar::INFO );
// free pg connection resources // free pg connection resources

View File

@ -320,7 +320,7 @@ void QgsPgSourceSelect::btnSave_clicked()
void QgsPgSourceSelect::btnLoad_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)" ) ); tr( "XML files (*.xml *XML)" ) );
if ( fileName.isEmpty() ) if ( fileName.isEmpty() )
{ {

View File

@ -382,7 +382,7 @@ void QgsPostgresConn::addColumnInfo( QgsPostgresLayerProperty &layerProperty, co
} }
else else
{ {
QgsMessageLog::logMessage( tr( "SQL:%1\nresult:%2\nerror:%3\n" ).arg( sql ).arg( colRes.PQresultStatus() ).arg( colRes.PQresultErrorMessage() ), tr( "PostGIS" ) ); QgsMessageLog::logMessage( tr( "SQL: %1\nresult: %2\nerror: %3\n" ).arg( sql ).arg( colRes.PQresultStatus() ).arg( colRes.PQresultErrorMessage() ), tr( "PostGIS" ) );
} }
} }
@ -1868,7 +1868,7 @@ QString QgsPostgresConn::currentDatabase() const
} }
else else
{ {
QgsMessageLog::logMessage( tr( "SQL:%1\nresult:%2\nerror:%3\n" ).arg( sql ).arg( res.PQresultStatus() ).arg( res.PQresultErrorMessage() ), tr( "PostGIS" ) ); QgsMessageLog::logMessage( tr( "SQL: %1\nresult: %2\nerror: %3\n" ).arg( sql ).arg( res.PQresultStatus() ).arg( res.PQresultErrorMessage() ), tr( "PostGIS" ) );
} }
return database; return database;

View File

@ -148,7 +148,7 @@ void QgsSpatiaLiteSourceSelect::updateStatistics()
subKey.truncate( idx ); subKey.truncate( idx );
QString msg = tr( "Are you sure you want to update the internal statistics for DB: %1?\n\n" QString msg = tr( "Are you sure you want to update the internal statistics for DB: %1?\n\n"
"This could take a long time (depending on the DB size),\n" "This could take a long time (depending on the DB size), "
"but implies better performance thereafter." ).arg( subKey ); "but implies better performance thereafter." ).arg( subKey );
QMessageBox::StandardButton result = QMessageBox::StandardButton result =
QMessageBox::information( this, tr( "Confirm Update Statistics" ), msg, QMessageBox::Ok | QMessageBox::Cancel ); QMessageBox::information( this, tr( "Confirm Update Statistics" ), msg, QMessageBox::Ok | QMessageBox::Cancel );
@ -463,11 +463,11 @@ void QgsSpatiaLiteSourceSelect::btnConnect_clicked()
break; break;
case QgsSpatiaLiteConnection::FailedToCheckMetadata: case QgsSpatiaLiteConnection::FailedToCheckMetadata:
QMessageBox::critical( this, tr( "SpatiaLite metadata check failed" ), QMessageBox::critical( this, tr( "SpatiaLite metadata check failed" ),
tr( "Failure getting table metadata ... is this really a SpatialLite database? %1\n\n%2" ).arg( mSqlitePath, errCause ) ); tr( "Failure getting table metadata... is %1 really a SpatiaLite database?\n\n%2" ).arg( mSqlitePath, errCause ) );
break; break;
default: default:
QMessageBox::critical( this, tr( "SpatiaLite Error" ), QMessageBox::critical( this, tr( "SpatiaLite Error" ),
tr( "Unexpected error when working with: %1\n\n%2" ).arg( mSqlitePath, errCause ) ); tr( "Unexpected error when working with %1\n\n%2" ).arg( mSqlitePath, errCause ) );
} }
mSqlitePath = QString(); mSqlitePath = QString();
return; return;

View File

@ -468,7 +468,7 @@ bool QgsWcsCapabilities::parseCapabilitiesDom( QByteArray const &xml, QgsWcsCapa
{ {
mErrorTitle = tr( "Dom Exception" ); mErrorTitle = tr( "Dom Exception" );
mErrorFormat = QStringLiteral( "text/plain" ); mErrorFormat = QStringLiteral( "text/plain" );
mError = tr( "Could not get WCS capabilities in the expected format (DTD): no %1 found.\nThis might be due to an incorrect WCS Server URL.\nTag:%3\nResponse was:\n%4" ) mError = tr( "Could not get WCS capabilities in the expected format (DTD): no %1 found.\nThis might be due to an incorrect WCS Server URL.\nTag: %3\nResponse was:\n%4" )
.arg( QStringLiteral( "Capabilities" ), .arg( QStringLiteral( "Capabilities" ),
docElem.tagName(), docElem.tagName(),
QString( xml ) ); QString( xml ) );
@ -774,7 +774,7 @@ bool QgsWcsCapabilities::parseDescribeCoverageDom10( QByteArray const &xml, QgsW
{ {
mErrorTitle = tr( "Dom Exception" ); mErrorTitle = tr( "Dom Exception" );
mErrorFormat = QStringLiteral( "text/plain" ); mErrorFormat = QStringLiteral( "text/plain" );
mError = tr( "Could not get WCS capabilities in the expected format (DTD): no %1 found.\nThis might be due to an incorrect WCS Server URL.\nTag:%3\nResponse was:\n%4" ) mError = tr( "Could not get WCS capabilities in the expected format (DTD): no %1 found.\nThis might be due to an incorrect WCS Server URL.\nTag: %3\nResponse was:\n%4" )
.arg( QStringLiteral( "CoverageDescription" ), .arg( QStringLiteral( "CoverageDescription" ),
docElem.tagName(), docElem.tagName(),
QString( xml ) ); QString( xml ) );
@ -930,7 +930,7 @@ bool QgsWcsCapabilities::parseDescribeCoverageDom11( QByteArray const &xml, QgsW
{ {
mErrorTitle = tr( "Dom Exception" ); mErrorTitle = tr( "Dom Exception" );
mErrorFormat = QStringLiteral( "text/plain" ); mErrorFormat = QStringLiteral( "text/plain" );
mError = tr( "Could not get WCS capabilities in the expected format (DTD): no %1 found.\nThis might be due to an incorrect WCS Server URL.\nTag:%3\nResponse was:\n%4" ) mError = tr( "Could not get WCS capabilities in the expected format (DTD): no %1 found.\nThis might be due to an incorrect WCS Server URL.\nTag: %3\nResponse was:\n%4" )
.arg( QStringLiteral( "CoverageDescriptions" ), .arg( QStringLiteral( "CoverageDescriptions" ),
docElem.tagName(), docElem.tagName(),
QString( xml ) ); QString( xml ) );

View File

@ -1704,7 +1704,7 @@ void QgsWcsDownloadHandler::cacheReplyFinished()
{ {
QVariant phrase = mCacheReply->attribute( QNetworkRequest::HttpReasonPhraseAttribute ); QVariant phrase = mCacheReply->attribute( QNetworkRequest::HttpReasonPhraseAttribute );
QgsMessageLog::logMessage( tr( "Map request error (Status: %1; Reason phrase: %2; URL:%3)" ) QgsMessageLog::logMessage( tr( "Map request error (Status: %1; Reason phrase: %2; URL: %3)" )
.arg( status.toInt() ) .arg( status.toInt() )
.arg( phrase.toString(), .arg( phrase.toString(),
mCacheReply->url().toString() ), tr( "WCS" ) ); mCacheReply->url().toString() ), tr( "WCS" ) );
@ -1742,7 +1742,7 @@ void QgsWcsDownloadHandler::cacheReplyFinished()
} }
else else
{ {
QgsMessageLog::logMessage( tr( "Map request error (Status: %1; Response: %2; URL:%3)" ) QgsMessageLog::logMessage( tr( "Map request error (Status: %1; Response: %2; URL: %3)" )
.arg( status.toInt() ) .arg( status.toInt() )
.arg( QString::fromUtf8( text ), .arg( QString::fromUtf8( text ),
mCacheReply->url().toString() ), tr( "WCS" ) ); mCacheReply->url().toString() ), tr( "WCS" ) );
@ -1798,13 +1798,13 @@ void QgsWcsDownloadHandler::cacheReplyFinished()
QString errorTitle, errorText; QString errorTitle, errorText;
if ( QgsWcsProvider::parseServiceExceptionReportDom( body, mWcsVersion, errorTitle, errorText ) ) if ( QgsWcsProvider::parseServiceExceptionReportDom( body, mWcsVersion, errorTitle, errorText ) )
{ {
QgsMessageLog::logMessage( tr( "Map request error (Title:%1; Error:%2; URL: %3)" ) QgsMessageLog::logMessage( tr( "Map request error (Title: %1; Error: %2; URL: %3)" )
.arg( errorTitle, errorText, .arg( errorTitle, errorText,
mCacheReply->url().toString() ), tr( "WCS" ) ); mCacheReply->url().toString() ), tr( "WCS" ) );
} }
else else
{ {
QgsMessageLog::logMessage( tr( "Map request error (Response: %1; URL:%2)" ) QgsMessageLog::logMessage( tr( "Map request error (Response: %1; URL: %2)" )
.arg( QString::fromUtf8( body ), .arg( QString::fromUtf8( body ),
mCacheReply->url().toString() ), tr( "WCS" ) ); mCacheReply->url().toString() ), tr( "WCS" ) );
} }
@ -1877,7 +1877,7 @@ void QgsWcsDownloadHandler::cacheReplyFinished()
sErrors++; sErrors++;
if ( sErrors < 100 ) if ( sErrors < 100 )
{ {
QgsMessageLog::logMessage( tr( "Map request failed [error:%1 url:%2]" ).arg( mCacheReply->errorString(), mCacheReply->url().toString() ), tr( "WCS" ) ); QgsMessageLog::logMessage( tr( "Map request failed [error: %1 url: %2]" ).arg( mCacheReply->errorString(), mCacheReply->url().toString() ), tr( "WCS" ) );
} }
else if ( sErrors == 100 ) else if ( sErrors == 100 )
{ {

View File

@ -512,7 +512,7 @@ bool QgsWFSProvider::processSQL( const QString &sqlString, QString &errorMsg, QS
QgsSQLStatement::Node *column = selectedcolumn->column(); QgsSQLStatement::Node *column = selectedcolumn->column();
if ( column->nodeType() != QgsSQLStatement::ntColumnRef ) if ( column->nodeType() != QgsSQLStatement::ntColumnRef )
{ {
errorMsg = tr( "Column '%1' is not a direct reference to a table column" ).arg( column->dump() ); errorMsg = tr( "Column '%1' is not a direct reference to a table column." ).arg( column->dump() );
return false; return false;
} }
QgsSQLStatement::NodeColumnRef *columnRef = dynamic_cast<QgsSQLStatement::NodeColumnRef *>( column ); QgsSQLStatement::NodeColumnRef *columnRef = dynamic_cast<QgsSQLStatement::NodeColumnRef *>( column );
@ -551,7 +551,7 @@ bool QgsWFSProvider::processSQL( const QString &sqlString, QString &errorMsg, QS
field.setName( fieldName ); field.setName( fieldName );
if ( mapFieldNameToSrcLayerNameFieldName.contains( fieldName ) ) if ( mapFieldNameToSrcLayerNameFieldName.contains( fieldName ) )
{ {
errorMsg = tr( "Field '%1': a field with the same name already exists" ).arg( field.name() ); errorMsg = tr( "Field '%1': a field with the same name already exists." ).arg( field.name() );
return false; return false;
} }
@ -592,7 +592,7 @@ bool QgsWFSProvider::processSQL( const QString &sqlString, QString &errorMsg, QS
{ {
if ( columnTableTypename != mShared->mURI.typeName() ) if ( columnTableTypename != mShared->mURI.typeName() )
{ {
warningMsg = tr( "The geometry field of a typename that is not the main typename is ignored in the selected fields" ); warningMsg = tr( "The geometry field of a typename that is not the main typename is ignored in the selected fields." );
QgsDebugMsg( warningMsg ); QgsDebugMsg( warningMsg );
} }
} }
@ -621,7 +621,7 @@ bool QgsWFSProvider::processSQL( const QString &sqlString, QString &errorMsg, QS
} }
if ( mapFieldNameToSrcLayerNameFieldName.contains( fieldName ) ) if ( mapFieldNameToSrcLayerNameFieldName.contains( fieldName ) )
{ {
errorMsg = tr( "Field '%1': a field with the same name already exists" ).arg( column->dump() ); errorMsg = tr( "Field '%1': a field with the same name already exists." ).arg( column->dump() );
return false; return false;
} }
@ -1263,7 +1263,7 @@ bool QgsWFSProvider::readAttributesFromSchema( QDomDocument &schemaDoc,
} }
if ( foundImport && onlyIncludeOrImport ) if ( foundImport && onlyIncludeOrImport )
{ {
errorMsg = tr( "it is probably a schema for Complex Features" ); errorMsg = tr( "It is probably a schema for Complex Features." );
} }
else else
{ {
@ -1645,19 +1645,19 @@ void QgsWFSProvider::handleException( const QDomDocument &serverResponse )
QDomElement exceptionElem = serverResponse.documentElement(); QDomElement exceptionElem = serverResponse.documentElement();
if ( exceptionElem.isNull() ) if ( exceptionElem.isNull() )
{ {
pushError( tr( "empty response" ) ); pushError( tr( "Empty response" ) );
return; return;
} }
if ( exceptionElem.tagName() == QLatin1String( "ServiceExceptionReport" ) ) if ( exceptionElem.tagName() == QLatin1String( "ServiceExceptionReport" ) )
{ {
pushError( tr( "WFS service exception:%1" ).arg( exceptionElem.firstChildElement( QStringLiteral( "ServiceException" ) ).text() ) ); pushError( tr( "WFS service exception: %1" ).arg( exceptionElem.firstChildElement( QStringLiteral( "ServiceException" ) ).text() ) );
return; return;
} }
if ( exceptionElem.tagName() == QLatin1String( "WFS_TransactionResponse" ) ) if ( exceptionElem.tagName() == QLatin1String( "WFS_TransactionResponse" ) )
{ {
pushError( tr( "unsuccessful service response: %1" ).arg( exceptionElem.firstChildElement( QStringLiteral( "TransactionResult" ) ).firstChildElement( QStringLiteral( "Message" ) ).text() ) ); pushError( tr( "Unsuccessful service response: %1" ).arg( exceptionElem.firstChildElement( QStringLiteral( "TransactionResult" ) ).firstChildElement( QStringLiteral( "Message" ) ).text() ) );
return; return;
} }
@ -1671,7 +1671,7 @@ void QgsWFSProvider::handleException( const QDomDocument &serverResponse )
return; return;
} }
pushError( tr( "unhandled response: %1" ).arg( exceptionElem.tagName() ) ); pushError( tr( "Unhandled response: %1" ).arg( exceptionElem.tagName() ) );
} }
QGISEXTERN QgsWFSProvider *classFactory( const QString *uri ) QGISEXTERN QgsWFSProvider *classFactory( const QString *uri )

View File

@ -708,7 +708,7 @@ void QgsWFSSourceSelect::btnSave_clicked()
void QgsWFSSourceSelect::btnLoad_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)" ) ); tr( "XML files (*.xml *XML)" ) );
if ( fileName.isEmpty() ) if ( fileName.isEmpty() )
{ {

View File

@ -284,7 +284,7 @@ bool QgsWmsCapabilities::parseCapabilitiesDom( QByteArray const &xml, QgsWmsCapa
{ {
mErrorCaption = QObject::tr( "Dom Exception" ); mErrorCaption = QObject::tr( "Dom Exception" );
mErrorFormat = QStringLiteral( "text/plain" ); mErrorFormat = QStringLiteral( "text/plain" );
mError = QObject::tr( "Could not get WMS capabilities in the expected format (DTD): no %1 or %2 found.\nThis might be due to an incorrect WMS Server URL.\nTag:%3\nResponse was:\n%4" ) mError = QObject::tr( "Could not get WMS capabilities in the expected format (DTD): no %1 or %2 found.\nThis might be due to an incorrect WMS Server URL.\nTag: %3\nResponse was:\n%4" )
.arg( QStringLiteral( "WMS_Capabilities" ), .arg( QStringLiteral( "WMS_Capabilities" ),
QStringLiteral( "WMT_MS_Capabilities" ), QStringLiteral( "WMT_MS_Capabilities" ),
docElem.tagName(), docElem.tagName(),

View File

@ -2739,7 +2739,7 @@ QgsRasterIdentifyResult QgsWmsProvider::identify( const QgsPointXY &point, QgsRa
if ( isXml && parseServiceExceptionReportDom( body, mErrorCaption, mError ) ) if ( isXml && parseServiceExceptionReportDom( body, mErrorCaption, mError ) )
{ {
QgsMessageLog::logMessage( tr( "Get feature info request error (Title:%1; Error:%2; URL: %3)" ) QgsMessageLog::logMessage( tr( "Get feature info request error (Title: %1; Error: %2; URL: %3)" )
.arg( mErrorCaption, mError, .arg( mErrorCaption, mError,
requestUrl.toString() ), tr( "WMS" ) ); requestUrl.toString() ), tr( "WMS" ) );
continue; continue;
@ -3601,7 +3601,7 @@ void QgsWmsImageDownloadHandler::cacheReplyFinished()
{ {
QVariant phrase = mCacheReply->attribute( QNetworkRequest::HttpReasonPhraseAttribute ); QVariant phrase = mCacheReply->attribute( QNetworkRequest::HttpReasonPhraseAttribute );
QgsMessageLog::logMessage( tr( "Map request error (Status: %1; Reason phrase: %2; URL:%3)" ) QgsMessageLog::logMessage( tr( "Map request error (Status: %1; Reason phrase: %2; URL: %3)" )
.arg( status.toInt() ) .arg( status.toInt() )
.arg( phrase.toString(), .arg( phrase.toString(),
mCacheReply->url().toString() ), tr( "WMS" ) ); mCacheReply->url().toString() ), tr( "WMS" ) );
@ -3625,7 +3625,7 @@ void QgsWmsImageDownloadHandler::cacheReplyFinished()
else if ( contentType.startsWith( QLatin1String( "image/" ), Qt::CaseInsensitive ) || else if ( contentType.startsWith( QLatin1String( "image/" ), Qt::CaseInsensitive ) ||
contentType.compare( QLatin1String( "application/octet-stream" ), Qt::CaseInsensitive ) == 0 ) contentType.compare( QLatin1String( "application/octet-stream" ), Qt::CaseInsensitive ) == 0 )
{ {
QgsMessageLog::logMessage( tr( "Returned image is flawed [Content-Type:%1; URL:%2]" ) QgsMessageLog::logMessage( tr( "Returned image is flawed [Content-Type: %1; URL: %2]" )
.arg( contentType, mCacheReply->url().toString() ), tr( "WMS" ) ); .arg( contentType, mCacheReply->url().toString() ), tr( "WMS" ) );
} }
else else
@ -3633,13 +3633,13 @@ void QgsWmsImageDownloadHandler::cacheReplyFinished()
QString errorTitle, errorText; QString errorTitle, errorText;
if ( contentType.toLower() == QLatin1String( "text/xml" ) && QgsWmsProvider::parseServiceExceptionReportDom( text, errorTitle, errorText ) ) if ( contentType.toLower() == QLatin1String( "text/xml" ) && QgsWmsProvider::parseServiceExceptionReportDom( text, errorTitle, errorText ) )
{ {
QgsMessageLog::logMessage( tr( "Map request error (Title:%1; Error:%2; URL: %3)" ) QgsMessageLog::logMessage( tr( "Map request error (Title: %1; Error: %2; URL: %3)" )
.arg( errorTitle, errorText, .arg( errorTitle, errorText,
mCacheReply->url().toString() ), tr( "WMS" ) ); mCacheReply->url().toString() ), tr( "WMS" ) );
} }
else else
{ {
QgsMessageLog::logMessage( tr( "Map request error (Status: %1; Response: %2; Content-Type: %3; URL:%4)" ) QgsMessageLog::logMessage( tr( "Map request error (Status: %1; Response: %2; Content-Type: %3; URL: %4)" )
.arg( status.toInt() ) .arg( status.toInt() )
.arg( QString::fromUtf8( text ), .arg( QString::fromUtf8( text ),
contentType, contentType,
@ -3668,7 +3668,7 @@ void QgsWmsImageDownloadHandler::cacheReplyFinished()
stat.errors++; stat.errors++;
if ( stat.errors < 100 ) if ( stat.errors < 100 )
{ {
QgsMessageLog::logMessage( tr( "Map request failed [error:%1 url:%2]" ).arg( mCacheReply->errorString(), mCacheReply->url().toString() ), tr( "WMS" ) ); QgsMessageLog::logMessage( tr( "Map request failed [error: %1 url: %2]" ).arg( mCacheReply->errorString(), mCacheReply->url().toString() ), tr( "WMS" ) );
} }
else if ( stat.errors == 100 ) else if ( stat.errors == 100 )
{ {
@ -3869,13 +3869,13 @@ void QgsWmsTiledImageDownloadHandler::tileReplyFinished()
QString errorTitle, errorText; QString errorTitle, errorText;
if ( contentType.toLower() == QLatin1String( "text/xml" ) && QgsWmsProvider::parseServiceExceptionReportDom( text, errorTitle, errorText ) ) if ( contentType.toLower() == QLatin1String( "text/xml" ) && QgsWmsProvider::parseServiceExceptionReportDom( text, errorTitle, errorText ) )
{ {
QgsMessageLog::logMessage( tr( "Tile request error (Title:%1; Error:%2; URL: %3)" ) QgsMessageLog::logMessage( tr( "Tile request error (Title: %1; Error: %2; URL: %3)" )
.arg( errorTitle, errorText, .arg( errorTitle, errorText,
reply->url().toString() ), tr( "WMS" ) ); reply->url().toString() ), tr( "WMS" ) );
} }
else else
{ {
QgsMessageLog::logMessage( tr( "Tile request error (Status:%1; Content-Type:%2; Length:%3; URL: %4)" ) QgsMessageLog::logMessage( tr( "Tile request error (Status: %1; Content-Type: %2; Length: %3; URL: %4)" )
.arg( status.toString(), .arg( status.toString(),
contentType ) contentType )
.arg( text.size() ) .arg( text.size() )
@ -3936,7 +3936,7 @@ void QgsWmsTiledImageDownloadHandler::tileReplyFinished()
} }
else else
{ {
QgsMessageLog::logMessage( tr( "Returned image is flawed [Content-Type:%1; URL: %2]" ) QgsMessageLog::logMessage( tr( "Returned image is flawed [Content-Type: %1; URL: %2]" )
.arg( contentType, reply->url().toString() ), tr( "WMS" ) ); .arg( contentType, reply->url().toString() ), tr( "WMS" ) );
} }
} }

View File

@ -220,7 +220,7 @@ void QgsWMSSourceSelect::btnSave_clicked()
void QgsWMSSourceSelect::btnLoad_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)" ) ); tr( "XML files (*.xml *XML)" ) );
if ( fileName.isEmpty() ) if ( fileName.isEmpty() )
{ {
@ -402,7 +402,7 @@ bool QgsWMSSourceSelect::populateLayerList( const QgsWmsCapabilities &capabiliti
{ {
QTableWidgetItem *item = lstTilesets->item( row, i ); QTableWidgetItem *item = lstTilesets->item( row, i );
item->setFlags( item->flags() & ~Qt::ItemIsEnabled ); item->setFlags( item->flags() & ~Qt::ItemIsEnabled );
item->setToolTip( tr( "encoding %1 not supported." ).arg( format ) ); item->setToolTip( tr( "Encoding %1 not supported." ).arg( format ) );
} }
} }

View File

@ -942,7 +942,7 @@
<string>Geometry is read as a well known text string from the selected fields</string> <string>Geometry is read as a well known text string from the selected fields</string>
</property> </property>
<property name="text"> <property name="text">
<string>Well known text (WKT) </string> <string>Well known text (WKT)</string>
</property> </property>
</widget> </widget>
</item> </item>