Skip to content

Commit bb08b64

Browse files
authored
Merge pull request #6398 from DelazJ/QMessageBoxTitles
Updating some dialogs caption
2 parents 6573eb3 + ed99ba9 commit bb08b64

23 files changed

+124
-122
lines changed

src/gui/qgsmaplayerstylemanagerwidget.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ void QgsMapLayerStyleManagerWidget::saveAsDefault()
185185
if ( layer->dataProvider()->isSaveAndLoadStyleToDatabaseSupported() )
186186
{
187187
QMessageBox askToUser;
188+
askToUser.setWindowTitle( tr( "Save Style" ) );
188189
askToUser.setText( tr( "Save default style to: " ) );
189190
askToUser.setIcon( QMessageBox::Question );
190191
askToUser.addButton( tr( "Cancel" ), QMessageBox::RejectRole );
@@ -227,6 +228,7 @@ void QgsMapLayerStyleManagerWidget::loadDefault()
227228
if ( layer->dataProvider()->isSaveAndLoadStyleToDatabaseSupported() )
228229
{
229230
QMessageBox askToUser;
231+
askToUser.setWindowTitle( tr( "Load Style" ) );
230232
askToUser.setText( tr( "Load default style from: " ) );
231233
askToUser.setIcon( QMessageBox::Question );
232234
askToUser.addButton( tr( "Cancel" ), QMessageBox::RejectRole );

src/gui/qgsnewauxiliaryfielddialog.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ void QgsNewAuxiliaryFieldDialog::accept()
7979
const int idx = mLayer->fields().lookupField( fieldName );
8080
if ( idx >= 0 )
8181
{
82-
const QString title = tr( "Invalid name" );
83-
const QString msg = tr( "Auxiliary field '%1' already exists" ).arg( fieldName );
82+
const QString title = tr( "New Auxiliary Field" );
83+
const QString msg = tr( "Invalid name. Auxiliary field '%1' already exists." ).arg( fieldName );
8484
QMessageBox::critical( this, title, msg, QMessageBox::Ok );
8585
}
8686
else if ( def.comment().isEmpty() )
8787
{
88-
const QString title = tr( "Invalid name" );
89-
const QString msg = tr( "Name is a mandatory parameter" );
88+
const QString title = tr( "New Auxiliary Field" );
89+
const QString msg = tr( "Name is a mandatory parameter." );
9090
QMessageBox::critical( this, title, msg, QMessageBox::Ok );
9191
}
9292
else

src/gui/qgsnewgeopackagelayerdialog.cpp

+14-14
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ void QgsNewGeoPackageLayerDialog::mAddAttributeButton_clicked()
198198
QString myName = mFieldNameEdit->text();
199199
if ( myName == mFeatureIdColumnEdit->text() )
200200
{
201-
QMessageBox::critical( this, tr( "Invalid field name" ), tr( "The field cannot have the same name as the feature identifier" ) );
201+
QMessageBox::critical( this, tr( "Add Field" ), tr( "The field cannot have the same name as the feature identifier." ) );
202202
return;
203203
}
204204

@@ -259,8 +259,8 @@ bool QgsNewGeoPackageLayerDialog::apply()
259259
{
260260
QMessageBox msgBox;
261261
msgBox.setIcon( QMessageBox::Question );
262-
msgBox.setWindowTitle( tr( "The File Already Exists." ) );
263-
msgBox.setText( tr( "Do you want to overwrite the existing file with a new database or add a new layer to it?" ) );
262+
msgBox.setWindowTitle( tr( "New GeoPackage Layer" ) );
263+
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?" ) );
264264
QPushButton *overwriteButton = msgBox.addButton( tr( "Overwrite" ), QMessageBox::ActionRole );
265265
QPushButton *addNewLayerButton = msgBox.addButton( tr( "Add new layer" ), QMessageBox::ActionRole );
266266
msgBox.setStandardButtons( QMessageBox::Cancel );
@@ -311,8 +311,8 @@ bool QgsNewGeoPackageLayerDialog::apply()
311311
if ( !hGpkgDriver )
312312
{
313313
if ( !property( "hideDialogs" ).toBool() )
314-
QMessageBox::critical( this, tr( "Layer creation failed" ),
315-
tr( "GeoPackage driver not found" ) );
314+
QMessageBox::critical( this, tr( "New GeoPackage Layer" ),
315+
tr( "Layer creation failed. GeoPackage driver not found." ) );
316316
return false;
317317
}
318318

@@ -324,7 +324,7 @@ bool QgsNewGeoPackageLayerDialog::apply()
324324
{
325325
QString msg( tr( "Creation of database failed (OGR error: %1)" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
326326
if ( !property( "hideDialogs" ).toBool() )
327-
QMessageBox::critical( this, tr( "Layer creation failed" ), msg );
327+
QMessageBox::critical( this, tr( "New GeoPackage Layer" ), msg );
328328
return false;
329329
}
330330
}
@@ -336,14 +336,14 @@ bool QgsNewGeoPackageLayerDialog::apply()
336336
{
337337
QString msg( tr( "Opening of database failed (OGR error: %1)" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
338338
if ( !property( "hideDialogs" ).toBool() )
339-
QMessageBox::critical( this, tr( "Layer creation failed" ), msg );
339+
QMessageBox::critical( this, tr( "New GeoPackage Layer" ), msg );
340340
return false;
341341
}
342342
if ( hDriver != hGpkgDriver )
343343
{
344-
QString msg( tr( "Opening of file succeeded, but this is not a GeoPackage database" ) );
344+
QString msg( tr( "Opening of file succeeded, but this is not a GeoPackage database." ) );
345345
if ( !property( "hideDialogs" ).toBool() )
346-
QMessageBox::critical( this, tr( "Layer creation failed" ), msg );
346+
QMessageBox::critical( this, tr( "New GeoPackage Layer" ), msg );
347347
return false;
348348
}
349349
}
@@ -357,7 +357,7 @@ bool QgsNewGeoPackageLayerDialog::apply()
357357
{
358358
overwriteTable = property( "question_existing_layer_answer_overwrite" ).toBool();
359359
}
360-
else if ( QMessageBox::question( this, tr( "Existing layer" ),
360+
else if ( QMessageBox::question( this, tr( "New GeoPackage Layer" ),
361361
tr( "A table with the same name already exists. Do you want to overwrite it?" ),
362362
QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) == QMessageBox::Yes )
363363
{
@@ -421,7 +421,7 @@ bool QgsNewGeoPackageLayerDialog::apply()
421421
{
422422
QString msg( tr( "Creation of layer failed (OGR error: %1)" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
423423
if ( !property( "hideDialogs" ).toBool() )
424-
QMessageBox::critical( this, tr( "Layer creation failed" ), msg );
424+
QMessageBox::critical( this, tr( "New GeoPackage Layer" ), msg );
425425
return false;
426426
}
427427

@@ -455,7 +455,7 @@ bool QgsNewGeoPackageLayerDialog::apply()
455455
{
456456
if ( !property( "hideDialogs" ).toBool() )
457457
{
458-
QMessageBox::critical( this, tr( "Layer creation failed" ),
458+
QMessageBox::critical( this, tr( "New GeoPackage Layer" ),
459459
tr( "Creation of field %1 failed (OGR error: %2)" )
460460
.arg( fieldName, QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
461461
}
@@ -473,7 +473,7 @@ bool QgsNewGeoPackageLayerDialog::apply()
473473
{
474474
QString msg( tr( "Creation of layer failed (OGR error: %1)" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
475475
if ( !property( "hideDialogs" ).toBool() )
476-
QMessageBox::critical( this, tr( "Layer creation failed" ), msg );
476+
QMessageBox::critical( this, tr( "New GeoPackage Layer" ), msg );
477477
return false;
478478
}
479479
hDS.reset();
@@ -494,7 +494,7 @@ bool QgsNewGeoPackageLayerDialog::apply()
494494
else
495495
{
496496
if ( !property( "hideDialogs" ).toBool() )
497-
QMessageBox::critical( this, tr( "Invalid Layer" ), tr( "%1 is an invalid layer and cannot be loaded." ).arg( tableName ) );
497+
QMessageBox::critical( this, tr( "New GeoPackage Layer" ), tr( "%1 is an invalid layer and cannot be loaded." ).arg( tableName ) );
498498
delete layer;
499499
}
500500

src/gui/qgsoptionsdialogbase.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ void QgsOptionsDialogBase::optionsStackedWidget_WidgetRemoved( int index )
393393

394394
void QgsOptionsDialogBase::warnAboutMissingObjects()
395395
{
396-
QMessageBox::warning( nullptr, tr( "Missing objects" ),
396+
QMessageBox::warning( nullptr, tr( "Missing Objects" ),
397397
tr( "Base options dialog could not be initialized.\n\n"
398398
"Missing some of the .ui template objects:\n" )
399399
+ " mOptionsListWidget,\n mOptionsStackedWidget,\n mOptionsSplitter,\n mOptionsListFrame",

src/gui/qgsowssourceselect.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ void QgsOWSSourceSelect::mDeleteButton_clicked()
289289
{
290290
QString msg = tr( "Are you sure you want to remove the %1 connection and all associated settings?" )
291291
.arg( mConnectionsComboBox->currentText() );
292-
QMessageBox::StandardButton result = QMessageBox::question( this, tr( "Confirm Delete" ), msg, QMessageBox::Yes | QMessageBox::No );
292+
QMessageBox::StandardButton result = QMessageBox::question( this, tr( "Delete Connection" ), msg, QMessageBox::Yes | QMessageBox::No );
293293
if ( result == QMessageBox::Yes )
294294
{
295295
QgsOwsConnection::deleteConnection( mService, mConnectionsComboBox->currentText() );
@@ -631,9 +631,9 @@ void QgsOWSSourceSelect::addDefaultServers()
631631
settings.endGroup();
632632
populateConnectionList();
633633

634-
QMessageBox::information( this, tr( "WMS proxies" ), "<p>" + tr( "Several WMS servers have "
634+
QMessageBox::information( this, tr( "Add WMS Servers" ), "<p>" + tr( "Several WMS servers have "
635635
"been added to the server list. Note that if "
636-
"you access the internet via a web proxy, you will "
636+
"you access the Internet via a web proxy, you will "
637637
"need to set the proxy settings in the QGIS options dialog." ) + "</p>" );
638638
}
639639

src/gui/qgsquerybuilder.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -233,15 +233,15 @@ void QgsQueryBuilder::test()
233233
else if ( mLayer->dataProvider()->hasErrors() )
234234
{
235235
QMessageBox::warning( this,
236-
tr( "Query Failed" ),
236+
tr( "Query Result" ),
237237
tr( "An error occurred when executing the query." )
238238
+ tr( "\nThe data provider said:\n%1" ).arg( mLayer->dataProvider()->errors().join( QStringLiteral( "\n" ) ) ) );
239239
mLayer->dataProvider()->clearErrors();
240240
}
241241
else
242242
{
243243
QMessageBox::warning( this,
244-
tr( "Query Failed" ),
244+
tr( "Query Result" ),
245245
tr( "An error occurred when executing the query." ) );
246246
}
247247
}
@@ -254,14 +254,14 @@ void QgsQueryBuilder::accept()
254254
if ( mLayer->dataProvider()->hasErrors() )
255255
{
256256
QMessageBox::warning( this,
257-
tr( "Query Failed" ),
257+
tr( "Query Result" ),
258258
tr( "An error occurred when executing the query." )
259259
+ tr( "\nThe data provider said:\n%1" ).arg( mLayer->dataProvider()->errors().join( QStringLiteral( "\n" ) ) ) );
260260
mLayer->dataProvider()->clearErrors();
261261
}
262262
else
263263
{
264-
QMessageBox::warning( this, tr( "Error in Query" ), tr( "The subset string could not be set" ) );
264+
QMessageBox::warning( this, tr( "Query Result" ), tr( "Error in query. The subset string could not be set." ) );
265265
}
266266

267267
return;

src/gui/qgsrasterformatsaveoptionswidget.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ QString QgsRasterFormatSaveOptionsWidget::validateOptions( bool gui, bool report
378378
}
379379
else if ( ! createOptions.isEmpty() )
380380
{
381-
QMessageBox::information( this, QLatin1String( "" ), tr( "Cannot validate creation options" ), QMessageBox::Close );
381+
QMessageBox::information( this, QLatin1String( "" ), tr( "Cannot validate creation options." ), QMessageBox::Close );
382382
if ( tmpLayer )
383383
delete rasterLayer;
384384
return QString();

src/gui/qgsrasterlayersaveasdialog.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ QgsRasterLayerSaveAsDialog::QgsRasterLayerSaveAsDialog( QgsRasterLayer *rasterLa
197197
if ( files.isEmpty() )
198198
break;
199199

200-
if ( QMessageBox::warning( this, tr( "Warning" ),
200+
if ( QMessageBox::warning( this, tr( "Save Raster Layer" ),
201201
tr( "The directory %1 contains files which will be overwritten: %2" ).arg( dir.absolutePath(), files.join( QStringLiteral( ", " ) ) ),
202202
QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Ok )
203203
break;

src/gui/qgssearchquerybuilder.cpp

+14-14
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ void QgsSearchQueryBuilder::btnTest_clicked()
195195
if ( count == -1 )
196196
return;
197197

198-
QMessageBox::information( this, tr( "Search results" ), tr( "Found %n matching feature(s).", "test result", count ) );
198+
QMessageBox::information( this, tr( "Test Query" ), tr( "Found %n matching feature(s).", "test result", count ) );
199199
}
200200

201201
// This method tests the number of records that would be returned
@@ -204,7 +204,7 @@ long QgsSearchQueryBuilder::countRecords( const QString &searchString )
204204
QgsExpression search( searchString );
205205
if ( search.hasParserError() )
206206
{
207-
QMessageBox::critical( this, tr( "Search string parsing error" ), search.parserErrorString() );
207+
QMessageBox::critical( this, tr( "Query Result" ), search.parserErrorString() );
208208
return -1;
209209
}
210210

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

221221
if ( !search.prepare( &context ) )
222222
{
223-
QMessageBox::critical( this, tr( "Evaluation error" ), search.evalErrorString() );
223+
QMessageBox::critical( this, tr( "Query Result" ), search.evalErrorString() );
224224
return -1;
225225
}
226226

@@ -237,7 +237,7 @@ long QgsSearchQueryBuilder::countRecords( const QString &searchString )
237237
count++;
238238
}
239239

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

247247
if ( search.hasEvalError() )
248248
{
249-
QMessageBox::critical( this, tr( "Error during search" ), search.evalErrorString() );
249+
QMessageBox::critical( this, tr( "Query Result" ), search.evalErrorString() );
250250
return -1;
251251
}
252252

@@ -271,7 +271,7 @@ void QgsSearchQueryBuilder::btnOk_clicked()
271271
}
272272
else if ( numRecs == 0 )
273273
{
274-
QMessageBox::warning( this, tr( "No Records" ), tr( "The query you specified results in zero records being returned." ) );
274+
QMessageBox::warning( this, tr( "Query Result" ), tr( "The query you specified results in zero records being returned." ) );
275275
}
276276
else
277277
{
@@ -380,7 +380,7 @@ void QgsSearchQueryBuilder::saveQuery()
380380
QgsSettings s;
381381
QString lastQueryFileDir = s.value( QStringLiteral( "/UI/lastQueryFileDir" ), QDir::homePath() ).toString();
382382
//save as qqt (QGIS query file)
383-
QString saveFileName = QFileDialog::getSaveFileName( nullptr, tr( "Save query to file" ), lastQueryFileDir, QStringLiteral( "*.qqf" ) );
383+
QString saveFileName = QFileDialog::getSaveFileName( nullptr, tr( "Save Query to File" ), lastQueryFileDir, QStringLiteral( "*.qqf" ) );
384384
if ( saveFileName.isNull() )
385385
{
386386
return;
@@ -394,7 +394,7 @@ void QgsSearchQueryBuilder::saveQuery()
394394
QFile saveFile( saveFileName );
395395
if ( !saveFile.open( QIODevice::WriteOnly | QIODevice::Truncate ) )
396396
{
397-
QMessageBox::critical( nullptr, tr( "Error" ), tr( "Could not open file for writing" ) );
397+
QMessageBox::critical( nullptr, tr( "Save Query to File" ), tr( "Could not open file for writing." ) );
398398
return;
399399
}
400400

@@ -416,7 +416,7 @@ void QgsSearchQueryBuilder::loadQuery()
416416
QgsSettings s;
417417
QString lastQueryFileDir = s.value( QStringLiteral( "/UI/lastQueryFileDir" ), QDir::homePath() ).toString();
418418

419-
QString queryFileName = QFileDialog::getOpenFileName( nullptr, tr( "Load query from file" ), lastQueryFileDir, tr( "Query files" ) + " (*.qqf);;" + tr( "All files" ) + " (*)" );
419+
QString queryFileName = QFileDialog::getOpenFileName( nullptr, tr( "Load Query from File" ), lastQueryFileDir, tr( "Query files" ) + " (*.qqf);;" + tr( "All files" ) + " (*)" );
420420
if ( queryFileName.isNull() )
421421
{
422422
return;
@@ -425,20 +425,20 @@ void QgsSearchQueryBuilder::loadQuery()
425425
QFile queryFile( queryFileName );
426426
if ( !queryFile.open( QIODevice::ReadOnly ) )
427427
{
428-
QMessageBox::critical( nullptr, tr( "Error" ), tr( "Could not open file for reading" ) );
428+
QMessageBox::critical( nullptr, tr( "Load Query from File" ), tr( "Could not open file for reading." ) );
429429
return;
430430
}
431431
QDomDocument queryDoc;
432432
if ( !queryDoc.setContent( &queryFile ) )
433433
{
434-
QMessageBox::critical( nullptr, tr( "Error" ), tr( "File is not a valid xml document" ) );
434+
QMessageBox::critical( nullptr, tr( "Load Query from File" ), tr( "File is not a valid xml document." ) );
435435
return;
436436
}
437437

438438
QDomElement queryElem = queryDoc.firstChildElement( QStringLiteral( "Query" ) );
439439
if ( queryElem.isNull() )
440440
{
441-
QMessageBox::critical( nullptr, tr( "Error" ), tr( "File is not a valid query document" ) );
441+
QMessageBox::critical( nullptr, tr( "Load Query from File" ), tr( "File is not a valid query document." ) );
442442
return;
443443
}
444444

@@ -448,7 +448,7 @@ void QgsSearchQueryBuilder::loadQuery()
448448
QgsExpression search( query );
449449
if ( search.hasParserError() )
450450
{
451-
QMessageBox::critical( this, tr( "Search string parsing error" ), search.parserErrorString() );
451+
QMessageBox::critical( this, tr( "Query Result" ), search.parserErrorString() );
452452
return;
453453
}
454454

@@ -476,7 +476,7 @@ void QgsSearchQueryBuilder::loadQuery()
476476
if ( !mFieldMap.contains( attIt ) )
477477
{
478478
bool ok;
479-
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 ),
479+
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 ),
480480
existingAttributes, 0, false, &ok );
481481
if ( !ok || replaceAttribute.isEmpty() )
482482
{

src/gui/qgssqlcomposerdialog.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,12 @@ void QgsSQLComposerDialog::accept()
213213
{
214214
if ( errorMsg.isEmpty() )
215215
errorMsg = tr( "An error occurred during evaluation of the SQL statement." );
216-
QMessageBox::critical( this, tr( "SQL Error" ), errorMsg );
216+
QMessageBox::critical( this, tr( "SQL Evaluation" ), errorMsg );
217217
return;
218218
}
219219
if ( !warningMsg.isEmpty() )
220220
{
221-
QMessageBox::warning( this, tr( "SQL Warning" ), warningMsg );
221+
QMessageBox::warning( this, tr( "SQL Evaluation" ), warningMsg );
222222
}
223223
}
224224
QDialog::accept();

0 commit comments

Comments
 (0)