Skip to content

Commit

Permalink
Improve Geometry Validation Dock Layout
Browse files Browse the repository at this point in the history
This reduces distance between the error list and the buttons to zoom to the location.
  • Loading branch information
m-kuhn committed Mar 18, 2019
1 parent 4e9c4b5 commit 2a02aa0
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 134 deletions.
9 changes: 0 additions & 9 deletions src/app/qgsgeometryvalidationdock.cpp
Expand Up @@ -50,7 +50,6 @@ QgsGeometryValidationDock::QgsGeometryValidationDock( const QString &title, QgsM
connect( mMapCanvas, &QgsMapCanvas::currentLayerChanged, this, &QgsGeometryValidationDock::updateLayerTransform );
connect( mMapCanvas, &QgsMapCanvas::destinationCrsChanged, this, &QgsGeometryValidationDock::updateLayerTransform );
connect( mMapCanvas, &QgsMapCanvas::transformContextChanged, this, &QgsGeometryValidationDock::updateLayerTransform );
connect( mTopologyChecksPendingButton, &QToolButton::clicked, this, &QgsGeometryValidationDock::triggerTopologyChecks );

mFeatureRubberband = new QgsRubberBand( mMapCanvas );
mErrorRubberband = new QgsRubberBand( mMapCanvas );
Expand Down Expand Up @@ -131,13 +130,6 @@ void QgsGeometryValidationDock::zoomToFeature()
}
}

void QgsGeometryValidationDock::triggerTopologyChecks()
{
QgsVectorLayer *layer = qobject_cast<QgsVectorLayer *>( mMapCanvas->currentLayer() );
if ( layer )
mGeometryValidationService->triggerTopologyChecks( layer );
}

void QgsGeometryValidationDock::updateLayerTransform()
{
if ( !mMapCanvas->currentLayer() )
Expand Down Expand Up @@ -305,7 +297,6 @@ void QgsGeometryValidationDock::onLayerEditingStatusChanged()
}
}
}
mTopologyChecksPendingButton->setEnabled( enabled );
}

void QgsGeometryValidationDock::onLayerDestroyed( QObject *layer )
Expand Down
1 change: 0 additions & 1 deletion src/app/qgsgeometryvalidationdock.h
Expand Up @@ -53,7 +53,6 @@ class QgsGeometryValidationDock : public QgsDockWidget, public Ui_QgsGeometryVal
void gotoPreviousError();
void zoomToProblem();
void zoomToFeature();
void triggerTopologyChecks();
void updateLayerTransform();
void onDataChanged( const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles );
void onRowsInserted();
Expand Down
204 changes: 80 additions & 124 deletions src/ui/qgsgeometryvalidationdockbase.ui
Expand Up @@ -6,16 +6,93 @@
<rect>
<x>0</x>
<y>0</y>
<width>418</width>
<height>404</height>
<width>616</width>
<height>968</height>
</rect>
</property>
<property name="windowTitle">
<string>Geometry Validation</string>
</property>
<widget class="QWidget" name="dockWidgetContents">
<layout class="QGridLayout" name="gridLayout_2">
<item row="3" column="0" colspan="2">
<item row="0" column="5">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="3">
<widget class="QToolButton" name="mZoomToFeatureButton">
<property name="text">
<string>Zoom To Feature</string>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionZoomToSelected.svg</normaloff>:/images/themes/default/mActionZoomToSelected.svg</iconset>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
<item row="0" column="6">
<widget class="QToolButton" name="mNextButton">
<property name="text">
<string>Next</string>
</property>
<property name="arrowType">
<enum>Qt::RightArrow</enum>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="4">
<widget class="QToolButton" name="mZoomToProblemButton">
<property name="text">
<string>Zoom To Problem</string>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionZoomToLayer.svg</normaloff>:/images/themes/default/mActionZoomToLayer.svg</iconset>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QToolButton" name="mPreviousButton">
<property name="text">
<string>Previous</string>
</property>
<property name="arrowType">
<enum>Qt::LeftArrow</enum>
</property>
</widget>
</item>
<item row="1" column="0" colspan="8">
<widget class="QListView" name="mErrorListView"/>
</item>
<item row="2" column="0" colspan="8">
<widget class="QWidget" name="mProblemDetailWidget" native="true">
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
Expand All @@ -30,106 +107,6 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item row="1" column="6">
<widget class="QToolButton" name="mNextButton">
<property name="text">
<string>Next</string>
</property>
<property name="arrowType">
<enum>Qt::RightArrow</enum>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QToolButton" name="mPreviousButton">
<property name="text">
<string>Previous</string>
</property>
<property name="arrowType">
<enum>Qt::LeftArrow</enum>
</property>
</widget>
</item>
<item row="1" column="2">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="3">
<widget class="QToolButton" name="mZoomToFeatureButton">
<property name="text">
<string>Zoom To Feature</string>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionZoomToSelected.svg</normaloff>:/images/themes/default/mActionZoomToSelected.svg</iconset>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QToolButton" name="mZoomToProblemButton">
<property name="text">
<string>Zoom To Problem</string>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionZoomToLayer.svg</normaloff>:/images/themes/default/mActionZoomToLayer.svg</iconset>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
<item row="1" column="7">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="5">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2" colspan="4">
<widget class="QLabel" name="mProblemDescriptionLabel">
<property name="sizePolicy">
Expand Down Expand Up @@ -165,27 +142,6 @@
</layout>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QListView" name="mErrorListView"/>
</item>
<item row="0" column="1">
<widget class="QToolButton" name="mTopologyChecksPendingButton">
<property name="text">
<string>…</string>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mIconTopologicalEditing.svg</normaloff>:/images/themes/default/mIconTopologicalEditing.svg</iconset>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="mValidationRunningLabel">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
Expand Down

0 comments on commit 2a02aa0

Please sign in to comment.