Skip to content
Permalink
Browse files

Target corresponding help section for raster layer properties tabs

  • Loading branch information
DelazJ authored and PeterPetrik committed Mar 12, 2020
1 parent dad3c0b commit 613145c4df233c878b5e927ba59a1d601855a807
Showing with 23 additions and 2 deletions.
  1. +23 −2 src/gui/raster/qgsrasterlayerproperties.cpp
@@ -256,7 +256,7 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer *lyr, QgsMapCanv

// We can calculate histogram for all data sources but estimated only if
// size is unknown - could also be enabled if well supported (estimated histogram
// and and let user know that it is estimated)
// and let user know that it is estimated)
if ( !provider || !( provider->capabilities() & QgsRasterDataProvider::Size ) )
{
// disable Histogram tab completely
@@ -489,6 +489,18 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer *lyr, QgsMapCanv
title += QStringLiteral( " (%1)" ).arg( mRasterLayer->styleManager()->currentStyle() );
restoreOptionsBaseUi( title );
optionsStackedWidget_CurrentChanged( mOptionsStackedWidget->currentIndex() );

//Add help page references
mOptsPage_Information->setProperty( "helpPage", QStringLiteral( "working_with_raster/raster_properties.html#information-properties" ) );
mOptsPage_Source->setProperty( "helpPage", QStringLiteral( "working_with_raster/raster_properties.html#source-properties" ) );
mOptsPage_Style->setProperty( "helpPage", QStringLiteral( "working_with_raster/raster_properties.html#symbology-properties" ) );
mOptsPage_Transparency->setProperty( "helpPage", QStringLiteral( "working_with_raster/raster_properties.html#transparency-properties" ) );
mOptsPage_Histogram->setProperty( "helpPage", QStringLiteral( "working_with_raster/raster_properties.html#histogram-properties" ) );
mOptsPage_Rendering->setProperty( "helpPage", QStringLiteral( "working_with_raster/raster_properties.html#rendering-properties" ) );
mOptsPage_Pyramids->setProperty( "helpPage", QStringLiteral( "working_with_raster/raster_properties.html#pyramids-properties" ) );
mOptsPage_Metadata->setProperty( "helpPage", QStringLiteral( "working_with_raster/raster_properties.html#metadata-properties" ) );
mOptsPage_Legend->setProperty( "helpPage", QStringLiteral( "working_with_raster/raster_properties.html#legend-properties" ) );
mOptsPage_Server->setProperty( "helpPage", QStringLiteral( "working_with_raster/raster_properties.html#server-properties" ) );
}

void QgsRasterLayerProperties::setCurrentPage( const QString &page )
@@ -2123,5 +2135,14 @@ void QgsRasterLayerProperties::onCancel()

void QgsRasterLayerProperties::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "working_with_raster/raster_properties.html" ) );
const QVariant helpPage = mOptionsStackedWidget->currentWidget()->property( "helpPage" );

if ( helpPage.isValid() )
{
QgsHelp::openHelp( helpPage.toString() );
}
else
{
QgsHelp::openHelp( QStringLiteral( "working_with_raster/raster_properties.html" ) );
}
}

0 comments on commit 613145c

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