@@ -1250,6 +1250,18 @@ void QgisApp::createStatusBar()
1250
1250
" to add a large number of layers and symbolize them before rendering." ) );
1251
1251
mRenderSuppressionCBox ->setToolTip ( tr ( " Toggle map rendering" ) );
1252
1252
statusBar ()->addPermanentWidget ( mRenderSuppressionCBox , 0 );
1253
+ // On the fly projection active CRS label
1254
+ mOnTheFlyProjectionStatusLabel = new QLabel ( QString (), statusBar () );
1255
+ mOnTheFlyProjectionStatusLabel ->setFont ( myFont );
1256
+ mOnTheFlyProjectionStatusLabel ->setMinimumWidth ( 10 );
1257
+ mOnTheFlyProjectionStatusLabel ->setMaximumHeight ( 20 );
1258
+ mOnTheFlyProjectionStatusLabel ->setMargin ( 3 );
1259
+ mOnTheFlyProjectionStatusLabel ->setAlignment ( Qt::AlignCenter );
1260
+ mOnTheFlyProjectionStatusLabel ->setFrameStyle ( QFrame::NoFrame );
1261
+ QString myCrs = mMapCanvas ->mapRenderer ()->destinationCrs ().authid ();
1262
+ mOnTheFlyProjectionStatusLabel ->setText ( myCrs );
1263
+ mOnTheFlyProjectionStatusLabel ->setToolTip ( tr ( " Current CRS" ) );
1264
+ statusBar ()->addPermanentWidget ( mOnTheFlyProjectionStatusLabel , 0 );
1253
1265
// On the fly projection status bar icon
1254
1266
// Changed this to a tool button since a QPushButton is
1255
1267
// sculpted on OS X and the icon is never displayed [gsherman]
@@ -1258,15 +1270,7 @@ void QgisApp::createStatusBar()
1258
1270
// Maintain uniform widget height in status bar by setting button height same as labels
1259
1271
// For Qt/Mac 3.3, the default toolbutton height is 30 and labels were expanding to match
1260
1272
mOnTheFlyProjectionStatusButton ->setMaximumHeight ( mScaleLabel ->height () );
1261
- mOnTheFlyProjectionStatusButton ->setIcon ( getThemeIcon ( " mIconProjectionDisabled.png" ) );
1262
- if ( !QFile::exists ( QgsApplication::defaultThemePath () + " /mIconProjectionDisabled.png" ) )
1263
- {
1264
- QMessageBox::critical ( this , tr ( " Resource Location Error" ),
1265
- tr ( " Error reading icon resources from: \n %1\n Quitting..." ).arg (
1266
- QgsApplication::defaultThemePath () + " /mIconProjectionDisabled.png"
1267
- ) );
1268
- exit ( 0 );
1269
- }
1273
+ mOnTheFlyProjectionStatusButton ->setIcon ( getThemeIcon ( " mIconProjectionEnabled.png" ) );
1270
1274
mOnTheFlyProjectionStatusButton ->setWhatsThis ( tr ( " This icon shows whether "
1271
1275
" on the fly coordinate reference system transformation is enabled or not. "
1272
1276
" Click the icon to bring up "
@@ -2512,11 +2516,14 @@ void QgisApp::fileNew( bool thePromptToSaveFlag )
2512
2516
// enable OTF CRS transformation if necessary
2513
2517
if ( settings.value ( " /Projections/otfTransformEnabled" , 0 ).toBool () )
2514
2518
{
2519
+ QString myCrs = mMapCanvas ->mapRenderer ()->destinationCrs ().authid ();
2520
+ mOnTheFlyProjectionStatusLabel ->setText ( myCrs );
2515
2521
myRenderer->setProjectionsEnabled ( true );
2516
2522
mOnTheFlyProjectionStatusButton ->setIcon ( getThemeIcon ( " mIconProjectionEnabled.png" ) );
2517
2523
}
2518
2524
else
2519
2525
{
2526
+ mOnTheFlyProjectionStatusLabel ->setText ( " ---" );
2520
2527
myRenderer->setProjectionsEnabled ( false );
2521
2528
}
2522
2529
@@ -5372,11 +5379,14 @@ void QgisApp::hasCrsTransformEnabled( bool theFlag )
5372
5379
// update icon
5373
5380
if ( theFlag )
5374
5381
{
5382
+ QString myCrs = mMapCanvas ->mapRenderer ()->destinationCrs ().authid ();
5383
+ mOnTheFlyProjectionStatusLabel ->setText ( myCrs );
5375
5384
mOnTheFlyProjectionStatusButton ->setIcon (
5376
- getThemeIcon ( " mIconProjectionEnabled.png" ) );
5385
+ getThemeIcon ( " mIconProjectionEnabled.png" ) );
5377
5386
}
5378
5387
else
5379
5388
{
5389
+ mOnTheFlyProjectionStatusLabel ->setText ( " ---" );
5380
5390
mOnTheFlyProjectionStatusButton ->setIcon (
5381
5391
getThemeIcon ( " mIconProjectionDisabled.png" ) );
5382
5392
}
0 commit comments