Skip to content
Permalink
Browse files

Check topological editing yes/no when opening snapping dialog

  • Loading branch information
marco authored and timlinux committed Sep 7, 2011
1 parent 646588c commit d01c62479bc9afb5ba77361e3e93153cd44f0e84
Showing with 21 additions and 10 deletions.
  1. +18 −10 src/app/qgssnappingdialog.cpp
  2. +3 −0 src/app/qgssnappingdialog.h
@@ -89,16 +89,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()
@@ -181,6 +172,7 @@ void QgsSnappingDialog::apply()

void QgsSnappingDialog::show()
{
setTopologicalEditingState();
if ( mDock )
mDock->setVisible( true );
else
@@ -320,3 +312,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 d01c624

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