Skip to content
Permalink
Browse files

Add help button to mesh layer properties dialog

and open dedicated section
  • Loading branch information
DelazJ authored and PeterPetrik committed Mar 12, 2020
1 parent e6fa6c8 commit dad3c0b3ce038b2b1d24301ad7800709f1bd9b97
@@ -64,12 +64,14 @@ QgsMeshLayerProperties::QgsMeshLayerProperties( QgsMapLayer *lyr, QgsMapCanvas *
connect( buttonBox->button( QDialogButtonBox::Apply ), &QAbstractButton::clicked, this, &QgsMeshLayerProperties::apply );

connect( mMeshLayer, &QgsMeshLayer::dataChanged, this, &QgsMeshLayerProperties::syncAndRepaint );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsMeshLayerProperties::showHelp );

#ifdef HAVE_3D
mMesh3DWidget = new QgsMeshLayer3DRendererWidget( mMeshLayer, canvas, mOptsPage_3DView );

mOptsPage_3DView->setLayout( new QVBoxLayout( mOptsPage_3DView ) );
mOptsPage_3DView->layout()->addWidget( mMesh3DWidget );
mOptsPage_3DView->setProperty( "helpPage", QStringLiteral( "working_with_mesh/mesh_properties.html#d-view-properties" ) );
#else
delete mOptsPage_3DView; // removes both the "3d view" list item and its page
#endif
@@ -91,6 +93,13 @@ QgsMeshLayerProperties::QgsMeshLayerProperties( QgsMapLayer *lyr, QgsMapCanvas *
if ( !mMeshLayer->styleManager()->isDefault( mMeshLayer->styleManager()->currentStyle() ) )
title += QStringLiteral( " (%1)" ).arg( mMeshLayer->styleManager()->currentStyle() );
restoreOptionsBaseUi( title );

//Add help page references
mOptsPage_Information->setProperty( "helpPage", QStringLiteral( "working_with_mesh/mesh_properties.html#information-properties" ) );
mOptsPage_Source->setProperty( "helpPage", QStringLiteral( "working_with_mesh/mesh_properties.html#source-properties" ) );
mOptsPage_Style->setProperty( "helpPage", QStringLiteral( "working_with_mesh/mesh_properties.html#symbology-properties" ) );
mOptsPage_Rendering->setProperty( "helpPage", QStringLiteral( "working_with_mesh/mesh_properties.html#rendering-properties" ) );

}

void QgsMeshLayerProperties::syncToLayer()
@@ -251,3 +260,17 @@ void QgsMeshLayerProperties::syncAndRepaint()
syncToLayer();
mMeshLayer->triggerRepaint();
}

void QgsMeshLayerProperties::showHelp()
{
const QVariant helpPage = mOptionsStackedWidget->currentWidget()->property( "helpPage" );

if ( helpPage.isValid() )
{
QgsHelp::openHelp( helpPage.toString() );
}
else
{
QgsHelp::openHelp( QStringLiteral( "working_with_mesh/mesh_properties.html" ) );
}
}
@@ -71,6 +71,8 @@ class APP_EXPORT QgsMeshLayerProperties : public QgsOptionsDialogBase, private U
QgsMeshLayer3DRendererWidget *mMesh3DWidget = nullptr;

friend class TestQgsMeshLayerPropertiesDialog;

void showHelp();
};


@@ -357,7 +357,7 @@ border-radius: 2px;</string>
</layout>
</widget>
<widget class="QWidget" name="mOptsPage_3DView"/>
<widget class="QWidget" name="mOptspage_Rendering">
<widget class="QWidget" name="mOptsPage_Rendering">
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QgsCollapsibleGroupBox" name="mSimplifyMeshGroupBox">
@@ -474,7 +474,7 @@ border-radius: 2px;</string>
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>

0 comments on commit dad3c0b

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