Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Check topological editing yes/no when opening snapping dialog
  • Loading branch information
marco committed Aug 30, 2011
1 parent a3797dd commit 5e4e4f7
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 @@ -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()
Expand Down Expand Up @@ -182,6 +173,7 @@ void QgsSnappingDialog::apply()

void QgsSnappingDialog::show()
{
setTopologicalEditingState();
if ( mDock )
mDock->setVisible( true );
else
Expand Down Expand Up @@ -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 );
}
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 5e4e4f7

Please sign in to comment.