Skip to content

Commit

Permalink
fix minor issues from nyalldawson review
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterPetrik committed Jun 27, 2018
1 parent b88b7bc commit c971ab9
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 44 deletions.
2 changes: 1 addition & 1 deletion src/app/mesh/qgsmeshlayerproperties.cpp
Expand Up @@ -149,7 +149,7 @@ void QgsMeshLayerProperties::addDataset()
if ( ok )
{
syncToLayer();
QgsDebugMsg( "datasets added to the mesh layer" );
QMessageBox::information( this, tr( "Load mesh datasets" ), tr( "Datasets successfully added to the mesh layer" ) );

This comment has been minimized.

Copy link
@nirvn

nirvn Jun 28, 2018

Contributor

What about using a message bar with a timeout to make it go away automatically instead?

This comment has been minimized.

Copy link
@PeterPetrik

PeterPetrik Jun 28, 2018

Author Contributor

I can do that too, but this will be rewritten anyways for 3.4 release once we introduce dataset groups in MDAL. We want to show also list of files that are associated with the mesh, and be able to remove them.

This comment has been minimized.

Copy link
@nirvn

nirvn Jun 28, 2018

Contributor

Ah ok, if it's not permanent then do as you please ;-P

}
else
{
Expand Down
12 changes: 10 additions & 2 deletions src/app/mesh/qgsmeshrendereractivedatasetwidget.cpp
Expand Up @@ -148,12 +148,20 @@ void QgsMeshRendererActiveDatasetWidget::updateMetadata( int datasetIndex )
const QgsMeshDatasetMetadata meta = mMeshLayer->dataProvider()->datasetMetadata( datasetIndex );
QString msg;
msg += QStringLiteral( "<table>" );
msg += QStringLiteral( "<tr><td>%1</td><td>%2</td></tr>" ).arg( tr( "is on vertices" ) ).arg( meta.isOnVertices() );
msg += QStringLiteral( "<tr><td>%1</td><td>%2</td></tr>" ).arg( tr( "is vector" ) ).arg( meta.isVector() );

msg += QStringLiteral( "<tr><td>%1</td><td>%2</td></tr>" )
.arg( tr( "Is on vertices" ) )
.arg( meta.isOnVertices() ? tr( "Yes" ) : tr( "No" ) );

msg += QStringLiteral( "<tr><td>%1</td><td>%2</td></tr>" )
.arg( tr( "Is vector" ) )
.arg( meta.isVector() ? tr( "Yes" ) : tr( "No" ) );

for ( auto it = meta.extraOptions().constBegin(); it != meta.extraOptions().constEnd(); ++it )
{
msg += QStringLiteral( "<tr><td>%1</td><td>%2</td></tr>" ).arg( it.key() ).arg( it.value() );
}

msg += QStringLiteral( "</table>" );
mActiveDatasetMetadata->setText( msg );
}
Expand Down
12 changes: 6 additions & 6 deletions src/app/mesh/qgsmeshrenderervectorsettingswidget.cpp
Expand Up @@ -73,11 +73,11 @@ QgsMeshRendererVectorSettings QgsMeshRendererVectorSettingsWidget::settings() co
settings.setFilterMax( val );

// arrow head
val = filterValue( mHeadWidthLineEdit->text(), settings.arrowHeadWidthRatio() );
settings.setArrowHeadWidthRatio( val );
val = filterValue( mHeadWidthLineEdit->text(), settings.arrowHeadWidthRatio() * 100.0 );
settings.setArrowHeadWidthRatio( val / 100.0 );

val = filterValue( mHeadLengthLineEdit->text(), settings.arrowHeadLengthRatio() );
settings.setArrowHeadLengthRatio( val );
val = filterValue( mHeadLengthLineEdit->text(), settings.arrowHeadLengthRatio() * 100.0 );
settings.setArrowHeadLengthRatio( val / 100.0 );

// shaft length
auto method = static_cast<QgsMeshRendererVectorSettings::ArrowScalingMethod>( mShaftLengthComboBox->currentIndex() );
Expand Down Expand Up @@ -125,8 +125,8 @@ void QgsMeshRendererVectorSettingsWidget::syncToLayer( )
}

// arrow head
mHeadWidthLineEdit->setText( QString::number( settings.arrowHeadWidthRatio() ) );
mHeadLengthLineEdit->setText( QString::number( settings.arrowHeadLengthRatio() ) );
mHeadWidthLineEdit->setText( QString::number( settings.arrowHeadWidthRatio() * 100.0 ) );
mHeadLengthLineEdit->setText( QString::number( settings.arrowHeadLengthRatio() * 100.0 ) );

// shaft length
mShaftLengthComboBox->setCurrentIndex( settings.shaftLengthMethod() );
Expand Down
9 changes: 2 additions & 7 deletions src/ui/mesh/qgsmeshrendereractivedatasetwidgetbase.ui
Expand Up @@ -10,7 +10,7 @@
<x>0</x>
<y>0</y>
<width>254</width>
<height>260</height>
<height>304</height>
</rect>
</property>
<property name="windowTitle">
Expand All @@ -22,14 +22,9 @@
<property name="minimumSize">
<size>
<width>0</width>
<height>55</height>
<height>100</height>
</size>
</property>
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
</widget>
</item>
<item>
Expand Down
32 changes: 14 additions & 18 deletions src/ui/mesh/qgsmeshrenderermeshsettingswidgetbase.ui
Expand Up @@ -6,32 +6,28 @@
<rect>
<x>0</x>
<y>0</y>
<width>328</width>
<height>71</height>
<width>279</width>
<height>84</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QgsDoubleSpinBox" name="mLineWidthSpinBox"/>
</item>
<item>
<widget class="QgsColorButton" name="mColorWidget"/>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Line Width and Color</string>
</property>
</spacer>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QgsDoubleSpinBox" name="mLineWidthSpinBox"/>
</item>
<item>
<widget class="QgsColorButton" name="mColorWidget"/>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
Expand Down
4 changes: 2 additions & 2 deletions src/ui/mesh/qgsmeshrendererscalarsettingswidgetbase.ui
Expand Up @@ -19,7 +19,7 @@
<item>
<widget class="QLabel" name="mScalarMinLabel">
<property name="text">
<string>min</string>
<string>Min</string>
</property>
</widget>
</item>
Expand All @@ -33,7 +33,7 @@
<item>
<widget class="QLabel" name="mScalarMaxLabel">
<property name="text">
<string>max</string>
<string>Max</string>
</property>
</widget>
</item>
Expand Down
21 changes: 13 additions & 8 deletions src/ui/mesh/qgsmeshrenderervectorsettingswidgetbase.ui
Expand Up @@ -15,14 +15,19 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QgsDoubleSpinBox" name="mLineWidthSpinBox"/>
</item>
<item>
<widget class="QgsColorButton" name="mColorWidget"/>
</item>
</layout>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Line Width and Color</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QgsDoubleSpinBox" name="mLineWidthSpinBox"/>
</item>
<item>
<widget class="QgsColorButton" name="mColorWidget"/>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="filterByMagGroupBox">
Expand Down

0 comments on commit c971ab9

Please sign in to comment.