Skip to content

Commit

Permalink
Check topological editing yes/no when opening snapping dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
marco authored and timlinux committed Sep 7, 2011
1 parent 646588c commit d01c624
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
28 changes: 18 additions & 10 deletions src/app/qgssnappingdialog.cpp
Expand Up @@ -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()
Expand Down Expand Up @@ -181,6 +172,7 @@ void QgsSnappingDialog::apply()

void QgsSnappingDialog::show()
{
setTopologicalEditingState();
if ( mDock )
mDock->setVisible( true );
else
Expand Down Expand Up @@ -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 );
}
3 changes: 3 additions & 0 deletions src/app/qgssnappingdialog.h
Expand Up @@ -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.