Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #1223 from nirvn/messagebar_auto_crs
Browse files Browse the repository at this point in the history
push a message bar informing user of crs applied to newly added layer missing a crs
  • Loading branch information
NathanW2 committed Mar 5, 2014
2 parents 837642b + 25241b8 commit 08965ed
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/app/qgisapp.cpp
Expand Up @@ -421,15 +421,16 @@ void QgisApp::validateSrs( QgsCoordinateReferenceSystem &srs )
{
// XXX TODO: Change project to store selected CS as 'projectCRS' not 'selectedWkt'
authid = QgisApp::instance()->mapCanvas()->mapSettings().destinationCrs().authid();
QgsDebugMsg( "Layer srs set from project: " + authid );
QgisApp::instance()->statusBar()->showMessage( tr( "CRS undefined - defaulting to project CRS" ) );
srs.createFromOgcWmsCrs( authid );
QgsDebugMsg( "Layer srs set from project: " + authid );
messageBar()->pushMessage( tr( "CRS was undefined" ), tr( "defaulting to project CRS %1 - %2" ).arg( authid ).arg( srs.description() ), QgsMessageBar::WARNING, messageTimeout() );
}
else ///Projections/defaultBehaviour==useGlobal
{
authid = mySettings.value( "/Projections/layerDefaultCrs", GEO_EPSG_CRS_AUTHID ).toString();
srs.createFromOgcWmsCrs( authid );
QgisApp::instance()->statusBar()->showMessage( tr( "CRS undefined - defaulting to default CRS: %1" ).arg( authid ) );
QgsDebugMsg( "Layer srs set from default: " + authid );
messageBar()->pushMessage( tr( "CRS was undefined" ), tr( "defaulting to CRS %1 - %2" ).arg( authid ).arg( srs.description() ), QgsMessageBar::WARNING, messageTimeout() );
}
}

Expand Down

0 comments on commit 08965ed

Please sign in to comment.