[QGIS Commit] r9995 - in trunk/qgis/src: app ui
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Wed Jan 21 04:51:30 EST 2009
Author: mhugent
Date: 2009-01-21 04:51:29 -0500 (Wed, 21 Jan 2009)
New Revision: 9995
Modified:
trunk/qgis/src/app/qgsmaptooladdfeature.cpp
trunk/qgis/src/app/qgsoptions.cpp
trunk/qgis/src/ui/qgsoptionsbase.ui
Log:
apply patch 1498
Modified: trunk/qgis/src/app/qgsmaptooladdfeature.cpp
===================================================================
--- trunk/qgis/src/app/qgsmaptooladdfeature.cpp 2009-01-21 08:56:33 UTC (rev 9994)
+++ trunk/qgis/src/app/qgsmaptooladdfeature.cpp 2009-01-21 09:51:29 UTC (rev 9995)
@@ -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 @@
}
// 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 @@
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;
Modified: trunk/qgis/src/app/qgsoptions.cpp
===================================================================
--- trunk/qgis/src/app/qgsoptions.cpp 2009-01-21 08:56:33 UTC (rev 9994)
+++ trunk/qgis/src/app/qgsoptions.cpp 2009-01-21 09:51:29 UTC (rev 9995)
@@ -205,6 +205,8 @@
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 @@
settings.setValue( "/qgis/digitizing/marker_style", "Cross" );
}
+ settings.setValue( "/qgis/digitizing/disable_enter_attribute_values_dialog", chkDisableAttributeValuesDlg->isChecked() );
+
//
// Locale settings
//
Modified: trunk/qgis/src/ui/qgsoptionsbase.ui
===================================================================
--- trunk/qgis/src/ui/qgsoptionsbase.ui 2009-01-21 08:56:33 UTC (rev 9994)
+++ trunk/qgis/src/ui/qgsoptionsbase.ui 2009-01-21 09:51:29 UTC (rev 9995)
@@ -13,7 +13,9 @@
<string>QGIS Options</string>
</property>
<property name="windowIcon" >
- <iconset/>
+ <iconset>
+ <normaloff/>
+ </iconset>
</property>
<property name="sizeGripEnabled" >
<bool>true</bool>
@@ -25,7 +27,7 @@
<item row="0" column="0" >
<widget class="QTabWidget" name="tabWidget" >
<property name="currentIndex" >
- <number>6</number>
+ <number>0</number>
</property>
<widget class="QWidget" name="tabGeneral" >
<attribute name="title" >
@@ -38,18 +40,9 @@
<string>Project files</string>
</property>
<layout class="QVBoxLayout" >
- <property name="leftMargin" >
+ <property name="margin" >
<number>11</number>
</property>
- <property name="topMargin" >
- <number>11</number>
- </property>
- <property name="rightMargin" >
- <number>11</number>
- </property>
- <property name="bottomMargin" >
- <number>11</number>
- </property>
<item>
<widget class="QCheckBox" name="chbAskToSaveProjectChanges" >
<property name="text" >
@@ -88,7 +81,7 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>20</height>
@@ -124,7 +117,7 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>20</height>
@@ -256,7 +249,7 @@
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>577</width>
<height>21</height>
@@ -323,18 +316,9 @@
<string>Rendering quality</string>
</property>
<layout class="QVBoxLayout" >
- <property name="leftMargin" >
+ <property name="margin" >
<number>11</number>
</property>
- <property name="topMargin" >
- <number>11</number>
- </property>
- <property name="rightMargin" >
- <number>11</number>
- </property>
- <property name="bottomMargin" >
- <number>11</number>
- </property>
<item>
<widget class="QCheckBox" name="chkAntiAliasing" >
<property name="text" >
@@ -367,7 +351,7 @@
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
@@ -382,36 +366,18 @@
<string>&Map tools</string>
</attribute>
<layout class="QGridLayout" >
- <property name="leftMargin" >
+ <property name="margin" >
<number>11</number>
</property>
- <property name="topMargin" >
- <number>11</number>
- </property>
- <property name="rightMargin" >
- <number>11</number>
- </property>
- <property name="bottomMargin" >
- <number>11</number>
- </property>
<item row="2" column="0" >
<widget class="QGroupBox" name="groupBox_10" >
<property name="title" >
<string>Panning and zooming</string>
</property>
<layout class="QGridLayout" >
- <property name="leftMargin" >
+ <property name="margin" >
<number>11</number>
</property>
- <property name="topMargin" >
- <number>11</number>
- </property>
- <property name="rightMargin" >
- <number>11</number>
- </property>
- <property name="bottomMargin" >
- <number>11</number>
- </property>
<item row="0" column="1" >
<widget class="QComboBox" name="cmbWheelAction" >
<item>
@@ -472,24 +438,15 @@
<string>Measure tool</string>
</property>
<layout class="QGridLayout" >
- <property name="leftMargin" >
+ <property name="margin" >
<number>11</number>
</property>
- <property name="topMargin" >
- <number>11</number>
- </property>
- <property name="rightMargin" >
- <number>11</number>
- </property>
- <property name="bottomMargin" >
- <number>11</number>
- </property>
<item row="1" column="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>191</width>
<height>20</height>
@@ -542,18 +499,9 @@
<string>Search radius</string>
</property>
<layout class="QGridLayout" >
- <property name="leftMargin" >
+ <property name="margin" >
<number>11</number>
</property>
- <property name="topMargin" >
- <number>11</number>
- </property>
- <property name="rightMargin" >
- <number>11</number>
- </property>
- <property name="bottomMargin" >
- <number>11</number>
- </property>
<item row="1" column="0" colspan="2" >
<widget class="QLabel" name="textLabel2" >
<property name="text" >
@@ -598,7 +546,7 @@
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
@@ -612,8 +560,8 @@
<attribute name="title" >
<string>Digitizing</string>
</attribute>
- <layout class="QGridLayout" >
- <item row="0" column="0" >
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
<widget class="QGroupBox" name="mRubberBandGroupBox" >
<property name="title" >
<string>Rubberband</string>
@@ -665,7 +613,7 @@
</layout>
</widget>
</item>
- <item row="1" column="0" >
+ <item>
<widget class="QGroupBox" name="mSnappingGroupBox" >
<property name="title" >
<string>Snapping</string>
@@ -683,7 +631,7 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>311</width>
<height>20</height>
@@ -713,7 +661,7 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>241</width>
<height>20</height>
@@ -743,7 +691,7 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>61</width>
<height>20</height>
@@ -764,7 +712,7 @@
</layout>
</widget>
</item>
- <item row="2" column="0" >
+ <item>
<widget class="QGroupBox" name="mVertexMarkerGroupBox" >
<property name="title" >
<string>Vertex markers</string>
@@ -782,7 +730,7 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>281</width>
<height>20</height>
@@ -803,12 +751,31 @@
</layout>
</widget>
</item>
- <item row="3" column="0" >
+ <item>
+ <widget class="QGroupBox" name="mEnterAttributeValuesGroupBox" >
+ <property name="title" >
+ <string>Enter attribute values</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <widget class="QCheckBox" name="chkDisableAttributeValuesDlg" >
+ <property name="text" >
+ <string>Suppress attributes pop-up windows after each created feature</string>
+ </property>
+ <property name="tristate" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>547</width>
<height>71</height>
@@ -823,24 +790,15 @@
<string>CRS</string>
</attribute>
<layout class="QGridLayout" >
- <property name="leftMargin" >
+ <property name="margin" >
<number>11</number>
</property>
- <property name="topMargin" >
- <number>11</number>
- </property>
- <property name="rightMargin" >
- <number>11</number>
- </property>
- <property name="bottomMargin" >
- <number>11</number>
- </property>
<item row="3" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>51</width>
<height>31</height>
@@ -864,18 +822,9 @@
<string>When layer is loaded that has no coordinate reference system (CRS)</string>
</property>
<layout class="QVBoxLayout" >
- <property name="leftMargin" >
+ <property name="margin" >
<number>11</number>
</property>
- <property name="topMargin" >
- <number>11</number>
- </property>
- <property name="rightMargin" >
- <number>11</number>
- </property>
- <property name="bottomMargin" >
- <number>11</number>
- </property>
<item>
<widget class="QRadioButton" name="radPromptForProjection" >
<property name="text" >
@@ -947,7 +896,7 @@
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>501</width>
<height>51</height>
@@ -1068,7 +1017,7 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>241</width>
<height>20</height>
@@ -1084,7 +1033,7 @@
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>577</width>
<height>251</height>
@@ -1102,7 +1051,7 @@
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons" >
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
More information about the QGIS-commit
mailing list