Skip to content
Permalink
Browse files

Show 'unknown CRS' in status bar instead of blank text when project

CRS is set to an unknown CRS

Refs #33458
  • Loading branch information
nyalldawson committed Feb 4, 2020
1 parent ab86227 commit c6319b263992c9d52646096d851cab6c674125ff
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/app/qgisapp.cpp
@@ -12902,12 +12902,16 @@ void QgisApp::removeWebToolBarIcon( QAction *qAction )

void QgisApp::updateCrsStatusBar()
{
if ( QgsProject::instance()->crs().isValid() )
const QgsCoordinateReferenceSystem projectCrs = QgsProject::instance()->crs();
if ( projectCrs.isValid() )
{
mOnTheFlyProjectionStatusButton->setText( QgsProject::instance()->crs().authid() );
if ( !projectCrs.authid().isEmpty() )
mOnTheFlyProjectionStatusButton->setText( projectCrs.authid() );
else
mOnTheFlyProjectionStatusButton->setText( QObject::tr( "Unknown CRS" ) );

mOnTheFlyProjectionStatusButton->setToolTip(
tr( "Current CRS: %1" ).arg( QgsProject::instance()->crs().userFriendlyIdentifier() ) );
tr( "Current CRS: %1" ).arg( projectCrs.userFriendlyIdentifier() ) );
mOnTheFlyProjectionStatusButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "mIconProjectionEnabled.svg" ) ) );
}
else

0 comments on commit c6319b2

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