Skip to content

Commit

Permalink
Show 'unknown CRS' in status bar instead of blank text when project
Browse files Browse the repository at this point in the history
CRS is set to an unknown CRS

Refs #33458
  • Loading branch information
nyalldawson committed Feb 4, 2020
1 parent ab86227 commit c6319b2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/app/qgisapp.cpp
Expand Up @@ -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
Expand Down

0 comments on commit c6319b2

Please sign in to comment.