Skip to content
Permalink
Browse files

updates on temporal layer indicator logic

  • Loading branch information
Samweli authored and nyalldawson committed Mar 6, 2020
1 parent 54d608c commit e621d1624b2c6d11e3192df619acf2da7def9821
@@ -235,6 +235,8 @@ Q_GUI_EXPORT extern int qt_defaultDpiX();
#include "qgslayertreeviewbadlayerindicator.h"
#include "qgslayertreeviewnonremovableindicator.h"
#include "qgslayertreeviewnocrsindicator.h"
#include "qgslayertreeviewprojecttimeindicator.h"
#include "qgslayertreeviewtemporalindicator.h"
#include "qgslayout.h"
#include "qgslayoutatlas.h"
#include "qgslayoutcustomdrophandler.h"
@@ -4501,6 +4503,8 @@ void QgisApp::initLayerTreeView()
new QgsLayerTreeViewFilterIndicatorProvider( mLayerTreeView ); // gets parented to the layer view
new QgsLayerTreeViewEmbeddedIndicatorProvider( mLayerTreeView ); // gets parented to the layer view
new QgsLayerTreeViewMemoryIndicatorProvider( mLayerTreeView ); // gets parented to the layer view
new QgsLayerTreeViewProjectTimeIndicatorProvider( mLayerTreeView ); // gets parented to the layer view
new QgsLayerTreeViewTemporalIndicatorProvider( mLayerTreeView ); // gets parented to the layer view
new QgsLayerTreeViewNoCrsIndicatorProvider( mLayerTreeView ); // gets parented to the layer view
QgsLayerTreeViewBadLayerIndicatorProvider *badLayerIndicatorProvider = new QgsLayerTreeViewBadLayerIndicatorProvider( mLayerTreeView ); // gets parented to the layer view
connect( badLayerIndicatorProvider, &QgsLayerTreeViewBadLayerIndicatorProvider::requestChangeDataSource, this, &QgisApp::changeDataSource );
@@ -87,7 +87,7 @@ class CORE_EXPORT QgsMapLayerTemporalProperties : public QgsTemporalProperty
void setTemporalSource( TemporalSource source );
private:

TemporalSource mSource = TemporalSource::Layer;
TemporalSource mSource = Layer;

};

@@ -1031,6 +1031,9 @@ void QgsRasterLayerProperties::apply()
hueSaturationFilter->setColorizeStrength( sliderColorizeStrength->value() );
}

// Update temporal properties
mTemporalWidget->saveTemporalProperties();

//set the blend mode for the layer
mRasterLayer->setBlendMode( mBlendModeComboBox->blendMode() );

@@ -1099,9 +1102,6 @@ void QgsRasterLayerProperties::apply()
mRasterLayer->setCustomProperty( "WMSPublishDataSourceUrl", mPublishDataSourceUrlCheckBox->isChecked() );
mRasterLayer->setCustomProperty( "WMSBackgroundLayer", mBackgroundLayerCheckBox->isChecked() );

// Update temporal properties
mTemporalWidget->saveTemporalProperties();

// Force a redraw of the legend
mRasterLayer->setLegend( QgsMapLayerLegend::defaultRasterLegend( mRasterLayer ) );

@@ -160,6 +160,7 @@ void QgsRasterLayerTemporalPropertiesWidget::saveTemporalProperties()
if ( rasterLayer && rasterLayer->temporalProperties() )
{
rasterLayer->temporalProperties()->setTemporalRange( normalRange );
rasterLayer->temporalProperties()->setTemporalSource( QgsMapLayerTemporalProperties::TemporalSource::Layer );

if ( mReferenceCheckBox->isChecked() )
{
@@ -183,11 +184,12 @@ void QgsRasterLayerTemporalPropertiesWidget::saveTemporalProperties()

if ( rasterLayer && rasterLayer->temporalProperties() )
{
rasterLayer->temporalProperties()->setTemporalRange( projectRange );

if ( !projectRange.begin().isValid() || !projectRange.end().isValid() )
return;

rasterLayer->temporalProperties()->setTemporalRange( projectRange );
rasterLayer->temporalProperties()->setTemporalSource( QgsMapLayerTemporalProperties::TemporalSource::Project );

if ( mReferenceCheckBox->isChecked() )
{
QgsDateTimeRange referenceRange = QgsDateTimeRange( mStartReferenceDateTimeEdit->dateTime(),

0 comments on commit e621d16

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