Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
show reference time input only for reference time enabled layers
  • Loading branch information
Samweli committed Mar 30, 2020
1 parent 3a74358 commit ac2a183
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 16 deletions.
12 changes: 11 additions & 1 deletion src/gui/raster/qgsrasterlayerproperties.cpp
Expand Up @@ -1263,8 +1263,18 @@ void QgsRasterLayerProperties::setSourceStaticTimeState()
mEndStaticDateTimeEdit->setDateTime( QDateTime::fromString( parts.at( 1 ), Qt::ISODateWithMs ) );
}

const QString referenceTimeExent = uri.param( QStringLiteral( "referenceTimeDimensionExtent" ) );

mReferenceTime->setEnabled( !referenceTimeExent.isEmpty() );
mReferenceDateTimeEdit->setVisible( !referenceTimeExent.isEmpty() );

QString referenceTimeLabelText = referenceTimeExent.isEmpty() ?
tr( "There is no reference time in the layer's capabilities." ) : QString();
mReferenceTimeLabel->setText( referenceTimeLabelText );

const QString referenceTime = uri.param( QStringLiteral( "reference_time" ) );
if ( !referenceTime.isEmpty() )

if ( !referenceTime.isEmpty() && !referenceTimeExent.isEmpty() )
{
if ( referenceTime.contains( '/' ) )
{
Expand Down
35 changes: 20 additions & 15 deletions src/ui/qgsrasterlayerpropertiesbase.ui
Expand Up @@ -302,8 +302,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>643</width>
<height>679</height>
<width>634</width>
<height>680</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
Expand Down Expand Up @@ -482,7 +482,7 @@ border-radius: 2px;</string>
<widget class="QgsDateTimeEdit" name="mReferenceDateTimeEdit">
<property name="dateTime">
<datetime>
<hour>22</hour>
<hour>21</hour>
<minute>20</minute>
<second>36</second>
<year>2020</year>
Expand All @@ -508,6 +508,13 @@ border-radius: 2px;</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="mReferenceTimeLabel">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down Expand Up @@ -597,8 +604,8 @@ border-radius: 2px;</string>
<rect>
<x>0</x>
<y>0</y>
<width>512</width>
<height>524</height>
<width>550</width>
<height>514</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_10">
Expand Down Expand Up @@ -1197,8 +1204,8 @@ border-radius: 2px;</string>
<rect>
<x>0</x>
<y>0</y>
<width>341</width>
<height>474</height>
<width>359</width>
<height>467</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
Expand Down Expand Up @@ -1551,7 +1558,7 @@ border-radius: 2px;</string>
<x>0</x>
<y>0</y>
<width>98</width>
<height>46</height>
<height>45</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_16">
Expand Down Expand Up @@ -1768,8 +1775,8 @@ border-radius: 2px;</string>
<rect>
<x>0</x>
<y>0</y>
<width>579</width>
<height>209</height>
<width>631</width>
<height>205</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_12">
Expand Down Expand Up @@ -1838,7 +1845,7 @@ border-radius: 2px;</string>
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Cantarell'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Cantarell';&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
Expand Down Expand Up @@ -1998,8 +2005,8 @@ p, li { white-space: pre-wrap; }
<rect>
<x>0</x>
<y>0</y>
<width>337</width>
<height>684</height>
<width>364</width>
<height>667</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_12">
Expand Down Expand Up @@ -2583,8 +2590,6 @@ p, li { white-space: pre-wrap; }
</tabstops>
<resources>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
</resources>
<connections>
<connection>
Expand Down

0 comments on commit ac2a183

Please sign in to comment.