disable project time use in wmst if it is invalid

This commit is contained in:
Samweli 2020-06-14 12:44:17 +02:00 committed by Nyall Dawson
parent 65bf008478
commit 5cc0a224af
2 changed files with 23 additions and 2 deletions

View File

@ -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() );

View File

@ -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>
@ -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>
@ -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">