Skip to content
Permalink
Browse files

apply patch 1498

git-svn-id: http://svn.osgeo.org/qgis/trunk@9995 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Jan 21, 2009
1 parent 3c261c6 commit e030ff32e303f306bb9b5c53ee74a6055260e03a
Showing with 96 additions and 115 deletions.
  1. +40 −12 src/app/qgsmaptooladdfeature.cpp
  2. +4 −0 src/app/qgsoptions.cpp
  3. +52 −103 src/ui/qgsoptionsbase.ui
@@ -28,6 +28,7 @@
#include "qgslogger.h"
#include <QMessageBox>
#include <QMouseEvent>
#include <QSettings>

QgsMapToolAddFeature::QgsMapToolAddFeature( QgsMapCanvas* canvas, enum CaptureTool tool ): QgsMapToolCapture( canvas, tool )
{
@@ -175,18 +176,28 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
}

// show the dialog to enter attribute values
QgsAttributeDialog * mypDialog = new QgsAttributeDialog( vlayer, f );
if ( mypDialog->exec() )
QSettings settings;
bool isDisabledAttributeValuesDlg = settings.value( "/qgis/digitizing/disable_enter_attribute_values_dialog", false ).toBool();
if ( isDisabledAttributeValuesDlg )
{
qDebug( "Adding feature to layer" );
vlayer->addFeature( *f );
}
else
{
qDebug( "Adding feature to layer failed" );
delete f;
QgsAttributeDialog * mypDialog = new QgsAttributeDialog( vlayer, f );
if ( mypDialog->exec() )
{
qDebug( "Adding feature to layer" );
vlayer->addFeature( *f );
}
else
{
qDebug( "Adding feature to layer failed" );
delete f;
}
delete mypDialog;
}
delete mypDialog;
mCanvas->refresh();
}

@@ -444,21 +455,38 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
f->addAttribute( it.key(), provider->defaultValue( it.key() ) );
}

QgsAttributeDialog * mypDialog = new QgsAttributeDialog( vlayer, f );
if ( mypDialog->exec() )
QSettings settings;
bool isDisabledAttributeValuesDlg = settings.value( "/qgis/digitizing/disable_enter_attribute_values_dialog", false ).toBool();
if ( isDisabledAttributeValuesDlg )
{
if ( vlayer->addFeature( *f ) )
{
//add points to other features to keep topology up-to-date
int topologicalEditing = QgsProject::instance()->readNumEntry( "Digitizing", "/TopologicalEditing", 0 );
if ( topologicalEditing )
{
vlayer->addTopologicalPoints( f->geometry() );
}
}
}
else
{
QgsAttributeDialog * mypDialog = new QgsAttributeDialog( vlayer, f );
if ( mypDialog->exec() )
{
//add points to other features to keep topology up-to-date
int topologicalEditing = QgsProject::instance()->readNumEntry( "Digitizing", "/TopologicalEditing", 0 );
if ( topologicalEditing )
if ( vlayer->addFeature( *f ) )
{
vlayer->addTopologicalPoints( f->geometry() );
//add points to other features to keep topology up-to-date
int topologicalEditing = QgsProject::instance()->readNumEntry( "Digitizing", "/TopologicalEditing", 0 );
if ( topologicalEditing )
{
vlayer->addTopologicalPoints( f->geometry() );
}
}
}
delete mypDialog;
}
delete f;
delete mypDialog;

delete mRubberBand;
mRubberBand = NULL;
@@ -205,6 +205,8 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
mMarkerStyleComboBox->setCurrentIndex( mMarkerStyleComboBox->findText( tr( "Cross" ) ) );
}

chkDisableAttributeValuesDlg->setChecked( settings.value( "/qgis/digitizing/disable_enter_attribute_values_dialog", false ).toBool() );

#ifdef Q_WS_MAC //MH: disable incremental update on Mac for now to avoid problems with resizing
groupBox_5->setEnabled( false );
#endif //Q_WS_MAC
@@ -363,6 +365,8 @@ void QgsOptions::saveOptions()
settings.setValue( "/qgis/digitizing/marker_style", "Cross" );
}

settings.setValue( "/qgis/digitizing/disable_enter_attribute_values_dialog", chkDisableAttributeValuesDlg->isChecked() );

//
// Locale settings
//

0 comments on commit e030ff3

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