Skip to content

Commit

Permalink
Merge pull request #6398 from DelazJ/QMessageBoxTitles
Browse files Browse the repository at this point in the history
Updating some dialogs caption
  • Loading branch information
nyalldawson committed Feb 21, 2018
2 parents 6573eb3 + ed99ba9 commit bb08b64
Show file tree
Hide file tree
Showing 23 changed files with 124 additions and 122 deletions.
2 changes: 2 additions & 0 deletions src/gui/qgsmaplayerstylemanagerwidget.cpp
Expand Up @@ -185,6 +185,7 @@ void QgsMapLayerStyleManagerWidget::saveAsDefault()
if ( layer->dataProvider()->isSaveAndLoadStyleToDatabaseSupported() )
{
QMessageBox askToUser;
askToUser.setWindowTitle( tr( "Save Style" ) );
askToUser.setText( tr( "Save default style to: " ) );
askToUser.setIcon( QMessageBox::Question );
askToUser.addButton( tr( "Cancel" ), QMessageBox::RejectRole );
Expand Down Expand Up @@ -227,6 +228,7 @@ void QgsMapLayerStyleManagerWidget::loadDefault()
if ( layer->dataProvider()->isSaveAndLoadStyleToDatabaseSupported() )
{
QMessageBox askToUser;
askToUser.setWindowTitle( tr( "Load Style" ) );
askToUser.setText( tr( "Load default style from: " ) );
askToUser.setIcon( QMessageBox::Question );
askToUser.addButton( tr( "Cancel" ), QMessageBox::RejectRole );
Expand Down
8 changes: 4 additions & 4 deletions src/gui/qgsnewauxiliaryfielddialog.cpp
Expand Up @@ -79,14 +79,14 @@ void QgsNewAuxiliaryFieldDialog::accept()
const int idx = mLayer->fields().lookupField( fieldName );
if ( idx >= 0 )
{
const QString title = tr( "Invalid name" );
const QString msg = tr( "Auxiliary field '%1' already exists" ).arg( fieldName );
const QString title = tr( "New Auxiliary Field" );
const QString msg = tr( "Invalid name. Auxiliary field '%1' already exists." ).arg( fieldName );
QMessageBox::critical( this, title, msg, QMessageBox::Ok );
}
else if ( def.comment().isEmpty() )
{
const QString title = tr( "Invalid name" );
const QString msg = tr( "Name is a mandatory parameter" );
const QString title = tr( "New Auxiliary Field" );
const QString msg = tr( "Name is a mandatory parameter." );
QMessageBox::critical( this, title, msg, QMessageBox::Ok );
}
else
Expand Down
28 changes: 14 additions & 14 deletions src/gui/qgsnewgeopackagelayerdialog.cpp
Expand Up @@ -198,7 +198,7 @@ void QgsNewGeoPackageLayerDialog::mAddAttributeButton_clicked()
QString myName = mFieldNameEdit->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;
}

Expand Down Expand Up @@ -259,8 +259,8 @@ bool QgsNewGeoPackageLayerDialog::apply()
{
QMessageBox msgBox;
msgBox.setIcon( QMessageBox::Question );
msgBox.setWindowTitle( tr( "The File Already Exists." ) );
msgBox.setText( tr( "Do you want to overwrite the existing file with a new database or add a new layer to it?" ) );
msgBox.setWindowTitle( tr( "New GeoPackage Layer" ) );
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 *addNewLayerButton = msgBox.addButton( tr( "Add new layer" ), QMessageBox::ActionRole );
msgBox.setStandardButtons( QMessageBox::Cancel );
Expand Down Expand Up @@ -311,8 +311,8 @@ bool QgsNewGeoPackageLayerDialog::apply()
if ( !hGpkgDriver )
{
if ( !property( "hideDialogs" ).toBool() )
QMessageBox::critical( this, tr( "Layer creation failed" ),
tr( "GeoPackage driver not found" ) );
QMessageBox::critical( this, tr( "New GeoPackage Layer" ),
tr( "Layer creation failed. GeoPackage driver not found." ) );
return false;
}

Expand All @@ -324,7 +324,7 @@ bool QgsNewGeoPackageLayerDialog::apply()
{
QString msg( tr( "Creation of database failed (OGR error: %1)" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
if ( !property( "hideDialogs" ).toBool() )
QMessageBox::critical( this, tr( "Layer creation failed" ), msg );
QMessageBox::critical( this, tr( "New GeoPackage Layer" ), msg );
return false;
}
}
Expand All @@ -336,14 +336,14 @@ bool QgsNewGeoPackageLayerDialog::apply()
{
QString msg( tr( "Opening of database failed (OGR error: %1)" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
if ( !property( "hideDialogs" ).toBool() )
QMessageBox::critical( this, tr( "Layer creation failed" ), msg );
QMessageBox::critical( this, tr( "New GeoPackage Layer" ), msg );
return false;
}
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() )
QMessageBox::critical( this, tr( "Layer creation failed" ), msg );
QMessageBox::critical( this, tr( "New GeoPackage Layer" ), msg );
return false;
}
}
Expand All @@ -357,7 +357,7 @@ bool QgsNewGeoPackageLayerDialog::apply()
{
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?" ),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) == QMessageBox::Yes )
{
Expand Down Expand Up @@ -421,7 +421,7 @@ bool QgsNewGeoPackageLayerDialog::apply()
{
QString msg( tr( "Creation of layer failed (OGR error: %1)" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
if ( !property( "hideDialogs" ).toBool() )
QMessageBox::critical( this, tr( "Layer creation failed" ), msg );
QMessageBox::critical( this, tr( "New GeoPackage Layer" ), msg );
return false;
}

Expand Down Expand Up @@ -455,7 +455,7 @@ bool QgsNewGeoPackageLayerDialog::apply()
{
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)" )
.arg( fieldName, QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
}
Expand All @@ -473,7 +473,7 @@ bool QgsNewGeoPackageLayerDialog::apply()
{
QString msg( tr( "Creation of layer failed (OGR error: %1)" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
if ( !property( "hideDialogs" ).toBool() )
QMessageBox::critical( this, tr( "Layer creation failed" ), msg );
QMessageBox::critical( this, tr( "New GeoPackage Layer" ), msg );
return false;
}
hDS.reset();
Expand All @@ -494,7 +494,7 @@ bool QgsNewGeoPackageLayerDialog::apply()
else
{
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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsoptionsdialogbase.cpp
Expand Up @@ -393,7 +393,7 @@ void QgsOptionsDialogBase::optionsStackedWidget_WidgetRemoved( int index )

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"
"Missing some of the .ui template objects:\n" )
+ " mOptionsListWidget,\n mOptionsStackedWidget,\n mOptionsSplitter,\n mOptionsListFrame",
Expand Down
6 changes: 3 additions & 3 deletions src/gui/qgsowssourceselect.cpp
Expand Up @@ -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?" )
.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 )
{
QgsOwsConnection::deleteConnection( mService, mConnectionsComboBox->currentText() );
Expand Down Expand Up @@ -631,9 +631,9 @@ void QgsOWSSourceSelect::addDefaultServers()
settings.endGroup();
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 "
"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>" );
}

Expand Down
8 changes: 4 additions & 4 deletions src/gui/qgsquerybuilder.cpp
Expand Up @@ -233,15 +233,15 @@ void QgsQueryBuilder::test()
else if ( mLayer->dataProvider()->hasErrors() )
{
QMessageBox::warning( this,
tr( "Query Failed" ),
tr( "Query Result" ),
tr( "An error occurred when executing the query." )
+ tr( "\nThe data provider said:\n%1" ).arg( mLayer->dataProvider()->errors().join( QStringLiteral( "\n" ) ) ) );
mLayer->dataProvider()->clearErrors();
}
else
{
QMessageBox::warning( this,
tr( "Query Failed" ),
tr( "Query Result" ),
tr( "An error occurred when executing the query." ) );
}
}
Expand All @@ -254,14 +254,14 @@ void QgsQueryBuilder::accept()
if ( mLayer->dataProvider()->hasErrors() )
{
QMessageBox::warning( this,
tr( "Query Failed" ),
tr( "Query Result" ),
tr( "An error occurred when executing the query." )
+ tr( "\nThe data provider said:\n%1" ).arg( mLayer->dataProvider()->errors().join( QStringLiteral( "\n" ) ) ) );
mLayer->dataProvider()->clearErrors();
}
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;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsrasterformatsaveoptionswidget.cpp
Expand Up @@ -378,7 +378,7 @@ QString QgsRasterFormatSaveOptionsWidget::validateOptions( bool gui, bool report
}
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 )
delete rasterLayer;
return QString();
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsrasterlayersaveasdialog.cpp
Expand Up @@ -197,7 +197,7 @@ QgsRasterLayerSaveAsDialog::QgsRasterLayerSaveAsDialog( QgsRasterLayer *rasterLa
if ( files.isEmpty() )
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( ", " ) ) ),
QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Ok )
break;
Expand Down
28 changes: 14 additions & 14 deletions src/gui/qgssearchquerybuilder.cpp
Expand Up @@ -195,7 +195,7 @@ void QgsSearchQueryBuilder::btnTest_clicked()
if ( count == -1 )
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
Expand All @@ -204,7 +204,7 @@ long QgsSearchQueryBuilder::countRecords( const QString &searchString )
QgsExpression search( searchString );
if ( search.hasParserError() )
{
QMessageBox::critical( this, tr( "Search string parsing error" ), search.parserErrorString() );
QMessageBox::critical( this, tr( "Query Result" ), search.parserErrorString() );
return -1;
}

Expand All @@ -220,7 +220,7 @@ long QgsSearchQueryBuilder::countRecords( const QString &searchString )

if ( !search.prepare( &context ) )
{
QMessageBox::critical( this, tr( "Evaluation error" ), search.evalErrorString() );
QMessageBox::critical( this, tr( "Query Result" ), search.evalErrorString() );
return -1;
}

Expand All @@ -237,7 +237,7 @@ long QgsSearchQueryBuilder::countRecords( const QString &searchString )
count++;
}

// check if there were errors during evaulating
// check if there were errors during evaluating
if ( search.hasEvalError() )
break;
}
Expand All @@ -246,7 +246,7 @@ long QgsSearchQueryBuilder::countRecords( const QString &searchString )

if ( search.hasEvalError() )
{
QMessageBox::critical( this, tr( "Error during search" ), search.evalErrorString() );
QMessageBox::critical( this, tr( "Query Result" ), search.evalErrorString() );
return -1;
}

Expand All @@ -271,7 +271,7 @@ void QgsSearchQueryBuilder::btnOk_clicked()
}
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
{
Expand Down Expand Up @@ -380,7 +380,7 @@ void QgsSearchQueryBuilder::saveQuery()
QgsSettings s;
QString lastQueryFileDir = s.value( QStringLiteral( "/UI/lastQueryFileDir" ), QDir::homePath() ).toString();
//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() )
{
return;
Expand All @@ -394,7 +394,7 @@ void QgsSearchQueryBuilder::saveQuery()
QFile saveFile( saveFileName );
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;
}

Expand All @@ -416,7 +416,7 @@ void QgsSearchQueryBuilder::loadQuery()
QgsSettings s;
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() )
{
return;
Expand All @@ -425,20 +425,20 @@ void QgsSearchQueryBuilder::loadQuery()
QFile queryFile( queryFileName );
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;
}
QDomDocument queryDoc;
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;
}

QDomElement queryElem = queryDoc.firstChildElement( QStringLiteral( "Query" ) );
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;
}

Expand All @@ -448,7 +448,7 @@ void QgsSearchQueryBuilder::loadQuery()
QgsExpression search( query );
if ( search.hasParserError() )
{
QMessageBox::critical( this, tr( "Search string parsing error" ), search.parserErrorString() );
QMessageBox::critical( this, tr( "Query Result" ), search.parserErrorString() );
return;
}

Expand Down Expand Up @@ -476,7 +476,7 @@ void QgsSearchQueryBuilder::loadQuery()
if ( !mFieldMap.contains( attIt ) )
{
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 );
if ( !ok || replaceAttribute.isEmpty() )
{
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgssqlcomposerdialog.cpp
Expand Up @@ -213,12 +213,12 @@ void QgsSQLComposerDialog::accept()
{
if ( errorMsg.isEmpty() )
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;
}
if ( !warningMsg.isEmpty() )
{
QMessageBox::warning( this, tr( "SQL Warning" ), warningMsg );
QMessageBox::warning( this, tr( "SQL Evaluation" ), warningMsg );
}
}
QDialog::accept();
Expand Down

0 comments on commit bb08b64

Please sign in to comment.