Skip to content
Permalink
Browse files
Replace the checkbox + groupbox by a checkable groupbox
for setting mesh static dataset groups
  • Loading branch information
DelazJ authored and nyalldawson committed Nov 5, 2021
1 parent e858c9f commit 2be05e2ec71daf80f3dbb6ac861d6c5756251dc6
Showing with 10 additions and 23 deletions.
  1. +3 −10 src/gui/mesh/qgsmeshlayerproperties.cpp
  2. +0 −2 src/gui/mesh/qgsmeshlayerproperties.h
  3. +7 −11 src/ui/mesh/qgsmeshlayerpropertiesbase.ui
@@ -86,7 +86,6 @@ QgsMeshLayerProperties::QgsMeshLayerProperties( QgsMapLayer *lyr, QgsMapCanvas *
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsMeshLayerProperties::showHelp );

connect( mTemporalReloadButton, &QPushButton::clicked, this, &QgsMeshLayerProperties::reloadTemporalProperties );
connect( mTemporalStaticDatasetCheckBox, &QCheckBox::toggled, this, &QgsMeshLayerProperties::onStaticDatasetCheckBoxChanged );
connect( mTemporalDateTimeReference, &QDateTimeEdit::dateTimeChanged, this, &QgsMeshLayerProperties::onTimeReferenceChange );
connect( mMeshLayer, &QgsMeshLayer::activeScalarDatasetGroupChanged, mStaticDatasetWidget, &QgsMeshStaticDatasetWidget::setScalarDatasetGroup );
connect( mMeshLayer, &QgsMeshLayer::activeVectorDatasetGroupChanged, mStaticDatasetWidget, &QgsMeshStaticDatasetWidget::setVectorDatasetGroup );
@@ -239,8 +238,7 @@ void QgsMeshLayerProperties::syncToLayer()
mComboBoxTemporalDatasetMatchingMethod->findData( temporalProperties->matchingMethod() ) );

mStaticDatasetWidget->syncToLayer();
mTemporalStaticDatasetCheckBox->setChecked( !mMeshLayer->temporalProperties()->isActive() );
mStaticDatasetGroupBox->setCollapsed( mIsMapSettingsTemporal && mMeshLayer->temporalProperties()->isActive() );
mStaticDatasetGroupBox->setChecked( !mMeshLayer->temporalProperties()->isActive() );
}

void QgsMeshLayerProperties::loadDefaultStyle()
@@ -389,8 +387,8 @@ void QgsMeshLayerProperties::apply()
static_cast<QgsUnitTypes::TemporalUnit>( mTemporalProviderTimeUnitComboBox->currentData().toInt() ) );

mStaticDatasetWidget->apply();
bool needEmitRendererChanged = mMeshLayer->temporalProperties()->isActive() == mTemporalStaticDatasetCheckBox->isChecked();
mMeshLayer->temporalProperties()->setIsActive( !mTemporalStaticDatasetCheckBox->isChecked() );
bool needEmitRendererChanged = mMeshLayer->temporalProperties()->isActive() == mStaticDatasetGroupBox->isChecked();
mMeshLayer->temporalProperties()->setIsActive( !mStaticDatasetGroupBox->isChecked() );
mMeshLayer->setTemporalMatchingMethod( static_cast<QgsMeshDataProviderTemporalCapabilities::MatchingTemporalDatasetMethod>(
mComboBoxTemporalDatasetMatchingMethod->currentData().toInt() ) );

@@ -479,11 +477,6 @@ void QgsMeshLayerProperties::onTimeReferenceChange()
mTemporalDateTimeEnd->setDateTime( timeExtent.end() );
}

void QgsMeshLayerProperties::onStaticDatasetCheckBoxChanged()
{
mStaticDatasetGroupBox->setCollapsed( !mTemporalStaticDatasetCheckBox->isChecked() && mIsMapSettingsTemporal );
}

void QgsMeshLayerProperties::urlClicked( const QUrl &url )
{
QFileInfo file( url.toLocalFile() );
@@ -87,8 +87,6 @@ class GUI_EXPORT QgsMeshLayerProperties : public QgsOptionsDialogBase, private U

void onTimeReferenceChange();

void onStaticDatasetCheckBoxChanged();

void urlClicked( const QUrl &url );
void loadMetadata();
void saveMetadataAs();
@@ -376,19 +376,15 @@
<widget class="QgsMeshDatasetGroupTreeWidget" name="mDatasetGroupTreeWidget" native="true"/>
</item>
<item>
<widget class="QCheckBox" name="mTemporalStaticDatasetCheckBox">
<widget class="QgsCollapsibleGroupBoxBasic" name="mStaticDatasetGroupBox">
<property name="toolTip">
<string>Static dataset even if the temporal navigation is on</string>
</property>
<property name="text">
<string>Always treat as a static dataset, regardless of temporal properties</string>
<string>Always treat as a static dataset even if the temporal navigation is on</string>
</property>
</widget>
</item>
<item>
<widget class="QgsCollapsibleGroupBoxBasic" name="mStaticDatasetGroupBox">
<property name="title">
<string>Static Dataset</string>
<string>Treat as Static Dataset</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
@@ -881,7 +877,7 @@
<tabstop>mLayerOrigNameLineEd</tabstop>
<tabstop>mCrsGroupBox</tabstop>
<tabstop>mCrsSelector</tabstop>
<tabstop>mTemporalStaticDatasetCheckBox</tabstop>
<tabstop>mStaticDatasetGroupBox</tabstop>
<tabstop>scrollArea</tabstop>
<tabstop>mSimplifyMeshGroupBox</tabstop>
<tabstop>mSimplifyReductionFactorSpinBox</tabstop>

0 comments on commit 2be05e2

Please sign in to comment.