Updating some dialogs caption

This commit is contained in:
Harrissou Sant-anna 2018-02-21 03:17:06 +01:00
parent 585a4d3782
commit ed99ba9d08
23 changed files with 124 additions and 122 deletions

View File

@ -185,6 +185,7 @@ void QgsMapLayerStyleManagerWidget::saveAsDefault()
if ( layer->dataProvider()->isSaveAndLoadStyleToDatabaseSupported() ) if ( layer->dataProvider()->isSaveAndLoadStyleToDatabaseSupported() )
{ {
QMessageBox askToUser; QMessageBox askToUser;
askToUser.setWindowTitle( tr( "Save Style" ) );
askToUser.setText( tr( "Save default style to: " ) ); askToUser.setText( tr( "Save default style to: " ) );
askToUser.setIcon( QMessageBox::Question ); askToUser.setIcon( QMessageBox::Question );
askToUser.addButton( tr( "Cancel" ), QMessageBox::RejectRole ); askToUser.addButton( tr( "Cancel" ), QMessageBox::RejectRole );
@ -227,6 +228,7 @@ void QgsMapLayerStyleManagerWidget::loadDefault()
if ( layer->dataProvider()->isSaveAndLoadStyleToDatabaseSupported() ) if ( layer->dataProvider()->isSaveAndLoadStyleToDatabaseSupported() )
{ {
QMessageBox askToUser; QMessageBox askToUser;
askToUser.setWindowTitle( tr( "Load Style" ) );
askToUser.setText( tr( "Load default style from: " ) ); askToUser.setText( tr( "Load default style from: " ) );
askToUser.setIcon( QMessageBox::Question ); askToUser.setIcon( QMessageBox::Question );
askToUser.addButton( tr( "Cancel" ), QMessageBox::RejectRole ); askToUser.addButton( tr( "Cancel" ), QMessageBox::RejectRole );

View File

@ -79,14 +79,14 @@ void QgsNewAuxiliaryFieldDialog::accept()
const int idx = mLayer->fields().lookupField( fieldName ); const int idx = mLayer->fields().lookupField( fieldName );
if ( idx >= 0 ) if ( idx >= 0 )
{ {
const QString title = tr( "Invalid name" ); const QString title = tr( "New Auxiliary Field" );
const QString msg = tr( "Auxiliary field '%1' already exists" ).arg( fieldName ); const QString msg = tr( "Invalid name. Auxiliary field '%1' already exists." ).arg( fieldName );
QMessageBox::critical( this, title, msg, QMessageBox::Ok ); QMessageBox::critical( this, title, msg, QMessageBox::Ok );
} }
else if ( def.comment().isEmpty() ) else if ( def.comment().isEmpty() )
{ {
const QString title = tr( "Invalid name" ); const QString title = tr( "New Auxiliary Field" );
const QString msg = tr( "Name is a mandatory parameter" ); const QString msg = tr( "Name is a mandatory parameter." );
QMessageBox::critical( this, title, msg, QMessageBox::Ok ); QMessageBox::critical( this, title, msg, QMessageBox::Ok );
} }
else else

View File

@ -198,7 +198,7 @@ void QgsNewGeoPackageLayerDialog::mAddAttributeButton_clicked()
QString myName = mFieldNameEdit->text(); QString myName = mFieldNameEdit->text();
if ( myName == mFeatureIdColumnEdit->text() ) if ( myName == mFeatureIdColumnEdit->text() )
{ {
QMessageBox::critical( this, tr( "Invalid field name" ), tr( "The field cannot have the same name as the feature identifier" ) ); QMessageBox::critical( this, tr( "Add Field" ), tr( "The field cannot have the same name as the feature identifier." ) );
return; return;
} }
@ -259,8 +259,8 @@ bool QgsNewGeoPackageLayerDialog::apply()
{ {
QMessageBox msgBox; QMessageBox msgBox;
msgBox.setIcon( QMessageBox::Question ); msgBox.setIcon( QMessageBox::Question );
msgBox.setWindowTitle( tr( "The File Already Exists." ) ); msgBox.setWindowTitle( tr( "New GeoPackage Layer" ) );
msgBox.setText( tr( "Do you want to overwrite the existing file with a new database or add a new layer to it?" ) ); msgBox.setText( tr( "The File already exists. Do you want to overwrite the existing file with a new database or add a new layer to it?" ) );
QPushButton *overwriteButton = msgBox.addButton( tr( "Overwrite" ), QMessageBox::ActionRole ); QPushButton *overwriteButton = msgBox.addButton( tr( "Overwrite" ), QMessageBox::ActionRole );
QPushButton *addNewLayerButton = msgBox.addButton( tr( "Add new layer" ), QMessageBox::ActionRole ); QPushButton *addNewLayerButton = msgBox.addButton( tr( "Add new layer" ), QMessageBox::ActionRole );
msgBox.setStandardButtons( QMessageBox::Cancel ); msgBox.setStandardButtons( QMessageBox::Cancel );
@ -311,8 +311,8 @@ bool QgsNewGeoPackageLayerDialog::apply()
if ( !hGpkgDriver ) if ( !hGpkgDriver )
{ {
if ( !property( "hideDialogs" ).toBool() ) if ( !property( "hideDialogs" ).toBool() )
QMessageBox::critical( this, tr( "Layer creation failed" ), QMessageBox::critical( this, tr( "New GeoPackage Layer" ),
tr( "GeoPackage driver not found" ) ); tr( "Layer creation failed. GeoPackage driver not found." ) );
return false; return false;
} }
@ -324,7 +324,7 @@ bool QgsNewGeoPackageLayerDialog::apply()
{ {
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( "New GeoPackage Layer" ), msg );
return false; return false;
} }
} }
@ -336,14 +336,14 @@ bool QgsNewGeoPackageLayerDialog::apply()
{ {
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( "New GeoPackage Layer" ), msg );
return false; return false;
} }
if ( hDriver != hGpkgDriver ) if ( hDriver != hGpkgDriver )
{ {
QString msg( tr( "Opening of file succeeded, but this is not a GeoPackage database" ) ); QString msg( tr( "Opening of file succeeded, but this is not a GeoPackage database." ) );
if ( !property( "hideDialogs" ).toBool() ) if ( !property( "hideDialogs" ).toBool() )
QMessageBox::critical( this, tr( "Layer creation failed" ), msg ); QMessageBox::critical( this, tr( "New GeoPackage Layer" ), msg );
return false; return false;
} }
} }
@ -357,7 +357,7 @@ bool QgsNewGeoPackageLayerDialog::apply()
{ {
overwriteTable = property( "question_existing_layer_answer_overwrite" ).toBool(); overwriteTable = property( "question_existing_layer_answer_overwrite" ).toBool();
} }
else if ( QMessageBox::question( this, tr( "Existing layer" ), else if ( QMessageBox::question( this, tr( "New GeoPackage Layer" ),
tr( "A table with the same name already exists. Do you want to overwrite it?" ), tr( "A table with the same name already exists. Do you want to overwrite it?" ),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) == QMessageBox::Yes ) QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) == QMessageBox::Yes )
{ {
@ -421,7 +421,7 @@ bool QgsNewGeoPackageLayerDialog::apply()
{ {
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( "New GeoPackage Layer" ), msg );
return false; return false;
} }
@ -455,7 +455,7 @@ bool QgsNewGeoPackageLayerDialog::apply()
{ {
if ( !property( "hideDialogs" ).toBool() ) if ( !property( "hideDialogs" ).toBool() )
{ {
QMessageBox::critical( this, tr( "Layer creation failed" ), QMessageBox::critical( this, tr( "New GeoPackage Layer" ),
tr( "Creation of field %1 failed (OGR error: %2)" ) tr( "Creation of field %1 failed (OGR error: %2)" )
.arg( fieldName, QString::fromUtf8( CPLGetLastErrorMsg() ) ) ); .arg( fieldName, QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
} }
@ -473,7 +473,7 @@ bool QgsNewGeoPackageLayerDialog::apply()
{ {
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( "New GeoPackage Layer" ), msg );
return false; return false;
} }
hDS.reset(); hDS.reset();
@ -494,7 +494,7 @@ bool QgsNewGeoPackageLayerDialog::apply()
else else
{ {
if ( !property( "hideDialogs" ).toBool() ) if ( !property( "hideDialogs" ).toBool() )
QMessageBox::critical( this, tr( "Invalid Layer" ), tr( "%1 is an invalid layer and cannot be loaded." ).arg( tableName ) ); QMessageBox::critical( this, tr( "New GeoPackage Layer" ), tr( "%1 is an invalid layer and cannot be loaded." ).arg( tableName ) );
delete layer; delete layer;
} }

View File

@ -393,7 +393,7 @@ void QgsOptionsDialogBase::optionsStackedWidget_WidgetRemoved( int index )
void QgsOptionsDialogBase::warnAboutMissingObjects() void QgsOptionsDialogBase::warnAboutMissingObjects()
{ {
QMessageBox::warning( nullptr, tr( "Missing objects" ), QMessageBox::warning( nullptr, tr( "Missing Objects" ),
tr( "Base options dialog could not be initialized.\n\n" tr( "Base options dialog could not be initialized.\n\n"
"Missing some of the .ui template objects:\n" ) "Missing some of the .ui template objects:\n" )
+ " mOptionsListWidget,\n mOptionsStackedWidget,\n mOptionsSplitter,\n mOptionsListFrame", + " mOptionsListWidget,\n mOptionsStackedWidget,\n mOptionsSplitter,\n mOptionsListFrame",

View File

@ -289,7 +289,7 @@ void QgsOWSSourceSelect::mDeleteButton_clicked()
{ {
QString msg = tr( "Are you sure you want to remove the %1 connection and all associated settings?" ) QString msg = tr( "Are you sure you want to remove the %1 connection and all associated settings?" )
.arg( mConnectionsComboBox->currentText() ); .arg( mConnectionsComboBox->currentText() );
QMessageBox::StandardButton result = QMessageBox::question( this, tr( "Confirm Delete" ), msg, QMessageBox::Yes | QMessageBox::No ); QMessageBox::StandardButton result = QMessageBox::question( this, tr( "Delete Connection" ), msg, QMessageBox::Yes | QMessageBox::No );
if ( result == QMessageBox::Yes ) if ( result == QMessageBox::Yes )
{ {
QgsOwsConnection::deleteConnection( mService, mConnectionsComboBox->currentText() ); QgsOwsConnection::deleteConnection( mService, mConnectionsComboBox->currentText() );
@ -631,9 +631,9 @@ void QgsOWSSourceSelect::addDefaultServers()
settings.endGroup(); settings.endGroup();
populateConnectionList(); populateConnectionList();
QMessageBox::information( this, tr( "WMS proxies" ), "<p>" + tr( "Several WMS servers have " QMessageBox::information( this, tr( "Add WMS Servers" ), "<p>" + tr( "Several WMS servers have "
"been added to the server list. Note that if " "been added to the server list. Note that if "
"you access the internet via a web proxy, you will " "you access the Internet via a web proxy, you will "
"need to set the proxy settings in the QGIS options dialog." ) + "</p>" ); "need to set the proxy settings in the QGIS options dialog." ) + "</p>" );
} }

View File

@ -233,7 +233,7 @@ void QgsQueryBuilder::test()
else if ( mLayer->dataProvider()->hasErrors() ) else if ( mLayer->dataProvider()->hasErrors() )
{ {
QMessageBox::warning( this, QMessageBox::warning( this,
tr( "Query Failed" ), tr( "Query Result" ),
tr( "An error occurred when executing the query." ) tr( "An error occurred when executing the query." )
+ tr( "\nThe data provider said:\n%1" ).arg( mLayer->dataProvider()->errors().join( QStringLiteral( "\n" ) ) ) ); + tr( "\nThe data provider said:\n%1" ).arg( mLayer->dataProvider()->errors().join( QStringLiteral( "\n" ) ) ) );
mLayer->dataProvider()->clearErrors(); mLayer->dataProvider()->clearErrors();
@ -241,7 +241,7 @@ void QgsQueryBuilder::test()
else else
{ {
QMessageBox::warning( this, QMessageBox::warning( this,
tr( "Query Failed" ), tr( "Query Result" ),
tr( "An error occurred when executing the query." ) ); tr( "An error occurred when executing the query." ) );
} }
} }
@ -254,14 +254,14 @@ void QgsQueryBuilder::accept()
if ( mLayer->dataProvider()->hasErrors() ) if ( mLayer->dataProvider()->hasErrors() )
{ {
QMessageBox::warning( this, QMessageBox::warning( this,
tr( "Query Failed" ), tr( "Query Result" ),
tr( "An error occurred when executing the query." ) tr( "An error occurred when executing the query." )
+ tr( "\nThe data provider said:\n%1" ).arg( mLayer->dataProvider()->errors().join( QStringLiteral( "\n" ) ) ) ); + tr( "\nThe data provider said:\n%1" ).arg( mLayer->dataProvider()->errors().join( QStringLiteral( "\n" ) ) ) );
mLayer->dataProvider()->clearErrors(); mLayer->dataProvider()->clearErrors();
} }
else else
{ {
QMessageBox::warning( this, tr( "Error in Query" ), tr( "The subset string could not be set" ) ); QMessageBox::warning( this, tr( "Query Result" ), tr( "Error in query. The subset string could not be set." ) );
} }
return; return;

View File

@ -378,7 +378,7 @@ QString QgsRasterFormatSaveOptionsWidget::validateOptions( bool gui, bool report
} }
else if ( ! createOptions.isEmpty() ) else if ( ! createOptions.isEmpty() )
{ {
QMessageBox::information( this, QLatin1String( "" ), tr( "Cannot validate creation options" ), QMessageBox::Close ); QMessageBox::information( this, QLatin1String( "" ), tr( "Cannot validate creation options." ), QMessageBox::Close );
if ( tmpLayer ) if ( tmpLayer )
delete rasterLayer; delete rasterLayer;
return QString(); return QString();

View File

@ -197,7 +197,7 @@ QgsRasterLayerSaveAsDialog::QgsRasterLayerSaveAsDialog( QgsRasterLayer *rasterLa
if ( files.isEmpty() ) if ( files.isEmpty() )
break; break;
if ( QMessageBox::warning( this, tr( "Warning" ), if ( QMessageBox::warning( this, tr( "Save Raster Layer" ),
tr( "The directory %1 contains files which will be overwritten: %2" ).arg( dir.absolutePath(), files.join( QStringLiteral( ", " ) ) ), tr( "The directory %1 contains files which will be overwritten: %2" ).arg( dir.absolutePath(), files.join( QStringLiteral( ", " ) ) ),
QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Ok ) QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Ok )
break; break;

View File

@ -195,7 +195,7 @@ void QgsSearchQueryBuilder::btnTest_clicked()
if ( count == -1 ) if ( count == -1 )
return; return;
QMessageBox::information( this, tr( "Search results" ), tr( "Found %n matching feature(s).", "test result", count ) ); QMessageBox::information( this, tr( "Test Query" ), tr( "Found %n matching feature(s).", "test result", count ) );
} }
// This method tests the number of records that would be returned // This method tests the number of records that would be returned
@ -204,7 +204,7 @@ long QgsSearchQueryBuilder::countRecords( const QString &searchString )
QgsExpression search( searchString ); QgsExpression search( searchString );
if ( search.hasParserError() ) if ( search.hasParserError() )
{ {
QMessageBox::critical( this, tr( "Search string parsing error" ), search.parserErrorString() ); QMessageBox::critical( this, tr( "Query Result" ), search.parserErrorString() );
return -1; return -1;
} }
@ -220,7 +220,7 @@ long QgsSearchQueryBuilder::countRecords( const QString &searchString )
if ( !search.prepare( &context ) ) if ( !search.prepare( &context ) )
{ {
QMessageBox::critical( this, tr( "Evaluation error" ), search.evalErrorString() ); QMessageBox::critical( this, tr( "Query Result" ), search.evalErrorString() );
return -1; return -1;
} }
@ -237,7 +237,7 @@ long QgsSearchQueryBuilder::countRecords( const QString &searchString )
count++; count++;
} }
// check if there were errors during evaulating // check if there were errors during evaluating
if ( search.hasEvalError() ) if ( search.hasEvalError() )
break; break;
} }
@ -246,7 +246,7 @@ long QgsSearchQueryBuilder::countRecords( const QString &searchString )
if ( search.hasEvalError() ) if ( search.hasEvalError() )
{ {
QMessageBox::critical( this, tr( "Error during search" ), search.evalErrorString() ); QMessageBox::critical( this, tr( "Query Result" ), search.evalErrorString() );
return -1; return -1;
} }
@ -271,7 +271,7 @@ void QgsSearchQueryBuilder::btnOk_clicked()
} }
else if ( numRecs == 0 ) else if ( numRecs == 0 )
{ {
QMessageBox::warning( this, tr( "No Records" ), tr( "The query you specified results in zero records being returned." ) ); QMessageBox::warning( this, tr( "Query Result" ), tr( "The query you specified results in zero records being returned." ) );
} }
else else
{ {
@ -380,7 +380,7 @@ void QgsSearchQueryBuilder::saveQuery()
QgsSettings s; QgsSettings s;
QString lastQueryFileDir = s.value( QStringLiteral( "/UI/lastQueryFileDir" ), QDir::homePath() ).toString(); QString lastQueryFileDir = s.value( QStringLiteral( "/UI/lastQueryFileDir" ), QDir::homePath() ).toString();
//save as qqt (QGIS query file) //save as qqt (QGIS query file)
QString saveFileName = QFileDialog::getSaveFileName( nullptr, tr( "Save query to file" ), lastQueryFileDir, QStringLiteral( "*.qqf" ) ); QString saveFileName = QFileDialog::getSaveFileName( nullptr, tr( "Save Query to File" ), lastQueryFileDir, QStringLiteral( "*.qqf" ) );
if ( saveFileName.isNull() ) if ( saveFileName.isNull() )
{ {
return; return;
@ -394,7 +394,7 @@ void QgsSearchQueryBuilder::saveQuery()
QFile saveFile( saveFileName ); QFile saveFile( saveFileName );
if ( !saveFile.open( QIODevice::WriteOnly | QIODevice::Truncate ) ) if ( !saveFile.open( QIODevice::WriteOnly | QIODevice::Truncate ) )
{ {
QMessageBox::critical( nullptr, tr( "Error" ), tr( "Could not open file for writing" ) ); QMessageBox::critical( nullptr, tr( "Save Query to File" ), tr( "Could not open file for writing." ) );
return; return;
} }
@ -416,7 +416,7 @@ void QgsSearchQueryBuilder::loadQuery()
QgsSettings s; QgsSettings s;
QString lastQueryFileDir = s.value( QStringLiteral( "/UI/lastQueryFileDir" ), QDir::homePath() ).toString(); QString lastQueryFileDir = s.value( QStringLiteral( "/UI/lastQueryFileDir" ), QDir::homePath() ).toString();
QString queryFileName = QFileDialog::getOpenFileName( nullptr, tr( "Load query from file" ), lastQueryFileDir, tr( "Query files" ) + " (*.qqf);;" + tr( "All files" ) + " (*)" ); QString queryFileName = QFileDialog::getOpenFileName( nullptr, tr( "Load Query from File" ), lastQueryFileDir, tr( "Query files" ) + " (*.qqf);;" + tr( "All files" ) + " (*)" );
if ( queryFileName.isNull() ) if ( queryFileName.isNull() )
{ {
return; return;
@ -425,20 +425,20 @@ void QgsSearchQueryBuilder::loadQuery()
QFile queryFile( queryFileName ); QFile queryFile( queryFileName );
if ( !queryFile.open( QIODevice::ReadOnly ) ) if ( !queryFile.open( QIODevice::ReadOnly ) )
{ {
QMessageBox::critical( nullptr, tr( "Error" ), tr( "Could not open file for reading" ) ); QMessageBox::critical( nullptr, tr( "Load Query from File" ), tr( "Could not open file for reading." ) );
return; return;
} }
QDomDocument queryDoc; QDomDocument queryDoc;
if ( !queryDoc.setContent( &queryFile ) ) if ( !queryDoc.setContent( &queryFile ) )
{ {
QMessageBox::critical( nullptr, tr( "Error" ), tr( "File is not a valid xml document" ) ); QMessageBox::critical( nullptr, tr( "Load Query from File" ), tr( "File is not a valid xml document." ) );
return; return;
} }
QDomElement queryElem = queryDoc.firstChildElement( QStringLiteral( "Query" ) ); QDomElement queryElem = queryDoc.firstChildElement( QStringLiteral( "Query" ) );
if ( queryElem.isNull() ) if ( queryElem.isNull() )
{ {
QMessageBox::critical( nullptr, tr( "Error" ), tr( "File is not a valid query document" ) ); QMessageBox::critical( nullptr, tr( "Load Query from File" ), tr( "File is not a valid query document." ) );
return; return;
} }
@ -448,7 +448,7 @@ void QgsSearchQueryBuilder::loadQuery()
QgsExpression search( query ); QgsExpression search( query );
if ( search.hasParserError() ) if ( search.hasParserError() )
{ {
QMessageBox::critical( this, tr( "Search string parsing error" ), search.parserErrorString() ); QMessageBox::critical( this, tr( "Query Result" ), search.parserErrorString() );
return; return;
} }
@ -476,7 +476,7 @@ void QgsSearchQueryBuilder::loadQuery()
if ( !mFieldMap.contains( attIt ) ) if ( !mFieldMap.contains( attIt ) )
{ {
bool ok; bool ok;
QString replaceAttribute = QInputDialog::getItem( 0, tr( "Select attribute" ), tr( "There is no attribute '%1' in the current vector layer. Please select an existing attribute" ).arg( *attIt ), QString replaceAttribute = QInputDialog::getItem( 0, tr( "Select Attribute" ), tr( "There is no attribute '%1' in the current vector layer. Please select an existing attribute." ).arg( *attIt ),
existingAttributes, 0, false, &ok ); existingAttributes, 0, false, &ok );
if ( !ok || replaceAttribute.isEmpty() ) if ( !ok || replaceAttribute.isEmpty() )
{ {

View File

@ -213,12 +213,12 @@ void QgsSQLComposerDialog::accept()
{ {
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 Evaluation" ), errorMsg );
return; return;
} }
if ( !warningMsg.isEmpty() ) if ( !warningMsg.isEmpty() )
{ {
QMessageBox::warning( this, tr( "SQL Warning" ), warningMsg ); QMessageBox::warning( this, tr( "SQL Evaluation" ), warningMsg );
} }
} }
QDialog::accept(); QDialog::accept();

View File

@ -90,7 +90,7 @@ void QgsSubstitutionListWidget::tableChanged()
void QgsSubstitutionListWidget::mButtonExport_clicked() void QgsSubstitutionListWidget::mButtonExport_clicked()
{ {
QString fileName = QFileDialog::getSaveFileName( this, tr( "Save substitutions" ), QDir::homePath(), QString fileName = QFileDialog::getSaveFileName( this, tr( "Save Substitutions" ), QDir::homePath(),
tr( "XML files (*.xml *.XML)" ) ); tr( "XML files (*.xml *.XML)" ) );
if ( fileName.isEmpty() ) if ( fileName.isEmpty() )
{ {
@ -113,8 +113,8 @@ void QgsSubstitutionListWidget::mButtonExport_clicked()
QFile file( fileName ); QFile file( fileName );
if ( !file.open( QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate ) ) if ( !file.open( QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate ) )
{ {
QMessageBox::warning( nullptr, tr( "Export substitutions" ), QMessageBox::warning( nullptr, tr( "Export Substitutions" ),
tr( "Cannot write file %1:\n%2." ).arg( fileName, file.errorString() ), tr( "Cannot write file %1:\n%2" ).arg( fileName, file.errorString() ),
QMessageBox::Ok, QMessageBox::Ok,
QMessageBox::Ok ); QMessageBox::Ok );
return; return;
@ -126,7 +126,7 @@ void QgsSubstitutionListWidget::mButtonExport_clicked()
void QgsSubstitutionListWidget::mButtonImport_clicked() void QgsSubstitutionListWidget::mButtonImport_clicked()
{ {
QString fileName = QFileDialog::getOpenFileName( this, tr( "Load substitutions" ), QDir::homePath(), QString fileName = QFileDialog::getOpenFileName( this, tr( "Load Substitutions" ), QDir::homePath(),
tr( "XML files (*.xml *.XML)" ) ); tr( "XML files (*.xml *.XML)" ) );
if ( fileName.isEmpty() ) if ( fileName.isEmpty() )
{ {
@ -136,8 +136,8 @@ void QgsSubstitutionListWidget::mButtonImport_clicked()
QFile file( fileName ); QFile file( fileName );
if ( !file.open( QIODevice::ReadOnly | QIODevice::Text ) ) if ( !file.open( QIODevice::ReadOnly | QIODevice::Text ) )
{ {
QMessageBox::warning( nullptr, tr( "Import substitutions" ), QMessageBox::warning( nullptr, tr( "Import Substitutions" ),
tr( "Cannot read file %1:\n%2." ).arg( fileName, file.errorString() ), tr( "Cannot read file %1:\n%2" ).arg( fileName, file.errorString() ),
QMessageBox::Ok, QMessageBox::Ok,
QMessageBox::Ok ); QMessageBox::Ok );
return; return;
@ -163,7 +163,7 @@ void QgsSubstitutionListWidget::mButtonImport_clicked()
QDomElement root = doc.documentElement(); QDomElement root = doc.documentElement();
if ( root.tagName() != QLatin1String( "substitutions" ) ) if ( root.tagName() != QLatin1String( "substitutions" ) )
{ {
QMessageBox::warning( nullptr, tr( "Import substitutions" ), QMessageBox::warning( nullptr, tr( "Import Substitutions" ),
tr( "The selected file is not a substitution list." ), tr( "The selected file is not a substitution list." ),
QMessageBox::Ok, QMessageBox::Ok,
QMessageBox::Ok ); QMessageBox::Ok );

View File

@ -728,7 +728,7 @@ void VariableEditorDelegate::setModelData( QWidget *widget, QAbstractItemModel *
if ( scope->hasVariable( newName ) ) if ( scope->hasVariable( newName ) )
{ {
//existing name //existing name
QMessageBox::warning( mParentTree, tr( "Rename variable" ), tr( "A variable with the name \"%1\" already exists in this context." ).arg( newName ) ); QMessageBox::warning( mParentTree, tr( "Rename Variable" ), tr( "A variable with the name \"%1\" already exists in this context." ).arg( newName ) );
newName.append( "_1" ); newName.append( "_1" );
} }

View File

@ -350,7 +350,7 @@ void QgsPalettedRendererWidget::loadColorTable()
{ {
QgsSettings settings; QgsSettings settings;
QString lastDir = settings.value( QStringLiteral( "lastColorMapDir" ), QDir::homePath() ).toString(); QString lastDir = settings.value( QStringLiteral( "lastColorMapDir" ), QDir::homePath() ).toString();
QString fileName = QFileDialog::getOpenFileName( this, tr( "Open file" ), lastDir ); QString fileName = QFileDialog::getOpenFileName( this, tr( "Load Color Table from File" ), lastDir );
if ( !fileName.isEmpty() ) if ( !fileName.isEmpty() )
{ {
QgsPalettedRasterRenderer::ClassData classes = QgsPalettedRasterRenderer::classDataFromFile( fileName ); QgsPalettedRasterRenderer::ClassData classes = QgsPalettedRasterRenderer::classDataFromFile( fileName );
@ -363,7 +363,7 @@ void QgsPalettedRendererWidget::loadColorTable()
} }
else else
{ {
QMessageBox::critical( nullptr, tr( "Invalid file" ), tr( "Could not interpret file as a raster color table." ) ); QMessageBox::critical( nullptr, tr( "Load Color Table" ), tr( "Could not interpret file as a raster color table." ) );
} }
} }
} }
@ -372,7 +372,7 @@ void QgsPalettedRendererWidget::saveColorTable()
{ {
QgsSettings settings; QgsSettings settings;
QString lastDir = settings.value( QStringLiteral( "lastColorMapDir" ), QDir::homePath() ).toString(); QString lastDir = settings.value( QStringLiteral( "lastColorMapDir" ), QDir::homePath() ).toString();
QString fileName = QFileDialog::getSaveFileName( this, tr( "Save file" ), lastDir, tr( "Text (*.clr)" ) ); QString fileName = QFileDialog::getSaveFileName( this, tr( "Save Color Table as File" ), lastDir, tr( "Text (*.clr)" ) );
if ( !fileName.isEmpty() ) if ( !fileName.isEmpty() )
{ {
if ( !fileName.endsWith( QLatin1String( ".clr" ), Qt::CaseInsensitive ) ) if ( !fileName.endsWith( QLatin1String( ".clr" ), Qt::CaseInsensitive ) )
@ -393,7 +393,7 @@ void QgsPalettedRendererWidget::saveColorTable()
} }
else else
{ {
QMessageBox::warning( this, tr( "Write access denied" ), tr( "Write access denied. Adjust the file permissions and try again.\n\n" ) ); QMessageBox::warning( this, tr( "Save Color Table as File" ), tr( "Write access denied. Adjust the file permissions and try again.\n\n" ) );
} }
} }
} }
@ -454,7 +454,7 @@ void QgsPalettedRendererWidget::bandChanged( int band )
if ( !mModel->classData().isEmpty() ) if ( !mModel->classData().isEmpty() )
{ {
int res = QMessageBox::question( this, int res = QMessageBox::question( this,
tr( "Confirm Delete" ), tr( "Delete Classification" ),
tr( "The classification band was changed from %1 to %2.\n" tr( "The classification band was changed from %1 to %2.\n"
"Should the existing classes be deleted?" ).arg( mBand ).arg( band ), "Should the existing classes be deleted?" ).arg( mBand ).arg( band ),
QMessageBox::Yes | QMessageBox::No ); QMessageBox::Yes | QMessageBox::No );

View File

@ -222,7 +222,7 @@ void QgsRasterTransparencyWidget::pbnExportTransparentPixelValues_clicked()
{ {
QgsSettings myQSettings; QgsSettings myQSettings;
QString myLastDir = myQSettings.value( QStringLiteral( "lastRasterFileFilterDir" ), QDir::homePath() ).toString(); QString myLastDir = myQSettings.value( QStringLiteral( "lastRasterFileFilterDir" ), QDir::homePath() ).toString();
QString myFileName = QFileDialog::getSaveFileName( this, tr( "Save file" ), myLastDir, tr( "Textfile" ) + " (*.txt)" ); QString myFileName = QFileDialog::getSaveFileName( this, tr( "Save Pixel Values as File" ), myLastDir, tr( "Textfile" ) + " (*.txt)" );
if ( !myFileName.isEmpty() ) if ( !myFileName.isEmpty() )
{ {
if ( !myFileName.endsWith( QLatin1String( ".txt" ), Qt::CaseInsensitive ) ) if ( !myFileName.endsWith( QLatin1String( ".txt" ), Qt::CaseInsensitive ) )
@ -260,7 +260,7 @@ void QgsRasterTransparencyWidget::pbnExportTransparentPixelValues_clicked()
} }
else else
{ {
QMessageBox::warning( this, tr( "Write access denied" ), tr( "Write access denied. Adjust the file permissions and try again.\n\n" ) ); QMessageBox::warning( this, tr( "Save Pixel Values as File" ), tr( "Write access denied. Adjust the file permissions and try again.\n\n" ) );
} }
} }
} }
@ -272,7 +272,7 @@ void QgsRasterTransparencyWidget::pbnImportTransparentPixelValues_clicked()
QString myBadLines; QString myBadLines;
QgsSettings myQSettings; QgsSettings myQSettings;
QString myLastDir = myQSettings.value( QStringLiteral( "lastRasterFileFilterDir" ), QDir::homePath() ).toString(); QString myLastDir = myQSettings.value( QStringLiteral( "lastRasterFileFilterDir" ), QDir::homePath() ).toString();
QString myFileName = QFileDialog::getOpenFileName( this, tr( "Open file" ), myLastDir, tr( "Textfile" ) + " (*.txt)" ); QString myFileName = QFileDialog::getOpenFileName( this, tr( "Load Pixel Values from File" ), myLastDir, tr( "Textfile" ) + " (*.txt)" );
QFile myInputFile( myFileName ); QFile myInputFile( myFileName );
if ( myInputFile.open( QFile::ReadOnly ) ) if ( myInputFile.open( QFile::ReadOnly ) )
{ {
@ -351,12 +351,12 @@ void QgsRasterTransparencyWidget::pbnImportTransparentPixelValues_clicked()
if ( myImportError ) if ( myImportError )
{ {
QMessageBox::warning( this, tr( "Import Error" ), tr( "The following lines contained errors\n\n%1" ).arg( myBadLines ) ); QMessageBox::warning( this, tr( "Load Pixel Values from File" ), tr( "The following lines contained errors\n\n%1" ).arg( myBadLines ) );
} }
} }
else if ( !myFileName.isEmpty() ) else if ( !myFileName.isEmpty() )
{ {
QMessageBox::warning( this, tr( "Read access denied" ), tr( "Read access denied. Adjust the file permissions and try again.\n\n" ) ); QMessageBox::warning( this, tr( "Load Pixel Values from File" ), tr( "Read access denied. Adjust the file permissions and try again.\n\n" ) );
} }
tableTransparency->resizeColumnsToContents(); tableTransparency->resizeColumnsToContents();
tableTransparency->resizeRowsToContents(); tableTransparency->resizeRowsToContents();

View File

@ -449,7 +449,7 @@ void QgsSingleBandPseudoColorRendererWidget::mLoadFromBandButton_clicked()
} }
else else
{ {
QMessageBox::warning( this, tr( "Load Color Map" ), tr( "The color map for band %1 has no entries" ).arg( bandIndex ) ); QMessageBox::warning( this, tr( "Load Color Map" ), tr( "The color map for band %1 has no entries." ).arg( bandIndex ) );
} }
loadMinMaxFromTree(); loadMinMaxFromTree();
@ -463,7 +463,7 @@ void QgsSingleBandPseudoColorRendererWidget::mLoadFromFileButton_clicked()
QString badLines; QString badLines;
QgsSettings settings; QgsSettings settings;
QString lastDir = settings.value( QStringLiteral( "lastColorMapDir" ), QDir::homePath() ).toString(); QString lastDir = settings.value( QStringLiteral( "lastColorMapDir" ), QDir::homePath() ).toString();
QString fileName = QFileDialog::getOpenFileName( this, tr( "Open file" ), lastDir, tr( "Textfile (*.txt)" ) ); QString fileName = QFileDialog::getOpenFileName( this, tr( "Load Color Map from File" ), lastDir, tr( "Textfile (*.txt)" ) );
QFile inputFile( fileName ); QFile inputFile( fileName );
if ( inputFile.open( QFile::ReadOnly ) ) if ( inputFile.open( QFile::ReadOnly ) )
{ {
@ -536,12 +536,12 @@ void QgsSingleBandPseudoColorRendererWidget::mLoadFromFileButton_clicked()
if ( importError ) if ( importError )
{ {
QMessageBox::warning( this, tr( "Import Error" ), tr( "The following lines contained errors\n\n" ) + badLines ); QMessageBox::warning( this, tr( "Load Color Map from File" ), tr( "The following lines contained errors\n\n" ) + badLines );
} }
} }
else if ( !fileName.isEmpty() ) else if ( !fileName.isEmpty() )
{ {
QMessageBox::warning( this, tr( "Read access denied" ), tr( "Read access denied. Adjust the file permissions and try again.\n\n" ) ); QMessageBox::warning( this, tr( "Load Color Map from File" ), tr( "Read access denied. Adjust the file permissions and try again.\n\n" ) );
} }
loadMinMaxFromTree(); loadMinMaxFromTree();
@ -552,7 +552,7 @@ void QgsSingleBandPseudoColorRendererWidget::mExportToFileButton_clicked()
{ {
QgsSettings settings; QgsSettings settings;
QString lastDir = settings.value( QStringLiteral( "lastColorMapDir" ), QDir::homePath() ).toString(); QString lastDir = settings.value( QStringLiteral( "lastColorMapDir" ), QDir::homePath() ).toString();
QString fileName = QFileDialog::getSaveFileName( this, tr( "Save file" ), lastDir, tr( "Textfile (*.txt)" ) ); QString fileName = QFileDialog::getSaveFileName( this, tr( "Save Color Map as File" ), lastDir, tr( "Textfile (*.txt)" ) );
if ( !fileName.isEmpty() ) if ( !fileName.isEmpty() )
{ {
if ( !fileName.endsWith( QLatin1String( ".txt" ), Qt::CaseInsensitive ) ) if ( !fileName.endsWith( QLatin1String( ".txt" ), Qt::CaseInsensitive ) )
@ -610,7 +610,7 @@ void QgsSingleBandPseudoColorRendererWidget::mExportToFileButton_clicked()
} }
else else
{ {
QMessageBox::warning( this, tr( "Write access denied" ), tr( "Write access denied. Adjust the file permissions and try again.\n\n" ) ); QMessageBox::warning( this, tr( "Save Color Map as File" ), tr( "Write access denied. Adjust the file permissions and try again.\n\n" ) );
} }
} }
} }
@ -625,7 +625,7 @@ void QgsSingleBandPseudoColorRendererWidget::mColormapTreeWidget_itemDoubleClick
if ( column == ColorColumn ) if ( column == ColorColumn )
{ {
item->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable ); item->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable );
QColor newColor = QgsColorDialog::getColor( item->background( column ).color(), this, QStringLiteral( "Change color" ), true ); QColor newColor = QgsColorDialog::getColor( item->background( column ).color(), this, QStringLiteral( "Change Color" ), true );
if ( newColor.isValid() ) if ( newColor.isValid() )
{ {
item->setBackground( ColorColumn, QBrush( newColor ) ); item->setBackground( ColorColumn, QBrush( newColor ) );
@ -851,7 +851,7 @@ void QgsSingleBandPseudoColorRendererWidget::changeColor()
} }
QTreeWidgetItem *firstItem = itemList.first(); QTreeWidgetItem *firstItem = itemList.first();
QColor newColor = QgsColorDialog::getColor( firstItem->background( ColorColumn ).color(), this, QStringLiteral( "Change color" ), true ); QColor newColor = QgsColorDialog::getColor( firstItem->background( ColorColumn ).color(), this, QStringLiteral( "Change Color" ), true );
if ( newColor.isValid() ) if ( newColor.isValid() )
{ {
Q_FOREACH ( QTreeWidgetItem *item, itemList ) Q_FOREACH ( QTreeWidgetItem *item, itemList )

View File

@ -658,8 +658,8 @@ void QgsCategorizedSymbolRendererWidget::addCategories()
// ask to abort if too many classes // ask to abort if too many classes
if ( unique_vals.size() >= 1000 ) if ( unique_vals.size() >= 1000 )
{ {
int res = QMessageBox::warning( nullptr, tr( "High number of classes!" ), int res = QMessageBox::warning( nullptr, tr( "Classify Categories" ),
tr( "Classification would yield %1 entries which might not be expected. Continue?" ).arg( unique_vals.size() ), tr( "High number of classes. Classification would yield %1 entries which might not be expected. Continue?" ).arg( unique_vals.size() ),
QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Ok | QMessageBox::Cancel,
QMessageBox::Cancel ); QMessageBox::Cancel );
if ( res == QMessageBox::Cancel ) if ( res == QMessageBox::Cancel )
@ -683,7 +683,7 @@ void QgsCategorizedSymbolRendererWidget::addCategories()
!mRenderer->categories().isEmpty() ) !mRenderer->categories().isEmpty() )
{ {
int res = QMessageBox::question( this, int res = QMessageBox::question( this,
tr( "Confirm Delete" ), tr( "Delete Classification" ),
tr( "The classification field was changed from '%1' to '%2'.\n" tr( "The classification field was changed from '%1' to '%2'.\n"
"Should the existing classes be deleted before classification?" ) "Should the existing classes be deleted before classification?" )
.arg( mOldClassificationAttribute, attrName ), .arg( mOldClassificationAttribute, attrName ),
@ -910,7 +910,7 @@ void QgsCategorizedSymbolRendererWidget::matchToSymbolsFromXml()
QgsSettings settings; QgsSettings settings;
QString openFileDir = settings.value( QStringLiteral( "UI/lastMatchToSymbolsDir" ), QDir::homePath() ).toString(); QString openFileDir = settings.value( QStringLiteral( "UI/lastMatchToSymbolsDir" ), QDir::homePath() ).toString();
QString fileName = QFileDialog::getOpenFileName( this, tr( "Match to symbols from file" ), openFileDir, QString fileName = QFileDialog::getOpenFileName( this, tr( "Match to Symbols from File" ), openFileDir,
tr( "XML files (*.xml *XML)" ) ); tr( "XML files (*.xml *XML)" ) );
if ( fileName.isEmpty() ) if ( fileName.isEmpty() )
{ {
@ -923,7 +923,7 @@ 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( "Match to Symbols from File" ),
tr( "An error occurred while reading file:\n%1" ).arg( importedStyle.errorString() ) ); tr( "An error occurred while reading file:\n%1" ).arg( importedStyle.errorString() ) );
return; return;
} }
@ -931,12 +931,12 @@ void QgsCategorizedSymbolRendererWidget::matchToSymbolsFromXml()
int matched = matchToSymbols( &importedStyle ); int matched = matchToSymbols( &importedStyle );
if ( matched > 0 ) if ( matched > 0 )
{ {
QMessageBox::information( this, tr( "Matched Symbols" ), QMessageBox::information( this, tr( "Match to Symbols from File" ),
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( "Match to Symbols from File" ),
tr( "No categories could be matched to symbols in file." ) ); tr( "No categories could be matched to symbols in file." ) );
} }
} }

View File

@ -690,7 +690,7 @@ void QgsGraduatedSymbolRendererWidget::methodComboBox_currentIndexChanged( int i
if ( !ramp ) if ( !ramp )
{ {
QMessageBox::critical( this, tr( "Error" ), tr( "No color ramp defined." ) ); QMessageBox::critical( this, tr( "Select Method" ), tr( "No color ramp defined." ) );
return; return;
} }
mRenderer->setSourceColorRamp( ramp ); mRenderer->setSourceColorRamp( ramp );
@ -803,7 +803,7 @@ void QgsGraduatedSymbolRendererWidget::classifyGraduated()
std::unique_ptr<QgsColorRamp> ramp( btnColorRamp->colorRamp() ); std::unique_ptr<QgsColorRamp> ramp( btnColorRamp->colorRamp() );
if ( !ramp ) if ( !ramp )
{ {
QMessageBox::critical( this, tr( "Error" ), tr( "No color ramp defined." ) ); QMessageBox::critical( this, tr( "Apply Classification" ), tr( "No color ramp defined." ) );
return; return;
} }
@ -823,7 +823,7 @@ void QgsGraduatedSymbolRendererWidget::classifyGraduated()
// and give the user the chance to cancel // and give the user the chance to cancel
if ( QgsGraduatedSymbolRenderer::Jenks == mode && mLayer->featureCount() > 50000 ) if ( QgsGraduatedSymbolRenderer::Jenks == mode && mLayer->featureCount() > 50000 )
{ {
if ( QMessageBox::Cancel == QMessageBox::question( this, tr( "Warning" ), tr( "Natural break classification (Jenks) is O(n2) complexity, your classification may take a long time.\nPress cancel to abort breaks calculation or OK to continue." ), QMessageBox::Cancel, QMessageBox::Ok ) ) if ( QMessageBox::Cancel == QMessageBox::question( this, tr( "Apply Classification" ), tr( "Natural break classification (Jenks) is O(n2) complexity, your classification may take a long time.\nPress cancel to abort breaks calculation or OK to continue." ), QMessageBox::Cancel, QMessageBox::Ok ) )
return; return;
} }
@ -836,7 +836,7 @@ void QgsGraduatedSymbolRendererWidget::classifyGraduated()
{ {
if ( !ramp ) if ( !ramp )
{ {
QMessageBox::critical( this, tr( "Error" ), tr( "No color ramp defined." ) ); QMessageBox::critical( this, tr( "Apply Classification" ), tr( "No color ramp defined." ) );
return; return;
} }
mRenderer->setSourceColorRamp( ramp.release() ); mRenderer->setSourceColorRamp( ramp.release() );
@ -1047,7 +1047,7 @@ void QgsGraduatedSymbolRendererWidget::toggleBoundariesLink( bool linked )
{ {
int result = QMessageBox::warning( int result = QMessageBox::warning(
this, this,
tr( "Linked range warning" ), tr( "Link Class Boundaries" ),
tr( "Rows will be reordered before linking boundaries. Continue?" ), tr( "Rows will be reordered before linking boundaries. Continue?" ),
QMessageBox::Ok | QMessageBox::Cancel ); QMessageBox::Ok | QMessageBox::Cancel );
if ( result != QMessageBox::Ok ) if ( result != QMessageBox::Ok )

View File

@ -288,7 +288,7 @@ QgsDataDefinedSizeLegendWidget *QgsRendererWidget::createDataDefinedSizeLegendWi
QgsProperty ddSize = symbol->dataDefinedSize(); QgsProperty ddSize = symbol->dataDefinedSize();
if ( !ddSize || !ddSize.isActive() ) if ( !ddSize || !ddSize.isActive() )
{ {
QMessageBox::warning( this, tr( "Data-defined size legend" ), tr( "Data-defined size is not enabled!" ) ); QMessageBox::warning( this, tr( "Data-defined Size Legend" ), tr( "Data-defined size is not enabled!" ) );
return nullptr; return nullptr;
} }

View File

@ -316,7 +316,7 @@ void QgsRuleBasedRendererWidget::refineRuleScalesGui( const QModelIndexList &ind
if ( ok ) if ( ok )
scales.append( scale ); scales.append( scale );
else else
QMessageBox::information( this, tr( "Error" ), QString( tr( "\"%1\" is not valid scale denominator, ignoring it." ) ).arg( item ) ); QMessageBox::information( this, tr( "Scale Refinement" ), QString( tr( "\"%1\" is not valid scale denominator, ignoring it." ) ).arg( item ) );
} }
Q_FOREACH ( const QModelIndex &index, indexList ) Q_FOREACH ( const QModelIndex &index, indexList )
@ -757,7 +757,7 @@ void QgsRendererRulePropsWidget::testFilter()
QgsExpression filter( editFilter->text() ); QgsExpression filter( editFilter->text() );
if ( filter.hasParserError() ) if ( filter.hasParserError() )
{ {
QMessageBox::critical( this, tr( "Error" ), tr( "Filter expression parsing error:\n" ) + filter.parserErrorString() ); QMessageBox::critical( this, tr( "Test Filter" ), tr( "Filter expression parsing error:\n" ) + filter.parserErrorString() );
return; return;
} }
@ -771,7 +771,7 @@ void QgsRendererRulePropsWidget::testFilter()
if ( !filter.prepare( &context ) ) if ( !filter.prepare( &context ) )
{ {
QMessageBox::critical( this, tr( "Evaluation error" ), filter.evalErrorString() ); QMessageBox::critical( this, tr( "Test Filter" ), filter.evalErrorString() );
return; return;
} }
@ -793,7 +793,7 @@ void QgsRendererRulePropsWidget::testFilter()
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
QMessageBox::information( this, tr( "Filter" ), tr( "Filter returned %n feature(s)", "number of filtered features", count ) ); QMessageBox::information( this, tr( "Test Filter" ), tr( "Filter returned %n feature(s)", "number of filtered features", count ) );
} }
void QgsRendererRulePropsWidget::apply() void QgsRendererRulePropsWidget::apply()

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( "Edit Smart Group" ), tr( "The smart group name field is empty. Kindly provide a name." ) );
return; return;
} }
accept(); accept();

View File

@ -121,14 +121,14 @@ void QgsStyleExportImportDialog::doExportImport()
QModelIndexList selection = listItems->selectionModel()->selectedIndexes(); QModelIndexList selection = listItems->selectionModel()->selectedIndexes();
if ( selection.isEmpty() ) if ( selection.isEmpty() )
{ {
QMessageBox::warning( this, tr( "Export/import error" ), QMessageBox::warning( this, tr( "Export/import Symbols or Color Ramps" ),
tr( "You should select at least one symbol/color ramp." ) ); tr( "You should select at least one symbol/color ramp." ) );
return; return;
} }
if ( mDialogMode == Export ) if ( mDialogMode == Export )
{ {
QString fileName = QFileDialog::getSaveFileName( this, tr( "Save styles" ), QDir::homePath(), QString fileName = QFileDialog::getSaveFileName( this, tr( "Save Styles" ), QDir::homePath(),
tr( "XML files (*.xml *.XML)" ) ); tr( "XML files (*.xml *.XML)" ) );
if ( fileName.isEmpty() ) if ( fileName.isEmpty() )
{ {
@ -146,14 +146,14 @@ void QgsStyleExportImportDialog::doExportImport()
moveStyles( &selection, mStyle, mTempStyle ); moveStyles( &selection, mStyle, mTempStyle );
if ( !mTempStyle->exportXml( mFileName ) ) if ( !mTempStyle->exportXml( mFileName ) )
{ {
QMessageBox::warning( this, tr( "Export/import error" ), QMessageBox::warning( this, tr( "Export Symbols" ),
tr( "Error when saving selected symbols to file:\n%1" ) tr( "Error when saving selected symbols to file:\n%1" )
.arg( mTempStyle->errorString() ) ); .arg( mTempStyle->errorString() ) );
return; return;
} }
else else
{ {
QMessageBox::information( this, tr( "Export successful" ), QMessageBox::information( this, tr( "Export Symbols" ),
tr( "The selected symbols were successfully exported to file:\n%1" ) tr( "The selected symbols were successfully exported to file:\n%1" )
.arg( mFileName ) ); .arg( mFileName ) );
} }
@ -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 Symbols or Color Ramps" ),
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( "Export/import Symbols" ),
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( "Export/import Color Ramps" ),
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 );
@ -482,7 +482,7 @@ void QgsStyleExportImportDialog::browse()
if ( type == QLatin1String( "file" ) ) if ( type == QLatin1String( "file" ) )
{ {
mFileName = QFileDialog::getOpenFileName( this, tr( "Load styles" ), QDir::homePath(), mFileName = QFileDialog::getOpenFileName( this, tr( "Load Styles" ), QDir::homePath(),
tr( "XML files (*.xml *XML)" ) ); tr( "XML files (*.xml *XML)" ) );
if ( mFileName.isEmpty() ) if ( mFileName.isEmpty() )
{ {
@ -549,8 +549,8 @@ void QgsStyleExportImportDialog::httpFinished()
mTempFile->remove(); mTempFile->remove();
mFileName.clear(); mFileName.clear();
mProgressDlg->hide(); mProgressDlg->hide();
QMessageBox::information( this, tr( "HTTP Error!" ), QMessageBox::information( this, tr( "Import from URL" ),
tr( "Download failed: %1." ).arg( mNetReply->errorString() ) ); tr( "HTTP Error! Download failed: %1." ).arg( mNetReply->errorString() ) );
return; return;
} }
else else

View File

@ -420,12 +420,12 @@ bool QgsStyleManagerDialog::addSymbol()
// validate name // validate name
if ( name.isEmpty() ) if ( name.isEmpty() )
{ {
QMessageBox::warning( this, tr( "Save symbol" ), QMessageBox::warning( this, tr( "Save Symbol" ),
tr( "Cannot save symbol without name. Enter a name." ) ); tr( "Cannot save symbol without name. Enter a name." ) );
} }
else if ( mStyle->symbolNames().contains( name ) ) else if ( mStyle->symbolNames().contains( name ) )
{ {
int res = QMessageBox::warning( this, tr( "Save symbol" ), int res = QMessageBox::warning( this, tr( "Save Symbol" ),
tr( "Symbol with name '%1' already exists. Overwrite?" ) tr( "Symbol with name '%1' already exists. Overwrite?" )
.arg( name ), .arg( name ),
QMessageBox::Yes | QMessageBox::No ); QMessageBox::Yes | QMessageBox::No );
@ -474,7 +474,7 @@ QString QgsStyleManagerDialog::addColorRampStatic( QWidget *parent, QgsStyle *st
QStringList rampTypes; QStringList rampTypes;
rampTypes << tr( "Gradient" ) << tr( "Color presets" ) << tr( "Random" ) << tr( "Catalog: cpt-city" ); rampTypes << tr( "Gradient" ) << tr( "Color presets" ) << tr( "Random" ) << tr( "Catalog: cpt-city" );
rampTypes << tr( "Catalog: ColorBrewer" ); rampTypes << tr( "Catalog: ColorBrewer" );
rampType = QInputDialog::getItem( parent, tr( "Color ramp type" ), rampType = QInputDialog::getItem( parent, tr( "Color Ramp Type" ),
tr( "Please select color ramp type:" ), rampTypes, 0, false, &ok ); tr( "Please select color ramp type:" ), rampTypes, 0, false, &ok );
} }
if ( !ok || rampType.isEmpty() ) if ( !ok || rampType.isEmpty() )
@ -569,7 +569,7 @@ QString QgsStyleManagerDialog::addColorRampStatic( QWidget *parent, QgsStyle *st
} }
else if ( style->colorRampNames().contains( name ) ) else if ( style->colorRampNames().contains( name ) )
{ {
int res = QMessageBox::warning( parent, tr( "Save color ramp" ), int res = QMessageBox::warning( parent, tr( "Save Color Ramp" ),
tr( "Color ramp with name '%1' already exists. Overwrite?" ) tr( "Color ramp with name '%1' already exists. Overwrite?" )
.arg( name ), .arg( name ),
QMessageBox::Yes | QMessageBox::No ); QMessageBox::Yes | QMessageBox::No );
@ -771,7 +771,7 @@ void QgsStyleManagerDialog::removeItem()
bool QgsStyleManagerDialog::removeSymbol() bool QgsStyleManagerDialog::removeSymbol()
{ {
QModelIndexList indexes = listItems->selectionModel()->selectedIndexes(); QModelIndexList indexes = listItems->selectionModel()->selectedIndexes();
if ( QMessageBox::Yes != QMessageBox::question( this, tr( "Confirm removal" ), if ( QMessageBox::Yes != QMessageBox::question( this, tr( "Remove Symbol" ),
QString( tr( "Do you really want to remove %n symbol(s)?", nullptr, indexes.count() ) ), QString( tr( "Do you really want to remove %n symbol(s)?", nullptr, indexes.count() ) ),
QMessageBox::Yes, QMessageBox::Yes,
QMessageBox::No ) ) QMessageBox::No ) )
@ -791,7 +791,7 @@ bool QgsStyleManagerDialog::removeSymbol()
bool QgsStyleManagerDialog::removeColorRamp() bool QgsStyleManagerDialog::removeColorRamp()
{ {
QModelIndexList indexes = listItems->selectionModel()->selectedIndexes(); QModelIndexList indexes = listItems->selectionModel()->selectedIndexes();
if ( QMessageBox::Yes != QMessageBox::question( this, tr( "Confirm removal" ), if ( QMessageBox::Yes != QMessageBox::question( this, tr( "Remove Color Ramp" ),
QString( tr( "Do you really want to remove %n ramp(s)?", nullptr, indexes.count() ) ), QString( tr( "Do you really want to remove %n ramp(s)?", nullptr, indexes.count() ) ),
QMessageBox::Yes, QMessageBox::Yes,
QMessageBox::No ) ) QMessageBox::No ) )
@ -830,7 +830,7 @@ void QgsStyleManagerDialog::itemChanged( QStandardItem *item )
} }
else else
{ {
QMessageBox::critical( this, tr( "Cannot rename item" ), QMessageBox::critical( this, tr( "Save Item" ),
tr( "Name is already taken by another item. Choose a different name." ) ); tr( "Name is already taken by another item. Choose a different name." ) );
item->setText( oldName ); item->setText( oldName );
} }
@ -838,7 +838,7 @@ void QgsStyleManagerDialog::itemChanged( QStandardItem *item )
void QgsStyleManagerDialog::exportItemsPNG() void QgsStyleManagerDialog::exportItemsPNG()
{ {
QString dir = QFileDialog::getExistingDirectory( this, tr( "Exported selected symbols as PNG" ), QString dir = QFileDialog::getExistingDirectory( this, tr( "Export Selected Symbols as PNG" ),
QDir::home().absolutePath(), QDir::home().absolutePath(),
QFileDialog::ShowDirsOnly QFileDialog::ShowDirsOnly
| QFileDialog::DontResolveSymlinks ); | QFileDialog::DontResolveSymlinks );
@ -847,7 +847,7 @@ void QgsStyleManagerDialog::exportItemsPNG()
void QgsStyleManagerDialog::exportItemsSVG() void QgsStyleManagerDialog::exportItemsSVG()
{ {
QString dir = QFileDialog::getExistingDirectory( this, tr( "Exported selected symbols as SVG" ), QString dir = QFileDialog::getExistingDirectory( this, tr( "Export Selected Symbols as SVG" ),
QDir::home().absolutePath(), QDir::home().absolutePath(),
QFileDialog::ShowDirsOnly QFileDialog::ShowDirsOnly
| QFileDialog::DontResolveSymlinks ); | QFileDialog::DontResolveSymlinks );
@ -1061,7 +1061,7 @@ int QgsStyleManagerDialog::addTag()
QString itemName; QString itemName;
int id; int id;
bool ok; bool ok;
itemName = QInputDialog::getText( this, tr( "Tag name" ), itemName = QInputDialog::getText( this, tr( "Add Tag" ),
tr( "Please enter name for the new tag:" ), QLineEdit::Normal, tr( "New tag" ), &ok ).trimmed(); tr( "Please enter name for the new tag:" ), QLineEdit::Normal, tr( "New tag" ), &ok ).trimmed();
if ( !ok || itemName.isEmpty() ) if ( !ok || itemName.isEmpty() )
return 0; return 0;
@ -1069,14 +1069,14 @@ int QgsStyleManagerDialog::addTag()
int check = mStyle->tagId( itemName ); int check = mStyle->tagId( itemName );
if ( check > 0 ) if ( check > 0 )
{ {
QMessageBox::critical( this, tr( "Error!" ), QMessageBox::critical( this, tr( "Add Tag" ),
tr( "Tag name already exists in your symbol database." ) ); tr( "Tag name already exists in your symbol database." ) );
return 0; return 0;
} }
id = mStyle->addTag( itemName ); id = mStyle->addTag( itemName );
if ( !id ) if ( !id )
{ {
QMessageBox::critical( this, tr( "Error!" ), QMessageBox::critical( this, tr( "Add Tag" ),
tr( "New tag could not be created.\n" tr( "New tag could not be created.\n"
"There was a problem with your symbol database." ) ); "There was a problem with your symbol database." ) );
return 0; return 0;
@ -1131,8 +1131,8 @@ void QgsStyleManagerDialog::removeGroup()
QString data = index.data( Qt::UserRole + 1 ).toString(); QString data = index.data( Qt::UserRole + 1 ).toString();
if ( data == QLatin1String( "all" ) || data == QLatin1String( "favorite" ) || data == QLatin1String( "tags" ) || index.data() == "smartgroups" ) if ( data == QLatin1String( "all" ) || data == QLatin1String( "favorite" ) || data == QLatin1String( "tags" ) || index.data() == "smartgroups" )
{ {
int err = QMessageBox::critical( this, tr( "Invalid selection" ), int err = QMessageBox::critical( this, tr( "Remove Group" ),
tr( "Cannot delete system defined categories.\n" tr( "Invalid selection. Cannot delete system defined categories.\n"
"Kindly select a group or smart group you might want to delete." ) ); "Kindly select a group or smart group you might want to delete." ) );
if ( err ) if ( err )
return; return;
@ -1254,8 +1254,8 @@ void QgsStyleManagerDialog::regrouped( QStandardItem *item )
regrouped = mStyle->detagSymbol( type, symbolName, QStringList( tag ) ); regrouped = mStyle->detagSymbol( type, symbolName, QStringList( tag ) );
if ( !regrouped ) if ( !regrouped )
{ {
int er = QMessageBox::critical( this, tr( "Database Error" ), int er = QMessageBox::critical( this, tr( "Group Items" ),
tr( "There was a problem with the Symbols database while regrouping." ) ); tr( "There was a problem with the symbols database while regrouping." ) );
// call the slot again to get back to normal // call the slot again to get back to normal
if ( er ) if ( er )
tagSymbolsAction(); tagSymbolsAction();
@ -1502,7 +1502,7 @@ void QgsStyleManagerDialog::editSmartgroupAction()
QModelIndex present = groupTree->currentIndex(); QModelIndex present = groupTree->currentIndex();
if ( present.parent().data( Qt::UserRole + 1 ) != "smartgroups" ) if ( present.parent().data( Qt::UserRole + 1 ) != "smartgroups" )
{ {
QMessageBox::critical( this, tr( "Invalid Selection" ), QMessageBox::critical( this, tr( "Edit Smart Group" ),
tr( "You have not selected a Smart Group. Kindly select a Smart Group to edit." ) ); tr( "You have not selected a Smart Group. Kindly select a Smart Group to edit." ) );
return; return;
} }
@ -1521,7 +1521,7 @@ void QgsStyleManagerDialog::editSmartgroupAction()
int id = mStyle->addSmartgroup( dlg.smartgroupName(), dlg.conditionOperator(), dlg.conditionMap() ); int id = mStyle->addSmartgroup( dlg.smartgroupName(), dlg.conditionOperator(), dlg.conditionMap() );
if ( !id ) if ( !id )
{ {
QMessageBox::critical( this, tr( "Database Error!" ), QMessageBox::critical( this, tr( "Edit Smart Group" ),
tr( "There was some error while editing the smart group." ) ); tr( "There was some error while editing the smart group." ) );
return; return;
} }

View File

@ -187,7 +187,7 @@ QgsSimpleLineSymbolLayerWidget::QgsSimpleLineSymbolLayerWidget( QgsVectorLayer *
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches ); << QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );
btnChangeColor->setAllowOpacity( true ); btnChangeColor->setAllowOpacity( true );
btnChangeColor->setColorDialogTitle( tr( "Select Line color" ) ); btnChangeColor->setColorDialogTitle( tr( "Select Line Color" ) );
btnChangeColor->setContext( QStringLiteral( "symbology" ) ); btnChangeColor->setContext( QStringLiteral( "symbology" ) );
spinOffset->setClearValue( 0.0 ); spinOffset->setClearValue( 0.0 );
@ -1390,12 +1390,12 @@ QgsShapeburstFillSymbolLayerWidget::QgsShapeburstFillSymbolLayerWidget( QgsVecto
group2->addButton( mRadioUseMaxDistance ); group2->addButton( mRadioUseMaxDistance );
group2->addButton( mRadioUseWholeShape ); group2->addButton( mRadioUseWholeShape );
btnChangeColor->setAllowOpacity( true ); btnChangeColor->setAllowOpacity( true );
btnChangeColor->setColorDialogTitle( tr( "Select Gradient color" ) ); btnChangeColor->setColorDialogTitle( tr( "Select Gradient Color" ) );
btnChangeColor->setContext( QStringLiteral( "symbology" ) ); btnChangeColor->setContext( QStringLiteral( "symbology" ) );
btnChangeColor->setShowNoColor( true ); btnChangeColor->setShowNoColor( true );
btnChangeColor->setNoColorString( tr( "Transparent" ) ); btnChangeColor->setNoColorString( tr( "Transparent" ) );
btnChangeColor2->setAllowOpacity( true ); btnChangeColor2->setAllowOpacity( true );
btnChangeColor2->setColorDialogTitle( tr( "Select Gradient color" ) ); btnChangeColor2->setColorDialogTitle( tr( "Select Gradient Color" ) );
btnChangeColor2->setContext( QStringLiteral( "symbology" ) ); btnChangeColor2->setContext( QStringLiteral( "symbology" ) );
btnChangeColor2->setShowNoColor( true ); btnChangeColor2->setShowNoColor( true );
btnChangeColor2->setNoColorString( tr( "Transparent" ) ); btnChangeColor2->setNoColorString( tr( "Transparent" ) );
@ -2373,7 +2373,7 @@ QgsSymbolLayer *QgsSVGFillSymbolLayerWidget::symbolLayer()
void QgsSVGFillSymbolLayerWidget::mBrowseToolButton_clicked() void QgsSVGFillSymbolLayerWidget::mBrowseToolButton_clicked()
{ {
QString filePath = QFileDialog::getOpenFileName( nullptr, tr( "Select SVG texture file" ), QDir::homePath(), tr( "SVG file" ) + " (*.svg);;" + tr( "All files" ) + " (*.*)" ); QString filePath = QFileDialog::getOpenFileName( nullptr, tr( "Select SVG Texture File" ), QDir::homePath(), tr( "SVG file" ) + " (*.svg);;" + tr( "All files" ) + " (*.*)" );
if ( !filePath.isNull() ) if ( !filePath.isNull() )
{ {
mSVGLineEdit->setText( filePath ); mSVGLineEdit->setText( filePath );
@ -3237,14 +3237,14 @@ void QgsRasterFillSymbolLayerWidget::mBrowseToolButton_clicked()
} }
//show file dialog //show file dialog
QString filePath = QFileDialog::getOpenFileName( nullptr, tr( "Select image file" ), openDir ); QString filePath = QFileDialog::getOpenFileName( nullptr, tr( "Select Image File" ), openDir );
if ( !filePath.isNull() ) if ( !filePath.isNull() )
{ {
//check if file exists //check if file exists
QFileInfo fileInfo( filePath ); QFileInfo fileInfo( filePath );
if ( !fileInfo.exists() || !fileInfo.isReadable() ) if ( !fileInfo.exists() || !fileInfo.isReadable() )
{ {
QMessageBox::critical( nullptr, QStringLiteral( "Invalid file" ), QStringLiteral( "Error, file does not exist or is not readable" ) ); QMessageBox::critical( nullptr, QStringLiteral( "Select Image File" ), QStringLiteral( "Error, file does not exist or is not readable." ) );
return; return;
} }