Skip to content

Commit b3b17b6

Browse files
committed
More message box fixes
1 parent 576030b commit b3b17b6

13 files changed

+33
-33
lines changed

src/app/qgisapp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10398,7 +10398,7 @@ bool QgisApp::saveDirty()
1039810398
// old code: mProjectIsDirtyFlag = true;
1039910399

1040010400
// prompt user to save
10401-
answer = QMessageBox::question( this, tr( "Save Project?" ),
10401+
answer = QMessageBox::question( this, tr( "Save Project" ),
1040210402
tr( "Do you want to save the current project? %1" )
1040310403
.arg( whyDirty ),
1040410404
QMessageBox::Save | QMessageBox::Cancel | QMessageBox::Discard,

src/app/qgsaddattrdialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ void QgsAddAttrDialog::accept()
9595
{
9696
if ( mIsShapeFile && mNameEdit->text().toLower() == QLatin1String( "shape" ) )
9797
{
98-
QMessageBox::warning( this, tr( "Warning" ),
98+
QMessageBox::warning( this, tr( "Add Field" ),
9999
tr( "Invalid field name. This field name is reserved and cannot be used." ) );
100100
return;
101101
}
102102
if ( mNameEdit->text().isEmpty() )
103103
{
104-
QMessageBox::warning( this, tr( "Warning" ),
104+
QMessageBox::warning( this, tr( "Add Field" ),
105105
tr( "No name specified. Please specify a name to create a new field." ) );
106106
return;
107107
}

src/app/qgsattributetabledialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ void QgsAttributeTableDialog::runFieldCalculation( QgsVectorLayer *layer, const
550550

551551
if ( !calculationSuccess )
552552
{
553-
QMessageBox::critical( nullptr, tr( "Error" ), tr( "An error occurred while evaluating the calculation string:\n%1" ).arg( error ) );
553+
QMessageBox::critical( nullptr, tr( "Update Attributes" ), tr( "An error occurred while evaluating the calculation string:\n%1" ).arg( error ) );
554554
mLayer->destroyEditCommand();
555555
}
556556
else
@@ -871,7 +871,7 @@ void QgsAttributeTableDialog::mActionAddAttribute_triggered()
871871
else
872872
{
873873
mLayer->destroyEditCommand();
874-
QMessageBox::critical( this, tr( "Failed to add field" ), tr( "Failed to add field '%1' of type '%2'. Is the field name unique?" ).arg( dialog.field().name(), dialog.field().typeName() ) );
874+
QMessageBox::critical( this, tr( "Add Field" ), tr( "Failed to add field '%1' of type '%2'. Is the field name unique?" ).arg( dialog.field().name(), dialog.field().typeName() ) );
875875
}
876876

877877

src/app/qgsbookmarks.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ QgsBookmarks::QgsBookmarks( QWidget *parent )
7777
db.setDatabaseName( QgsApplication::qgisUserDatabaseFilePath() );
7878
if ( ! db.open() )
7979
{
80-
QMessageBox::warning( this, tr( "Error" ),
80+
QMessageBox::warning( this, tr( "Spatial Bookmarks" ),
8181
tr( "Unable to open bookmarks database.\nDatabase: %1\nDriver: %2\nDatabase: %3" )
8282
.arg( QgsApplication::qgisUserDatabaseFilePath(),
8383
db.lastError().driverText(),
@@ -190,7 +190,7 @@ void QgsBookmarks::addClicked()
190190
}
191191
else
192192
{
193-
QMessageBox::warning( this, tr( "Error" ), tr( "Unable to create the bookmark.\nDriver: %1\nDatabase: %2" )
193+
QMessageBox::warning( this, tr( "Add Bookmark" ), tr( "Unable to create the bookmark.\nDriver: %1\nDatabase: %2" )
194194
.arg( mQgisModel->database().lastError().driverText(),
195195
mQgisModel->database().lastError().databaseText() ) );
196196
}
@@ -254,7 +254,7 @@ void QgsBookmarks::zoomToBookmark()
254254
rect = ct.transform( rect );
255255
if ( rect.isEmpty() )
256256
{
257-
QMessageBox::warning( this, tr( "Empty Extent" ), tr( "Reprojected extent is empty." ) );
257+
QMessageBox::warning( this, tr( "Zoom to Bookmark" ), tr( "Reprojected extent is empty." ) );
258258
return;
259259
}
260260
}
@@ -329,7 +329,7 @@ void QgsBookmarks::importFromXml()
329329
}
330330
if ( !query.exec( queryTxt ) )
331331
{
332-
QMessageBox::warning( this, tr( "Error" ), tr( "Unable to create the bookmark.\nDriver: %1\nDatabase: %2" )
332+
QMessageBox::warning( this, tr( "Import Bookmarks" ), tr( "Unable to create the bookmark.\nDriver: %1\nDatabase: %2" )
333333
.arg( query.lastError().driverText(),
334334
query.lastError().databaseText() ) );
335335
}

src/app/qgsdecorationgrid.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -805,18 +805,18 @@ bool QgsDecorationGrid::getIntervalFromCurrentLayer( double *values )
805805
QgsMapLayer *layer = QgisApp::instance()->mapCanvas()->currentLayer();
806806
if ( ! layer )
807807
{
808-
QMessageBox::warning( nullptr, tr( "Error" ), tr( "No active layer" ) );
808+
QMessageBox::warning( nullptr, tr( "Get Interval from Layer" ), tr( "No active layer" ) );
809809
return false;
810810
}
811811
if ( layer->type() != QgsMapLayer::RasterLayer )
812812
{
813-
QMessageBox::warning( nullptr, tr( "Error" ), tr( "Please select a raster layer" ) );
813+
QMessageBox::warning( nullptr, tr( "Get Interval from Layer" ), tr( "Please select a raster layer." ) );
814814
return false;
815815
}
816816
QgsRasterLayer *rlayer = dynamic_cast<QgsRasterLayer *>( layer );
817817
if ( !rlayer || rlayer->width() == 0 || rlayer->height() == 0 )
818818
{
819-
QMessageBox::warning( nullptr, tr( "Error" ), tr( "Invalid raster layer" ) );
819+
QMessageBox::warning( nullptr, tr( "Get Interval from Layer" ), tr( "Invalid raster layer" ) );
820820
return false;
821821
}
822822
QgsCoordinateReferenceSystem layerCRS = layer->crs();
@@ -826,7 +826,7 @@ bool QgsDecorationGrid::getIntervalFromCurrentLayer( double *values )
826826
// TODO calculate transformed values if necessary
827827
if ( layerCRS != mapCRS )
828828
{
829-
QMessageBox::warning( nullptr, tr( "Error" ), tr( "Layer CRS must be equal to project CRS" ) );
829+
QMessageBox::warning( nullptr, tr( "Get Interval from Layer" ), tr( "Layer CRS must be equal to project CRS." ) );
830830
return false;
831831
}
832832

src/app/qgsdiagramproperties.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ QgsDiagramProperties::QgsDiagramProperties( QgsVectorLayer *layer, QWidget *pare
453453
mDiagramTypeComboBox_currentIndexChanged( mDiagramTypeComboBox->currentIndex() );
454454
if ( mDiagramTypeComboBox->currentIndex() == -1 )
455455
{
456-
QMessageBox::warning( this, tr( "Unknown diagram type." ),
456+
QMessageBox::warning( this, tr( "Diagram Properties" ),
457457
tr( "The diagram type '%1' is unknown. A default type is selected for you." ).arg( mDiagramType ), QMessageBox::Ok );
458458
mDiagramTypeComboBox->setCurrentIndex( mDiagramTypeComboBox->findData( DIAGRAM_NAME_PIE ) );
459459
}

src/app/qgsfieldcalculator.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ void QgsFieldCalculator::accept()
173173

174174
if ( !exp.prepare( &expContext ) )
175175
{
176-
QMessageBox::critical( nullptr, tr( "Evaluation error" ), exp.evalErrorString() );
176+
QMessageBox::critical( nullptr, tr( "Evaluation Error" ), exp.evalErrorString() );
177177
return;
178178
}
179179

@@ -222,7 +222,7 @@ void QgsFieldCalculator::accept()
222222
if ( !mVectorLayer->addAttribute( newField ) )
223223
{
224224
QApplication::restoreOverrideCursor();
225-
QMessageBox::critical( nullptr, tr( "Provider error" ), tr( "Could not add the new field to the provider." ) );
225+
QMessageBox::critical( nullptr, tr( "Create New Field" ), tr( "Could not add the new field to the provider." ) );
226226
mVectorLayer->destroyEditCommand();
227227
return;
228228
}
@@ -244,7 +244,7 @@ void QgsFieldCalculator::accept()
244244
if ( ! exp.prepare( &expContext ) )
245245
{
246246
QApplication::restoreOverrideCursor();
247-
QMessageBox::critical( nullptr, tr( "Evaluation error" ), exp.evalErrorString() );
247+
QMessageBox::critical( nullptr, tr( "Evaluation Error" ), exp.evalErrorString() );
248248
return;
249249
}
250250
}
@@ -310,7 +310,7 @@ void QgsFieldCalculator::accept()
310310

311311
if ( !calculationSuccess )
312312
{
313-
QMessageBox::critical( nullptr, tr( "Error" ), tr( "An error occurred while evaluating the calculation string:\n%1" ).arg( error ) );
313+
QMessageBox::critical( nullptr, tr( "Evaluation Error" ), tr( "An error occurred while evaluating the calculation string:\n%1" ).arg( error ) );
314314
mVectorLayer->destroyEditCommand();
315315
return;
316316
}

src/app/qgsguivectorlayertools.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ bool QgsGuiVectorLayerTools::stopEditing( QgsVectorLayer *layer, bool allowCance
103103
buttons |= QMessageBox::Cancel;
104104

105105
switch ( QMessageBox::question( nullptr,
106-
tr( "Stop editing" ),
106+
tr( "Stop Editing" ),
107107
tr( "Do you want to save the changes to layer %1?" ).arg( layer->name() ),
108108
buttons ) )
109109
{

src/app/qgshandlebadlayers.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ void QgsHandleBadLayers::browseClicked()
266266

267267
QStringList selectedFiles;
268268
QString enc;
269-
QString title = tr( "Select file to replace '%1'" ).arg( fn );
269+
QString title = tr( "Select File to Replace '%1'" ).arg( fn );
270270

271271
QgsGuiUtils::openFilesRememberingFilter( memoryQualifier, fileFilter, selectedFiles, enc, title );
272272
if ( selectedFiles.size() != 1 )
@@ -279,7 +279,7 @@ void QgsHandleBadLayers::browseClicked()
279279
}
280280
else if ( mRows.size() > 1 )
281281
{
282-
QString title = tr( "Select new directory of selected files" );
282+
QString title = tr( "Select New Directory of Selected Files" );
283283

284284
QgsSettings settings;
285285
QString lastDir = settings.value( QStringLiteral( "UI/missingDirectory" ), QDir::homePath() ).toString();

src/app/qgsidentifyresultsdialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1838,7 +1838,7 @@ void QgsIdentifyResultsDialog::printCurrentItem()
18381838

18391839
if ( !wv )
18401840
{
1841-
QMessageBox::warning( this, tr( "Cannot print" ), tr( "Cannot print this item" ) );
1841+
QMessageBox::warning( this, tr( "Print HTML Response" ), tr( "Cannot print this item." ) );
18421842
return;
18431843
}
18441844

src/app/qgsmeasuretool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ void QgsMeasureTool::activate()
8585
( mCanvas->extent().height() > 360 ||
8686
mCanvas->extent().width() > 720 ) )
8787
{
88-
QMessageBox::warning( nullptr, tr( "Incorrect measure results" ),
88+
QMessageBox::warning( nullptr, tr( "Incorrect Measure Results" ),
8989
tr( "<p>This map is defined with a geographic coordinate system "
9090
"(latitude/longitude) "
9191
"but the map extents suggests that it is actually a projected "

src/app/qgsnewspatialitelayerdialog.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ void QgsNewSpatialiteLayerDialog::pbnFindSRID_clicked()
241241
}
242242
else
243243
{
244-
// XXX query failed -- warn the user some how
244+
// XXX query failed -- warn the user somehow
245245
QMessageBox::warning( nullptr, tr( "Error" ), tr( "Failed to load SRIDS: %1" ).arg( database.errorMessage() ) );
246246
status = false;
247247
}
@@ -289,8 +289,8 @@ bool QgsNewSpatialiteLayerDialog::createDb()
289289
{
290290
QMessageBox msgBox;
291291
msgBox.setIcon( QMessageBox::Question );
292-
msgBox.setWindowTitle( tr( "The File Already Exists." ) );
293-
msgBox.setText( tr( "Do you want to overwrite the existing file with a new database or add a new layer to it?" ) );
292+
msgBox.setWindowTitle( tr( "New SpatiaLite Layer" ) );
293+
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?" ) );
294294
QPushButton *overwriteButton = msgBox.addButton( tr( "Overwrite" ), QMessageBox::ActionRole );
295295
QPushButton *addNewLayerButton = msgBox.addButton( tr( "Add new layer" ), QMessageBox::ActionRole );
296296
msgBox.setStandardButtons( QMessageBox::Cancel );
@@ -480,7 +480,7 @@ bool QgsNewSpatialiteLayerDialog::apply()
480480
else
481481
{
482482
QgsDebugMsg( leLayerName->text() + " is an invalid layer - not loaded" );
483-
QMessageBox::critical( this, tr( "Invalid Layer" ), tr( "%1 is an invalid layer and cannot be loaded." ).arg( leLayerName->text() ) );
483+
QMessageBox::critical( this, tr( "SpatiaLite Database" ), tr( "%1 is an invalid layer and cannot be loaded." ).arg( leLayerName->text() ) );
484484
delete layer;
485485
}
486486

src/app/qgsoptions.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,7 @@ void QgsOptions::cbxProjectDefaultNew_toggled( bool checked )
10171017
QString fileName = QgsApplication::qgisSettingsDirPath() + QStringLiteral( "project_default.qgs" );
10181018
if ( ! QFile::exists( fileName ) )
10191019
{
1020-
QMessageBox::information( nullptr, tr( "Save default project" ), tr( "You must set a default project" ) );
1020+
QMessageBox::information( nullptr, tr( "Save Default Project" ), tr( "You must set a default project" ) );
10211021
cbxProjectDefaultNew->setChecked( false );
10221022
}
10231023
}
@@ -1028,11 +1028,11 @@ void QgsOptions::setCurrentProjectDefault()
10281028
QString fileName = QgsApplication::qgisSettingsDirPath() + QStringLiteral( "project_default.qgs" );
10291029
if ( QgsProject::instance()->write( fileName ) )
10301030
{
1031-
QMessageBox::information( nullptr, tr( "Save default project" ), tr( "Current project saved as default" ) );
1031+
QMessageBox::information( nullptr, tr( "Save Default Project" ), tr( "Current project saved as default" ) );
10321032
}
10331033
else
10341034
{
1035-
QMessageBox::critical( nullptr, tr( "Save default project" ), tr( "Error saving current project as default" ) );
1035+
QMessageBox::critical( nullptr, tr( "Save Default Project" ), tr( "Error saving current project as default" ) );
10361036
}
10371037
}
10381038

@@ -1920,13 +1920,13 @@ void QgsOptions::browseCacheDirectory()
19201920
void QgsOptions::clearCache()
19211921
{
19221922
QgsNetworkAccessManager::instance()->cache()->clear();
1923-
QMessageBox::information( this, tr( "Cache cleared" ), tr( "Content cache has been cleared" ) );
1923+
QMessageBox::information( this, tr( "Clear Cache" ), tr( "Content cache has been cleared." ) );
19241924
}
19251925

19261926
void QgsOptions::clearAccessCache()
19271927
{
19281928
QgsNetworkAccessManager::instance()->clearAccessCache();
1929-
QMessageBox::information( this, tr( "Cache cleared" ), tr( "Connection authentication cache has been cleared" ) );
1929+
QMessageBox::information( this, tr( "Clear Cache" ), tr( "Connection authentication cache has been cleared." ) );
19301930
}
19311931

19321932
void QgsOptions::optionsStackedWidget_CurrentChanged( int index )
@@ -2260,7 +2260,7 @@ void QgsOptions::scaleItemChanged( QListWidgetItem *changedScaleItem )
22602260
}
22612261
else
22622262
{
2263-
QMessageBox::warning( this, tr( "Invalid scale" ), tr( "The text you entered is not a valid scale." ) );
2263+
QMessageBox::warning( this, tr( "Set Scale" ), tr( "The text you entered is not a valid scale." ) );
22642264
changedScaleItem->setText( changedScaleItem->data( Qt::UserRole ).toString() );
22652265
}
22662266

0 commit comments

Comments
 (0)