Skip to content

Commit

Permalink
disable project time use in wmst if it is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
Samweli authored and nyalldawson committed Jun 15, 2020
1 parent 65bf008 commit 5cc0a22
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
11 changes: 11 additions & 0 deletions src/gui/raster/qgsrasterlayerproperties.cpp
Expand Up @@ -1374,6 +1374,17 @@ void QgsRasterLayerProperties::setSourceStaticTimeState()
mWmstOptionsLabel->setText( tr( "The static temporal options below are disabled because the layer "
"temporal properties are active, to enable them disable temporal properties "
"in the temporal tab. " ) );
QgsDateTimeRange range;
if ( QgsProject::instance()->timeSettings() )
range = QgsProject::instance()->timeSettings()->temporalRange();

if ( !range.begin().isValid() || !range.end().isValid() )
{
mProjectTemporalRange->setEnabled( false );
mProjectTemporalRangeLabel->setText( tr( "The option below is disabled because the project temporal range "
"is not valid, update the project temporal range in the project properties "
"with valid values in order to use it here." ) );
}

mWmstGroup->setChecked( uri.contains( QStringLiteral( "allowTemporalUpdates" ) ) &&
uri.value( QStringLiteral( "allowTemporalUpdates" ), true ).toBool() );
Expand Down
14 changes: 12 additions & 2 deletions src/ui/qgsrasterlayerpropertiesbase.ui
Expand Up @@ -430,7 +430,7 @@ border-radius: 2px;</string>
<widget class="QgsDateTimeEdit" name="mReferenceDateTimeEdit">
<property name="dateTime">
<datetime>
<hour>13</hour>
<hour>12</hour>
<minute>20</minute>
<second>36</second>
<year>2020</year>
Expand Down Expand Up @@ -560,7 +560,7 @@ border-radius: 2px;</string>
<widget class="QgsDateTimeEdit" name="mStartStaticDateTimeEdit">
<property name="dateTime">
<datetime>
<hour>20</hour>
<hour>18</hour>
<minute>3</minute>
<second>57</second>
<year>2020</year>
Expand Down Expand Up @@ -595,6 +595,16 @@ border-radius: 2px;</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="mProjectTemporalRangeLabel">
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="mProjectTemporalRange">
<property name="text">
Expand Down

0 comments on commit 5cc0a22

Please sign in to comment.