Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added new edit type for attributes that are not recommended to change
git-svn-id: http://svn.osgeo.org/qgis/trunk@10949 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jun 18, 2009
1 parent 76dd504 commit 7b23a7e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/app/qgsattributedialog.cpp
Expand Up @@ -238,10 +238,15 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeat

case QgsVectorLayer::LineEdit:
case QgsVectorLayer::UniqueValuesEditable:
case QgsVectorLayer::Immutable:
default:
{
QLineEdit *le = new QLineEdit( myFieldValue.toString() );

if ( editType == QgsVectorLayer::Immutable)
{
le->setEnabled(false);
}
if ( editType == QgsVectorLayer::UniqueValuesEditable )
{
QList<QVariant> values;
Expand Down
1 change: 1 addition & 0 deletions src/app/qgsvectorlayerproperties.cpp
Expand Up @@ -189,6 +189,7 @@ void QgsVectorLayerProperties::setRow( int row, int idx, const QgsField &field )
cb->addItem( tr( "range (slider)" ), QgsVectorLayer::SliderRange );
cb->addItem( tr( "file name" ), QgsVectorLayer::FileName );
cb->addItem( tr( "enumeration" ), QgsVectorLayer::Enumeration);
cb->addItem( tr( "immutable" ), QgsVectorLayer::Immutable);
cb->setSizeAdjustPolicy( QComboBox::AdjustToContentsOnFirstShow );
cb->setCurrentIndex( layer->editType( idx ) );

Expand Down
3 changes: 2 additions & 1 deletion src/core/qgsvectorlayer.h
Expand Up @@ -74,7 +74,8 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
EditRange,
SliderRange,
FileName,
Enumeration
Enumeration,
Immutable /*The attribute value should not be changed in the attribute form*/
};

struct RangeData
Expand Down

0 comments on commit 7b23a7e

Please sign in to comment.