Skip to content
Permalink
Browse files

Check topological editing yes/no when opening snapping dialog

  • Loading branch information
marco
marco committed Aug 30, 2011
1 parent a3797dd commit 5e4e4f7a6d030363fe91b5f09db4ab84c3c4e644
Showing with 21 additions and 10 deletions.
  1. +18 −10 src/app/qgssnappingdialog.cpp
  2. +3 −0 src/app/qgssnappingdialog.h
@@ -90,16 +90,7 @@ QgsSnappingDialog::QgsSnappingDialog( QWidget* parent, QgsMapCanvas* canvas ): Q
mLayerTreeWidget->resizeColumnToContents( 4 );
mLayerTreeWidget->setSortingEnabled( true );

// read the digitizing settings
int topologicalEditing = QgsProject::instance()->readNumEntry( "Digitizing", "/TopologicalEditing", 0 );
if ( topologicalEditing != 0 )
{
cbxEnableTopologicalEditingCheckBox->setCheckState( Qt::Checked );
}
else
{
cbxEnableTopologicalEditingCheckBox->setCheckState( Qt::Unchecked );
}
setTopologicalEditingState();
}

QgsSnappingDialog::QgsSnappingDialog()
@@ -182,6 +173,7 @@ void QgsSnappingDialog::apply()

void QgsSnappingDialog::show()
{
setTopologicalEditingState();
if ( mDock )
mDock->setVisible( true );
else
@@ -321,3 +313,19 @@ void QgsSnappingDialog::layerWillBeRemoved( QString theLayerId )
if ( item )
delete item;
}

void QgsSnappingDialog::setTopologicalEditingState()
{
// read the digitizing settings
int topologicalEditing = QgsProject::instance()->readNumEntry( "Digitizing", "/TopologicalEditing", 0 );
cbxEnableTopologicalEditingCheckBox->blockSignals( true );
if ( topologicalEditing != 0 )
{
cbxEnableTopologicalEditingCheckBox->setCheckState( Qt::Checked );
}
else
{
cbxEnableTopologicalEditingCheckBox->setCheckState( Qt::Unchecked );
}
cbxEnableTopologicalEditingCheckBox->blockSignals( false );
}
@@ -77,6 +77,9 @@ class QgsSnappingDialog: public QDialog, private Ui::QgsSnappingDialogBase
QgsMapCanvas* mMapCanvas;

QDockWidget *mDock;

/**Set checkbox value based on project setting*/
void setTopologicalEditingState();
};

#endif

0 comments on commit 5e4e4f7

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