Skip to content
Permalink
Browse files

Improve confusing error message, fix incorrect widget state restoration

  • Loading branch information
nyalldawson committed Aug 20, 2018
1 parent e8b2913 commit bf18f15ba9a7d81529d62d6b03ff0f341e695f0f
@@ -255,7 +255,7 @@ void QgsGeometryCheckerSetupTab::runChecks()
QgsVectorLayer *followBoundaryCheckLayer = ui.comboBoxFollowBoundaries->isEnabled() ? dynamic_cast<QgsVectorLayer *>( QgsProject::instance()->mapLayer( ui.comboBoxFollowBoundaries->currentData().toString() ) ) : nullptr;
if ( layers.contains( lineLayerCheckLayer ) || layers.contains( followBoundaryCheckLayer ) )
{
QMessageBox::critical( this, tr( "Check Geometries" ), tr( "The test layer set contains a layer selected for a topology check." ) );
QMessageBox::critical( this, tr( "Check Geometries" ), tr( "The selected input layers cannot contain a layer also selected for a topology check." ) );
return;
}

@@ -254,9 +254,12 @@ template<> void QgsGeometryCheckFactoryT<QgsGeometryFollowBoundariesCheck>::rest

template<> bool QgsGeometryCheckFactoryT<QgsGeometryFollowBoundariesCheck>::checkApplicability( Ui::QgsGeometryCheckerSetupTab &ui, int /*nPoint*/, int nLineString, int nPolygon ) const
{
ui.checkBoxFollowBoundaries->setEnabled( nLineString + nPolygon > 0 );
ui.checkBoxFollowBoundaries->setEnabled( nLineString + nPolygon > 0 );
return ui.checkBoxFollowBoundaries->isEnabled();
const bool enabled = nPolygon > 0;
if ( !enabled )
ui.checkBoxFollowBoundaries->setChecked( false );
ui.checkBoxFollowBoundaries->setEnabled( enabled );
ui.comboBoxFollowBoundaries->setEnabled( enabled && ui.checkBoxFollowBoundaries->isChecked() );
return enabled;
}

template<> QgsGeometryCheck *QgsGeometryCheckFactoryT<QgsGeometryFollowBoundariesCheck>::createInstance( QgsGeometryCheckerContext *context, const Ui::QgsGeometryCheckerSetupTab &ui ) const
@@ -371,9 +374,12 @@ template<> void QgsGeometryCheckFactoryT<QgsGeometryLineLayerIntersectionCheck>:

template<> bool QgsGeometryCheckFactoryT<QgsGeometryLineLayerIntersectionCheck>::checkApplicability( Ui::QgsGeometryCheckerSetupTab &ui, int /*nPoint*/, int nLineString, int /*nPolygon*/ ) const
{
ui.checkLineLayerIntersection->setEnabled( nLineString > 0 );
ui.comboLineLayerIntersection->setEnabled( nLineString > 0 );
return ui.checkLineLayerIntersection->isEnabled();
const bool enabled = nLineString > 0;
if ( !enabled )
ui.checkLineLayerIntersection->setChecked( false );
ui.checkLineLayerIntersection->setEnabled( enabled );
ui.comboLineLayerIntersection->setEnabled( enabled && ui.checkLineLayerIntersection->isChecked() );
return enabled;
}

template<> QgsGeometryCheck *QgsGeometryCheckFactoryT<QgsGeometryLineLayerIntersectionCheck>::createInstance( QgsGeometryCheckerContext *context, const Ui::QgsGeometryCheckerSetupTab &ui ) const

0 comments on commit bf18f15

Please sign in to comment.
You can’t perform that action at this time.