Skip to content
Permalink
Browse files

Merge pull request #1223 from nirvn/messagebar_auto_crs

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 08965ed2f0382e0c398bcb4d8385b8ed2be2f093
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/app/qgisapp.cpp
@@ -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() );
}
}

0 comments on commit 08965ed

Please sign in to comment.
You can’t perform that action at this time.